I've been trying to install the python GDAL binding from source with ./configure --with-python but when i attemp
from osgeo import gdal
I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libgdal.so.1: cannot open shared object file: No such file or directory
It seems to me to be an error with swig.
If you have GDAL installed and libgdal.so exists, it looks like the python module is just not finding the library. You can try setting the LD_LIBRARY_PATH environment variable to point to the directory containing libgdal.so (e.g. /usr/local/lib). If that works, run ldconfig to update your library settings so you won't have to set LD_LIBRARY_PATH every time (which many consider a bad idea).
You Can try
sudo apt-get install odbcinst1debian2 libgdal1h
and then try importing
Related
I installed umfpack using pip install scikit-umfpack and tried importing the umfpack module
from scikits import umfpack
I'm running into the following error:
Traceback (most recent call last):
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/_umfpack.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('__umfpack', [dirname(__file__)])
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '__umfpack'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/__init__.py", line 12, in <module>
from .umfpack import *
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/umfpack.py", line 130, in <module>
from . import _umfpack as _um
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/_umfpack.py", line 28, in <module>
__umfpack = swig_import_helper()
File "/Users/christianadib/pyfrbus_package/venv/lib/python3.9/site-packages/scikits/umfpack/_umfpack.py", line 20, in swig_import_helper
import __umfpack
ModuleNotFoundError: No module named '__umfpack'
Christian, it's not easy:
pypi umfpack says: first build a local SuiteSparse UMFPACK
building SuiteSparse libraries requires some knowledge of Makefiles
and on macos otool / install_name_tool
before pip install, you need a suitable ~/.numpy-site.cfg.
Added: the setup.py is old and messy;
I had a simpler one which worked onceaponatime, let me know.
You could also try `conda install scikit-umfpack` instead of `pip`,
BUT mixing different package managers is asking for trouble;
if you do, keep the pip and conda package trees separate.
I am trying to install tensorflow with cuda and gpu support. When I try to import it, I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/srivishnu/.local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/home/srivishnu/.local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/srivishnu/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/srivishnu/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/srivishnu/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/srivishnu/.local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
this error occurs when I type this command in:
import tensorflow as tf
Can you please help me solve this problem
This is almost always a missing path in your LD_LIBRARY_PATH. Find libcublas.so.9.0 on your system (start looking under /usr/local).
If you don't find it, then install the CUDA 9.0 Toolkit (note that with TF 1.5 you want 9.0 and not 9.1, a common gotcha, at least common in-so-far as I made that mistake myself).
https://developer.nvidia.com/cuda-90-download-archive
If you have it, then update your LD_LIBRARY_PATH to point to the appropriate lib directory.
If you've done either of those and are now getting a similar looking error for a cudnn related library, then repeat that process for the CUDNN library.
https://developer.nvidia.com/cudnn
I think the latest version works. Tensorflow depends on both CUDA toolkit and the CuDNN library extension.
Note that you can install all of this in userspace too (sudo is typical, but not required).
To easily find the libcublas file, run sudo find / -iname 'libcublas*'. Then add the path to the folder containing that file into LD_LIBRARY_PATH.
I had cuda-9.0 installed and the LD_LIBRARY_PATH was pointing to the correct location. Turned out that the permission of the folder /usr/local/cuda-9.0 was wrong. I could not even cd to the folder. I changed the owner of the cuda-9.0 from root to my-user-name and after that python was able to find the missing library.
I ran a program and got the following error:
samples$ python Sample.py
Traceback (most recent call last):
File "Sample.py", line 9, in <module>
import Leap, sys, thread, time
File "/Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/Leap.py", line 28, in <module>
LeapPython = swig_import_helper()
File "/Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/Leap.py", line 24, in swig_import_helper
_mod = imp.load_module('LeapPython', fp, pathname, description)
ImportError: dlopen(/Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/LeapPython.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/2.7/Python
Referenced from: /Users/mutt/Downloads/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/samples/LeapPython.so
Reason: image not found
In /Library/Frameworks/Python.framework/Versions/, there is a 3.4 version, but not 2.7, which is what the program wants. There is a 2.7 in /System/Library/Frameworks/Python.framework/Versions/
This is an example file from the LeapMotion SDK
Why isn't there a 2.7 version in the /Library/... folder?
Should I install it differently somehow? I have already installed 3.4 and 2.7.11 with homebrew
Should I make a symlink from the other folder?
Why is this happening?
On macOS create a Symlink as #Peter mentioned in comment:
sudo ln -s /System/Library/Frameworks/Python.framework /Library/Frameworks
I installed the GDAL library on Ubuntu 14.04 through the Anaconda (Python 3.5) distribution. After installation, which seems to work fine, I try importing it and I get this error:
>>>from osgeo import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/klab/anaconda3/lib/python3.5/site-packages/osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "/home/klab/anaconda3/lib/python3.5/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "/home/klab/anaconda3/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/home/klab/anaconda3/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: libcom_err.so.3: cannot open shared object file: No such file or directory
I tried installing through PIP and Conda install commands with the same error. I did go to the directory where this should exist, and it indeed is missing. I figured that if this were a true dependency, it would have installed automatically. Has anybody else had this problem?
I was trying to follow this link, but it wasn't helpful.
https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/2-bXTbSiQzg
I was able to figure it out. I used the following command to find the location of the shared library.
locate libcom_err
It was of course the wrong one. It was libcom_err.so.2. I used a symbolic link in the same directory to point to the right library.
ln -s libcom_err.so.2 libcom_err.so.3
Worked perfectly!
I want to install and use PyKCS11 to my mac (via terminal). I want to use python3 for the whole process. I downloaded it from here: https://bitbucket.org/PyKCS11/pykcs11.
I have python3 installed at /usr/local/lib. I downloaded the folder, ran make build, and everything was ok. When i run make install i get the following:
python3 setup.py install --prefix=/usr/local --root=/
running install
running build
running build_py
running build_ext
running install_lib
running install_egg_info
Removing /usr/local/lib/python3.4/site-packages/PyKCS11-1.3.2-py3.4.egg-info
Writing /usr/local/lib/python3.4/site-packages/PyKCS11-1.3.2-py3.4.egg-info
(*Removing... is from the previous time i executed the command)
After that, i open python3 and execute import PyKCS11
and i get the following error:
>>> import PyKCS11
Traceback (most recent call last):
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_LowLevel', [dirname(__file__)])
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_LowLevel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/__init__.py", line 20, in <module>
import PyKCS11.LowLevel
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 28, in <module>
_LowLevel = swig_import_helper()
File "/Users/Dkostas/Desktop/tools/PyKCS11/PyKCS11/LowLevel.py", line 20, in swig_import_helper
import _LowLevel
ImportError: No module named '_LowLevel'
Could it be a problem that python3 cannot use swig?
Python2 is installed at a different location (/usr/lib/python2.7)
I used Homebrew to install python.
Any ideas appreciated.
Thanks in advance!
you need to come out from PyKCS11 directory and for more info check the below link
https://github.com/LudovicRousseau/PyKCS11/issues/70