2016-09-16 36 views
2

我雙啓動在MacBook Pro上一個Windows 10分區: 的Mac:埃爾卡皮坦(64位) 視窗:視窗10 64位,與FAT文件系統無法安裝pyOpenSSL

在Windows格式化,我安裝了cygwin和Python 2.7。通過cygwin,我安裝了pip和gcc。

我也嘗試安裝cffi與http://www.lfd.uci.edu/~gohlke/pythonlibs/#cffi,但是當我運行pip安裝cffi-1.8.2-cp27-cp27m-win_amd64.whl時,我得到了錯誤:cffi....whl is not supported on this platform。然後我嘗試了很多我不記得的東西,我想我甚至嘗試下載一個tar文件,然後現在,當我運行pip install cffi時,我被告知它已經安裝。

我然後跑pip install pyOpenSSL,但是,我得到這個錯誤:

gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/python2.7 -c build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c -o build/temp.cygwin-2.6.0-x86_64-2.7/build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.o 
    build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c:433:30: fatal error: openssl/opensslv.h: No such file or directory 
    compilation terminated. 
    error: command 'gcc' failed with exit status 1 

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9Emw8c/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-wy64bj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9Emw8c/cryptography/ 

當我做pip install cryptography我也得到了這個錯誤。

我讀的地方,我應該嘗試:pip install --global-option build_ext --global-option --compiler=mingw64 pyopenssl,和我:

Skipping bdist_wheel for pyopenssl, due to binaries being disabled for it. 
Skipping bdist_wheel for cryptography, due to binaries being disabled for it. 
Installing collected packages: cryptography, pyopenssl 
    Running setup.py install for cryptography ... error 
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fIb1xc/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --compiler=mingw64 install --record /tmp/pip-7flSlN-record/install-record.txt --single-version-externally-managed --compile: 
    running build_ext 
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_padding.c' 
    creating build 
    creating build/temp.cygwin-2.6.0-x86_64-2.7 
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_constant_time.c' 
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c' 
    error: don't know how to compile C/C++ code on platform 'posix' with 'mingw64' compiler 

    ---------------------------------------- 
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fIb1xc/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --compiler=mingw64 install --record /tmp/pip-7flSlN-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-fIb1xc/cryptography/ 

可有人請告知有什麼錯?

更新:通過cygwin的安裝mingw64x86_64-openssl: OpenSSL encryption library for Win64 toolchain,並運行pip install pyopenssl後,我得到了:

running build_ext 
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_padding.c' 
    creating build/temp.cygwin-2.6.0-x86_64-2.7 
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_constant_time.c' 
    generating cffi module 'build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c' 
    building '_openssl' extension 
    creating build/temp.cygwin-2.6.0-x86_64-2.7/build 
    creating build/temp.cygwin-2.6.0-x86_64-2.7/build/temp.cygwin-2.6.0-x86_64-2.7 
    /usr/bin/clang -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/python2.7 -c build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c -o build/temp.cygwin-2.6.0-x86_64-2.7/build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.o 
    build/temp.cygwin-2.6.0-x86_64-2.7/_openssl.c:433:10: fatal error: 'openssl/opensslv.h' file not found 
    #include <openssl/opensslv.h> 
      ^
    1 error generated. 
    error: command '/usr/bin/clang' failed with exit status 1 

    ---------------------------------------- 
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZsWN3h/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-D2XH0P-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ZsWN3h/cryptography/ 
+0

您是否安裝了_OpenSSL_(因爲_pyOpenSSL_只是它的一個_Python_包裝)? – CristiFati

+0

是的,我有。它位於\ cydrive \ c \ OpenSSL-win64。我從源代碼安裝:https://www.openssl.org/source/ – user3918985

+0

這條路徑好像你已經爲_Win_安裝_OpenSSL_,最喜歡你必須安裝(或者建立如果不可用)_Cygwin_版本。作爲快速測試運行'/ cydrive/c/OpenSSL-win64/bin/openssl version -a'並查看它輸出的內容(if)。 – CristiFati

回答

1

我也有類似的問題,安裝的libssl頭文件,所以我可以編譯Python模塊:

sudo apt-get install libssl-dev