简体   繁体   English

导入错误:没有名为“Cython”的模块

[英]ImportError: No module named 'Cython'

I'm trying do from Cython.Build import cythonize and I get the message ImportError: No module named 'Cython' , but I instaled the Cython with the comand pip install Cython .我正在尝试from Cython.Build import cythonize并收到消息ImportError: No module named 'Cython' ,但我使用命令pip install Cython What's wrong?怎么了?

Python 3.5 Cython 0.25.2 Windows 8 Python 3.5 Cython 0.25.2 Windows 8

just directly install from pypi: pip install Cython直接从pypi pip install Cythonpip install Cython
https://pypi.org/project/Cython/ https://pypi.org/project/Cython/

使用 Pip3 命令:

pip3 install --upgrade cython

我用 conda 重新安装了 Cython 并安装了 Microsoft Visual C++ Build Tools,它工作正常。

您可以从以下网址下载最新的版本用Cython http://cython.org/或者您可以通过点击这个链接直接下载这里解压压缩包或zip文件,进入该目录,然后运行:

python setup.py install

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 .我只是使用python -m pip install Cython ,然后继续使用python -m pip install -r requirements.txt我需要的所有其他东西。 Once it was done, it actually uninstalled Cython for me... Why?完成后,它实际上为我卸载了 Cython ......为什么? Heck do I know... I ain't that kind of expert :<哎呀,我知道吗……我不是那种专家:<

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转到 Windows 搜索 python idle 右键单击​​ idle - 打开文件位置,右键单击 python.exe - 如果模块不在该位置,则打开文件位置键入 cmd 并在路径中按 Enter 现在使用 pip install cython 安装模块它会正常工作

The problem for me was the pip version.我的问题是pip版本。 Running python -m pip install pip --upgrade solved the issue.运行python -m pip install pip --upgrade解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM