ImportError: No module named Cython.Distutils

前端 未结 12 694
广开言路
广开言路 2020-12-13 13:01

I\'m having a strange problem while trying to install the Python library zenlib, using its setup.py file. When I run the setup.py file

相关标签:
12条回答
  • 2020-12-13 13:02

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

    pip uninstall cython && pip install cython
    
    0 讨论(0)
  • 2020-12-13 13:08

    For python3 use

    sudo apt-get install cython3
    

    For python2 use

    sudo apt-get install cython
    

    Details can be read at this

    0 讨论(0)
  • 2020-12-13 13:09

    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
    
    0 讨论(0)
  • 2020-12-13 13:09

    Install Cython:

    pip install cython
    
    0 讨论(0)
  • 2020-12-13 13:11

    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

    0 讨论(0)
  • 2020-12-13 13:15

    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.

    0 讨论(0)
提交回复
热议问题