ImportError: No module named Cython.Distutils

安稳与你 提交于 2019-11-28 18:07:00
tiago

Your sudo is not getting the right python. This is a known behaviour of sudo in Ubuntu. See this question for more info. You need to make sure that sudo calls the right python, either by using the full path:

sudo /usr/local/epd/bin/python setup.py install

or by doing the following (in bash):

alias sudo='sudo env PATH=$PATH'
sudo python setup.py install

Install Cython:

pip install cython

Run

which python

Thats the path to the python that your system has defaulted too then go to @tiago's method of:

sudo <output of which python> setup.py install

Tạ Lục Gia Hoàng

For python3 use

sudo apt-get install cython3

For python2 use

sudo apt-get install cython

Details can be read at this

I only got one advice for you : Create a virtualenv. This will ensure you have only one version of python and all your packages installed locally (and not on your entire system).
Should be one of the solutions.

In the CLI-python, import sys and look what's inside sys.path
Then try to use export PYTHONPATH=whatyougot

Running the following commands resolved the issue for me in ubuntu 14.04:

sudo apt-get install python-dev    
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libsystemd-daemon-dev
sudo pip install cython

This link helped me: https://github.com/trezor/python-trezor/issues/40

Ran into this again in modern times. The solution was simple:

pip uninstall cython && pip install cython
ian

That is easy.

You could try install cython package first.

It will upgrade your easy_install built in python.

user2295896

Just install Cython from http://cython.org/#download and install it using this command

sudo python setup.py install

Then run the command

sudo python -c 'import Cython.Distutils'

and it will be installed and the error message will disappear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!