Getting MariaDB ModuleNotFoundError in Python - python

The error happens at the import line in the Python code.
sys.path.append("/usr/local/Cellar/mariadb-connector-c/3.3.3")
sys.path.append("/usr/local/Cellar/mariadb-connector-c")
import mariadb
I already have the mariadb and mariadb-1.1.5.post3.dist-info added to the sys.path, I can see it when I do a print (sys.path)
The error message I am getting is : Exception has occurred: ModuleNotFoundError No module named 'mariadb._mariadb'
pip show mariadb returns:
Name: mariadb
Version: 1.1.5.post3
Summary: Python MariaDB extension
Home-page: https://www.github.com/mariadb-corporation/mariadb-connector-python
Author: Georg Richter
Author-email:
License: LGPL 2.1
Location: /Users/melinda.walker/GitHub/bi-ingestion-scripts/venv/lib/python3.9/site-packages
Requires: packaging
Required-by:
I am also using a virtual environment.
My python --version is : Python 3.9.16
I used brew install mariadb-connector-c to install mariadb-connector-c.
It is similar to issues: Installing mariadb 1.1.3 package on Python and Python import Mariadb: 'ModuleNotFoundError'.
I tried what Georg suggested: pip3 uninstall mariadb and pip3 install --no-cache mariadb but I am still getting that error.

Related

What's means undefined symbol: cublasLtHSHMatmulAlgoInit, version libcublasLt.so.11

I am using SpaCy and SpaCy Stanza in Jupyter notebook with python 3, and I get the following error
OSError: /opt/conda/lib/python3.7/site-packages/torch/lib/../../nvidia/cublas/lib/libcublas.so.11: undefined symbol: cublasLtHSHMatmulAlgoInit, version libcublasLt.so.11
can anybody help me?
I tried update
pip install --user nvidia-pyindexpip install --user nvidia-tensorflow
but the error remains, How can I fix it?
I fix this error by adding the directory into LD_LIBRARY_PATH environment variable.
Like this:
export LD_LIBRARY_PATH=/opt/conda/lib/python3.9/site-packages/nvidia/cublas/lib/:$LD_LIBRARY_PATH
Hope this helps.
You can find your path by
pip show nvidia-cudnn
then
Name: nvidia-cudnn
Version: 8.2.0.51
Summary: cuDNN runtime libraries
Home-page: https://developer.nvidia.com/cuda-zone
Author: Nvidia CUDA Installer Team
Author-email: cuda_installer#nvidia.com
License: NVIDIA Proprietary Software
Location: /home/yourname/.local/lib/python3.8/site-packages
Requires: wheel, setuptools
Required-by: nvidia-tensorrt
Location: shown where your package installed.
In this case,adding following path to LD_LIBRARY_PATH solve my problem
/home/yourname/.local/lib/python3.8/site-packages/nvidia/cublas/lib/

How do I install GDAL on Centos 6?

I'm trying to install GeoDjango, it looks like I need PostGis. I got PostGis install fine on my mac, but I can't get it install on Centos 6.
Following this here: https://gis.stackexchange.com/questions/211962/yum-install-postgis-on-centos-7
I get stuck on:
yum install gdal-devel.x86_64
Here's what I get for errors
--> Finished Dependency Resolution
Error: Package: gpsbabel-1.5.0-3.el6.x86_64 (epel)
Requires: libQtCore.so.4()(64bit)
Error: Package: gdal-1.9.2-4.el6.x86_64 (elgis)
Requires: libpoppler.so.5()(64bit)
Error: Package: gdal-libs-1.9.2-4.el6.x86_64 (elgis)
Requires: libpoppler.so.5()(64bit)
Error: Package: gdal-java-1.9.2-4.el6.x86_64 (elgis)
Requires: libpoppler.so.5()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

Python module github3 is not working with ansible

I'm trying to use the ansible module github_release that use the python module github3.py.
The machine that I need run the playbook don't have permission to access the internet so I downloaded (pip download github3.py) then in other machine I inslated (pip install ./*.whl).
I'm sure that the python module is instaled:
$ pip show github3.py
Name: github3.py
Version: 1.3.0
Summary: Python wrapper for the GitHub API(http://developer.github.com/v3)
Home-page: https://github3.readthedocs.io
Author: Ian Stapleton Cordasco
Author-email: graffatcolmingov#gmail.com
License: 3-clause BSD
Location: /usr/lib/python2.7/site-packages
Requires: python-dateutil, uritemplate, requests, jwcrypto
Required-by:
But my playbook have the same error:
TASK [Get latest release from repository] ***********************************************************************************************************************
fatal: [vg1200yr.dc.sedc.internal.vodafone.com]: FAILED! => {"changed": false, "msg": "Missing required github3 module (check docs or install with: pip install github3.py==1.0.0a4)"}
Any idea why my playbook can find the github3 module?

ImportError: The version of cryptography does not match the loaded shared object

I am using Paramiko. Any idea how I can use the Paramiko.RSAKey.from_private_key() function?
I'm interested in using a function to parse a private key and use that private key for SSHClient.
Code I wanted to run:
file = './file.pem'
mypkey = paramiko.RSAKey.from_private_key_file(file)
Result:
ImportError: The version of cryptography does not match the loaded shared object. This can happen if you have multiple copies of cryptography installed in your Python path. Please try creating a new virtual environment to resolve this issue. Loaded python version: 2.4.2, shared object version: b'2.7'
It apears to be a problem with the lib cryptography:
from cryptography.hazmat.backends.openssl.backend import backend
I have python 3.7.1
I have installed Paramiko using pip install
Here are some infromation about the version I have used for paramiko :
pip show paramiko
Name: paramiko
Version: 2.6.0
Summary: SSH2 protocol library
Home-page: https://github.com/paramiko/paramiko/
License: LGPL
Requires: pynacl, bcrypt, cryptography
Required-by: sshtunnel
Here are some infromation about the version I have used for cryptography:
pip show cryptography
Name: cryptography
Version: 2.7
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
License: BSD or Apache License, Version 2.0
Requires: six, asn1crypto, cffi
Required-by: service-identity, pyOpenSSL, paramiko
I have unistalled cryptography and installed the same ver of the paramiko:
pip install cryptography==2.6.0
The same ERROR stays
This problem is almost always caused by having multiple copies of cryptography installed simultaneously. This can happen if you've installed cryptography both with pip and your system's package manager. Try building a new virtualenv, installing your dependencies into that, and that should resolve the issue.

Python easy_install wrong version conflict

I try to build docker-compose from source with setuptools like this
python setup.py develop
But I get the follwoing error:
error: requests 2.11.1 is installed but requests!=2.18.0,>=2.14.2 is required by set(['docker'])
but running
pip show requests
gives the following result:
Name: requests
Version: 2.18.4
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: me#kennethreitz.org
License: Apache 2.0
Location: /home/florian/.local/lib/python2.7/site-packages
Requires: certifi, chardet, idna, urllib3
Is there anything cached by setuptools or something similar?
try
sudo pip install --upgrade docker-compose
There was an issue in the git repo source code, that blocked me from building.

Categories