trezor / python-trezor

:snake: Don't use this repo, use the new monorepo instead:
https://github.com/trezor/trezor-firmware
GNU Lesser General Public License v3.0
200 stars 193 forks source link

setup fails with "No module named Cython.Distutils" #40

Closed JulianTosh closed 9 years ago

JulianTosh commented 9 years ago

Attempting to install on Fedora 21.

Exact error:

ImportError: No module named Cython.Distutils
JulianTosh commented 9 years ago

using

pip install cython

to attempt to install cython, but now that command fails with

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c /tmp/pip-build-IcaCXz/cython/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-2.7/tmp/pip-build-IcaCXz/cython/Cython/Plex/Scanners.o

/tmp/pip-build-IcaCXz/cython/Cython/Plex/Scanners.c:8:22: fatal error: pyconfig.h: No such file or directory

 #include "pyconfig.h"

                      ^

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-IcaCXz/cython/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ewvpw1-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-IcaCXz/cython
Storing debug log for failure in /root/.pip/pip.log
JulianTosh commented 9 years ago

Using

yum install python-devel

resolves this secondary issue and allows the

pip install cython

command to work.

python setup.py install

now results in

fatal error: libusb.h: No such file or directory
JulianTosh commented 9 years ago

Running

yum install libusbx-devel

resolves this 3rd issue. Now I get this error:

/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'gcc' failed with exit status 1
JulianTosh commented 9 years ago
yum install systemd-devel

resolves this latest snafu.

And with this ladies and gentlement, the install is complete. Issue resolved. Thank you googles!

JulianTosh commented 9 years ago

Summary of fix:

yum install python-devel libusbx-devel systemd-devel
pip install cython
python setup.py install
PopoTheSapien commented 8 years ago

:) thanks for this, helped me 👍

ghost commented 8 years ago

For what it's worth, you should not be using setup.py directly nowadays, you should use pip install . or pip install git+https://github.com/trezor/python-trezor.git

silencesmile commented 6 years ago

I have already installed Cython,but when carried out ‘make’,Wrong as follows: PopdeMacBook-Pro:lib Young$ make python setup.py build_ext --inplace Traceback (most recent call last): File "setup.py", line 13, in from Cython.Distutils import build_ext ImportError: No module named Cython.Distutils make: *** [all] Error 1