Closed danielhrisca closed 5 years ago
Try with a Python installation or virtualenv that does not have cython already installed
cython is normally a requirement for mdfreader but you want to propose it as an optionnal requirement ?
Actually the problem is if you need cython during the installation, and cython is not already installed, you will get the error even though cython is included in the _installrequires
This probably helps: http://cython.readthedocs.io/en/latest/src/reference/compilation.html?highlight=compilation#distributing-cython-modules
Thanks Daniel for the tip. I think on linux, there is no issue installing cython and have correct compilation environment. But on windows, most difficult is probably to have suitable compilation environment rather than installing cython. Do you experiment and want to include it in asammdf for performance up ?
I modified setup.py to avoid error when cython is not installed, in last commit, thanks.
It's a real pain in the ass to get the compilation working in Windows, this is why I normally rely on WinPython and https://www.lfd.uci.edu/~gohlke/pythonlibs/ , and I will just use numpy without custom cython or C extensions for asammdf.
Like I said the cython issue came when I had to use a stripped down Pyhon installation that did not have cython installed (WinPyhton 3.7.0 in this particular case)
Doing the same for windows but using anaconda. For big files (several Gb), I think cython is worth the pain for mdfreader. Should be ok now, closing but reopen if you face again this issue.
@ratal I second the issue raised by @danielhrisca: the way you import numpy
, Cython
etc. at the top of your setup.py
file is for lack of a better expression just plain wrong. These imports at the top of your setup.py
break the usual way Python packages are installed - requirements of your package should be listed somewhere in your setup.py
so that they're installed but you shouldn't import them in your setup.py
the way you're doing it right now.
See the setup.py
file of e.g. pandas
which also relies heavily on numpy
:
Thanks, I remove all import in header and made sure it woudl install without cython, in dev branch
daniel@daniel-VirtualBox:~$ pip3 install cython
Collecting cython
Downloading https://files.pythonhosted.org/packages/19/eb/c4d9f3beafd5ac0615936860bcee41d93ca58f8734a16715da0037d2c468/Cython-0.28.2-cp36-cp36m-manylinux1_x86_64.whl (3.4MB)
100% |████████████████████████████████| 3.4MB 398kB/s
Installing collected packages: cython
Successfully installed cython-0.28.2
daniel@daniel-VirtualBox:~$ pip3 install https://github.com/ratal/mdfreader/archive/dev.zip
Collecting https://github.com/ratal/mdfreader/archive/dev.zip
Downloading https://github.com/ratal/mdfreader/archive/dev.zip
/ 450kB 706kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 346, in get_provider
module = sys.modules[moduleOrReq]
KeyError: 'numpy'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-zkevh2nd-build/setup.py", line 9, in <module>
numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1136, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 348, in get_provider
__import__(moduleOrReq)
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-zkevh2nd-build/
I have tried to install and still have this problem. any solution?
Hi Daniel, I guess you have this error because there is no numpy installed in your virtual environment, completly virgin except Cython ? I looked a bit and coud not find any other way than just informing user he should install numpy. Normally pip should handle this depency but with this code, it is not possible I think; I need those include_dirs and if numpy is not installed I do not know how to request numpy install.
Hi Gourab, I guess your issue is the one described at the beginning of this thread. Did you try installing the git dev branch ?
Hello Aymeric,
this happened on a fresh Ubuntu install. There must be a way to make this work, maybe you should have a deeper look at some other projects.
@cristi-neagu https://github.com/ratal/mdfreader/blob/dev/setup.py#L76
I see it's already in here. Thanks
@ratal yeah . but getting this error error: Setup script exited with error: Unable to find vcvarsall.bat
Hi, I think this is different issue (here about how to install mdfreader without cython installed) You are trying to build dataRead cython (you probably installed) module but you are missing Microsoft Visual C++ Compiler for you installed Python version. Up to you, either install with (need proper compilation environment) or without cython (pure python)