Reputation: 1119
I'm trying do from Cython.Build import cythonize
and I get the message ImportError: No module named 'Cython'
, but I installed the Cython with the comand pip install Cython
. What's wrong?
Python 3.5 Cython 0.25.2 Windows 8
Upvotes: 88
Views: 227678
Reputation: 375
In my case I was trying to run pip install -r requirements.txt
And getting the error: ImportError: No module named 'Cython'
.
But when checking python3 -c "import Cython; print(Cython.__version__)"
it returned 3.0.11
(which tells me it exists).
What helped was to downgrade to python3.8
instead of originally using python3.11
Hope it helps!
Upvotes: 0
Reputation: 1626
Cython has been already installed, but somehow invisible, for python3.10 only works update
pip install wheel --upgrade
Upvotes: 10
Reputation: 83
I was getting this same issue/error message when trying
pip install .
for a package. Then I tried running
python setup.py build_ext --inplace
python setup.py install
in the same environment (cython was already installed and up to date there) and it worked perfectly.
Upvotes: 4
Reputation: 998
Just directly install from pypi:
pip install Cython
https://pypi.org/project/Cython/
Upvotes: 85
Reputation: 334
I personally ran into this problem when I was trying to set up a new virtual environment. I simply installed Cython with python -m pip install Cython
and then proceeded to install all the rest of my stuff I needed with python -m pip install -r requirements.txt
.
Once it was done, it actually uninstalled Cython for me...
Why? Heck do I know... I ain't that kind of expert :<
Upvotes: 4
Reputation: 1937
The problem for me was the pip
version. Running python -m pip install pip --upgrade
solved the issue.
Upvotes: 12
Reputation: 11
it should be path problem. go to windows search for python idle right click idle - open file location where right click on python.exe - open file location if the module not in that location type cmd and press enter in path now install module with pip install cython it will work fine
Upvotes: 1
Reputation: 146
You can download the the newest Cython release from http://cython.org/ or you can directly download by clicking this link here Unpack the tarball or zip file, enter the directory, and then run:
python setup.py install
Upvotes: 6
Reputation: 1119
I reinstalled the Cython with conda and install the Microsoft Visual C++ Build Tools and it works fine.
Upvotes: 9