gpt4 book ai didi

python - 无法安装 pyOpenSSL

转载 作者:可可西里 更新时间:2023-11-01 10:33:39 25 4
gpt4 key购买 nike

我在 Macbook Pro 上双启动了一个 Windows 10 分区:Mac:El Capitan(64 位)Windows:Windows 10 64 位,使用 fat 文件系统格式化

在 Windows 上,我安装了 cygwin 和 Python 2.7。通过 cygwin,我安装了 pip 和 gcc。

我还尝试使用 http://www.lfd.uci.edu/~gohlke/pythonlibs/#cffi 安装 cffi ,但是当我运行 pip install 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/

最佳答案

我遇到了类似的问题并安装了 libssl 头文件以便我可以编译 python 模块:

sudo apt-get install libssl-dev

关于python - 无法安装 pyOpenSSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39525704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com