2017-01-15 3 views
0

я установил Cython 0.24.1 на моей Raspberry Pi, делая это:Python старая версия Cython даже если новая версия установлена ​​

Pasted ниже команды и терминальный вывод.

[email protected]:~ $ sudo pip3 install --upgrade cython==0.24.1 
Downloading/unpacking cython==0.24.1 
    Downloading Cython-0.24.1.tar.gz (1.7MB): 1.7MB downloaded 
    Running setup.py (path:/tmp/pip-build-hprgsgiw/cython/setup.py) egg_info for package cython 
    Unable to find pgen, not compiling formal grammar. 

    warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests' 
    warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests' 
    warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests' 
    warning: no files found matching '*.pxd' under directory 'Cython/Utility' 
Installing collected packages: cython 
    Running setup.py install for cython 
    Unable to find pgen, not compiling formal grammar. 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.py to /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.c 
    building 'Cython.Plex.Scanners' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Scanners.o -o build/lib.linux-armv7l-3.4/Cython/Plex/Scanners.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.py to /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.c 
    building 'Cython.Plex.Actions' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Plex/Actions.o -o build/lib.linux-armv7l-3.4/Cython/Plex/Actions.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.c 
    building 'Cython.Compiler.Lexicon' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Lexicon.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Lexicon.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.c 
    building 'Cython.Compiler.Scanning' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Scanning.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Scanning.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.c 
    building 'Cython.Compiler.Parsing' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Parsing.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Parsing.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.c 
    building 'Cython.Compiler.Visitor' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Visitor.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Visitor.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.c 
    building 'Cython.Compiler.FlowControl' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/FlowControl.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/FlowControl.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.py to /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.c 
    building 'Cython.Compiler.Code' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Compiler/Code.o -o build/lib.linux-armv7l-3.4/Cython/Compiler/Code.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.pyx to /tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.c 
    building 'Cython.Runtime.refnanny' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Runtime/refnanny.o -o build/lib.linux-armv7l-3.4/Cython/Runtime/refnanny.cpython-34m.so 
    cythoning /tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.py to /tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.c 
    building 'Cython.Tempita._tempita' extension 
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c /tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.c -o build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.o 
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.4/tmp/pip-build-hprgsgiw/cython/Cython/Tempita/_tempita.o -o build/lib.linux-armv7l-3.4/Cython/Tempita/_tempita.cpython-34m.so 

    warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests' 
    warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests' 
    warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests' 
    warning: no files found matching '*.pxd' under directory 'Cython/Utility' 
    Installing cygdb script to /usr/local/bin 
    Installing cython script to /usr/local/bin 
    Installing cythonize script to /usr/local/bin 
Successfully installed cython 
Cleaning up... 

Похоже, что установка завершена отлично. Но после этого, если я сделаю следующее, он все равно вернет старую версию. Что мне не хватает?

[email protected]:~ $ python3 -c "import cython;print(cython.__version__)" 
0.21.1 
+0

Что такое 'python3 -c 'import cython; print (cython .__ file __)" 'return? – MattDMo

+0

'pi @ raspberrypi: ~ $ python3 -c" import cython; print (cython .__ file__) " /usr/local/lib/python3.4/dist-packages/cython.py' –

ответ

0

Из журнала я могу читать Installing cython script to /usr/local/bin. Я экстраполирую, что библиотека установила в /usr/local/python3something. Две альтернативы:

  1. повторно установить с помощью pip3 install --user --upgrade cython==0.24.1 и убедитесь, что ~/.local/bin в вашем PATH environment variable.
  2. добавьте /usr/local/bin к вашим PATH environment variable и /usr/local/python3something/site-packages к переменной LD_LIBRARY_PATH.

Действительно, часть python3something должна быть изменена, чтобы отражать точный путь в вашей системе. Вариант «1» выше должен работать, даже если моя экстраполяция неверна.

Смежные вопросы