ImportError: No module named Cython.Distutils

前端 未结 12 695
广开言路
广开言路 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:18

    I had dependency from third party library on Cython, didn't manage to build the project on Travis due to the ImportError. In case someone needs it - before installing requirements.txt run this command:

    pip install Cython --install-option="--no-cython-compile"

    Installing GCC also might help.

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

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

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

    That is easy.

    You could try install cython package first.

    It will upgrade your easy_install built in python.

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

    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

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

    Read like a thousand of these threads and finally got it for Python 3. (replace pip with pip3 if you have that kind of installation, and run pip uninstall cython if you have tried other solutions before running any of these)

    Mac:

    brew install cython
    pip install --upgrade cython
    

    Ubuntu

    sudo apt-get install cython3 python-dev  
    pip install --upgrade cython
    

    Windows (must have conda, and MinGW already in path)

    conda install cython
    conda install --upgrade cython
    
    0 讨论(0)
  • 2020-12-13 13:26

    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.

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