I've spent the day trying to get the h5py module of python working, but without success. I've installed HDF5 shared libraries, followed the instructions I could find on the web to get it right. But it doesn't work, below is the error message I get when trying to import the module into python. I tried installing through MacPorts too but again it wouldnt work.
I'm using Python27 32 bits (had too for another module, and thus installed the i386 HDF5 library... if that's right?)
Any help very welcome !
Thank you !
import h5py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/__init__.py", line 1, in <module>
from h5py import _errors
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so, 2): Symbol not found: _H5E_ALREADYEXISTS_g
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/h5py/_errors.so
Check that you are not inside the h5py installation directory.
My advice, if you can, install h5py using Anaconda Distribution Open Data Science Core.
Related
I am trying to get QCustomPlot2 working on Ppython 3.7 Anaconda installation Windows 10 x64
I tried installing via pip and easy_install from building qcustomplot2 via qt cmd and moved the .pyd file into several locations. I updated pyqt from conda which then broke the install. However even when qcustomplot2 was installed, and not giving the dll error I was getting the stack buffer overflow error when calling it from the example.
I am using the PyCharm IDE
Well, not really an answer but a workaround:
I use PyQt5 instead of PySide2 and you have to import it prior to QCustomPlot2
Doesn't work:
>>> import QCustomPlot2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing QCustomPlot2
Works:
>>> import PyQt5
>>> import QCustomPlot2
This is an error that I've seen in several different places but none of the listed solutions have worked for me.
I'm trying to use opencv but when I import the module I get the following error:
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
I have tried installing opencv from a pre-downloaded package, my computer has the current windows media pack and I jave run the module the depends without it listing any dependecy errors, I'm not sure what else to try at this point.
Edit: I have also tried installing opencv-contrib-python to no avail.
Let me know if you have any suggestions.
I had faced a similar issue and I solved it using:
pip install opencv-contrib-python
I updated from python 3.7.3 to python 3.7.6 and it fixed the problem. Worth a shot if you have the same issue.
I want to zip some sources in order to use it easily from multiple locations. I have to install some external modules, let us say pyyaml and numpy.
First, I install these packages in a specific location:
python -m pip install --target=lib pyyaml numpy
And then I create the zipped library:
python -m zipapp library --output=my_library.pyd --compress
In another interpreter, after adding "my_library.pyd" to the sys.path, I can load the yaml module, but not the numpy one:
>>> import sys
>>> from pathlib import Path
>>> sys.path.append(str(Path().absolute() / 'my_library.pyd'))
>>> import yaml
>>> import numpy
Traceback (most recent call last):
File "D:\Documents\rdpy\packaging_tests\my_library.pyd\numpy\core\__init__.py", line 40, in <module>
File "D:\Documents\rdpy\packaging_tests\my_library.pyd\numpy\core\multiarray.py", line 12, in <module>
File "D:\Documents\rdpy\packaging_tests\my_library.pyd\numpy\core\overrides.py", line 6, in <module>
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Documents\rdpy\packaging_tests\my_library.pyd\numpy\__init__.py", line 142, in <module>
File "D:\Documents\rdpy\packaging_tests\my_library.pyd\numpy\core\__init__.py", line 71, in <module>
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using D:\Apps\python-3.7\python.exe),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: No module named 'numpy.core._multiarray_umath'
In the zip archive, I do have a file named numpy\core\_multiarray_umath.cp37-win_amd64.pyd, but it obviously is a C compiled file.
Is there anything I can do to be able and import numpy when creating the zip archive?
I believe this is a problem with zipapp on import some .c compiled files. To solve this I used the install creator. It was what I want, create a .exe from python code.
I am working on an image compression module, for that I want use jpeg library, but when I am importing it I am getting the following error.
"" import jpeg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named jpeg
this was happening after i installed the libjpeg library also, I want use jpeg in python image compression, so can any tell me resolve the problem , how to install jpeg in ubuntu
and help me solve the error .
I believe it's recommended to use the Python Imaging Library as the jpeg module is deprecated since python 3.0. So the module you need to import:
import Image
If you still get an import error then try:
sudo apt-get install python-imaging
Documentation can be found here: http://effbot.org/imagingbook/introduction.htm
and there are some jpeg examples on that page.
I believe the problem is that you're trying to use the jpeg module in an unsupported platform. According to the documentation it's only supported in IRIX, so if you try to import it in a different platform, then you'll get the ImportError exception.
I've recently installed django and psycop2. However python is refusing to use it below is the error. Can someone please help?
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/__init__.py", line 67, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so
macports is terrible for python/django development, everything seems to be out of data.
I have my team doing the following for postgres:
Download and install postgresql 9.0 but read the README before
installing !!!
Download psycopg2 source from http://initd.org/pub/software/psycopg/
Edit the setup.cfg to set pg_config to
/Library/PostgreSQL/9.0/bin/pg_config
Then install with
python setup.py install
I'd recommend using virtualenv as well, you want to stay away from the base Mac OS X python install as much as possible.