gpt4 book ai didi

python - Ubuntu Server 16 无法安装(降级)到 PyOpenSSL 0.13

转载 作者:行者123 更新时间:2023-11-28 19:11:44 24 4
gpt4 key购买 nike

运行 mark2 来监督我的 Minecraft 服务器和我升级到 Ubuntu 16 LTS 似乎遇到了一些问题,我无法弄清楚如何修复它。只要说 mark2 似乎需要 PyOpenSSL 0.13 就够了,而且升级似乎迫使 python 将其自己的 PyOpenSSL dist-package 升级到 0.15.1

使用mark2 start时给出的错误是:

Traceback (most recent call last):
File "/usr/local/bin/mark2", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyOpenSSL==0.13' distribution was not found and is required by mark2

尝试使用 pip 来 pip install pyopenssl==0.13 会产生这种可怕的结果:

Collecting pyopenssl==0.13
Using cached pyOpenSSL-0.13.tar.gz
Building wheels for collected packages: pyopenssl
Running setup.py bdist_wheel for pyopenssl ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Dt9RiD/pyopenssl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpsbnZGjpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/OpenSSL
copying OpenSSL/__init__.py -> build/lib.linux-x86_64-2.7/OpenSSL
copying OpenSSL/tsafe.py -> build/lib.linux-x86_64-2.7/OpenSSL
copying OpenSSL/version.py -> build/lib.linux-x86_64-2.7/OpenSSL
creating build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/__init__.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/util.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/test_crypto.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/test_rand.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/test_ssl.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
running build_ext
building 'OpenSSL.crypto' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/OpenSSL
creating build/temp.linux-x86_64-2.7/OpenSSL/crypto
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/crypto.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/crypto.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509name.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509name.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkey.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/pkey.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509store.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509store.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509req.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509req.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509ext.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509ext.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkcs7.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/pkcs7.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkcs12.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/pkcs12.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/netscape_spki.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/netscape_spki.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/revoked.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/revoked.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/crl.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/crl.o
OpenSSL/crypto/crl.c:6:23: error: static declaration of ‘X509_REVOKED_dup’ follows non-static declaration
static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig) {
^
In file included from /usr/include/openssl/ssl.h:156:0,
from OpenSSL/crypto/x509.h:17,
from OpenSSL/crypto/crypto.h:30,
from OpenSSL/crypto/crl.c:3:
/usr/include/openssl/x509.h:751:15: note: previous declaration of ‘X509_REVOKED_dup’ was here
X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for pyopenssl
Running setup.py clean for pyopenssl
Failed to build pyopenssl
Installing collected packages: pyopenssl
Running setup.py install for pyopenssl ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Dt9RiD/pyopenssl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mnXvzL-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/OpenSSL
copying OpenSSL/__init__.py -> build/lib.linux-x86_64-2.7/OpenSSL
copying OpenSSL/tsafe.py -> build/lib.linux-x86_64-2.7/OpenSSL
copying OpenSSL/version.py -> build/lib.linux-x86_64-2.7/OpenSSL
creating build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/__init__.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/util.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/test_crypto.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/test_rand.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
copying OpenSSL/test/test_ssl.py -> build/lib.linux-x86_64-2.7/OpenSSL/test
running build_ext
building 'OpenSSL.crypto' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/OpenSSL
creating build/temp.linux-x86_64-2.7/OpenSSL/crypto
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/crypto.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/crypto.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509name.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509name.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkey.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/pkey.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509store.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509store.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509req.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509req.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/x509ext.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/x509ext.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkcs7.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/pkcs7.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/pkcs12.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/pkcs12.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/netscape_spki.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/netscape_spki.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/revoked.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/revoked.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c OpenSSL/crypto/crl.c -o build/temp.linux-x86_64-2.7/OpenSSL/crypto/crl.o
OpenSSL/crypto/crl.c:6:23: error: static declaration of ‘X509_REVOKED_dup’ follows non-static declaration
static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig) {
^
In file included from /usr/include/openssl/ssl.h:156:0,
from OpenSSL/crypto/x509.h:17,
from OpenSSL/crypto/crypto.h:30,
from OpenSSL/crypto/crl.c:3:
/usr/include/openssl/x509.h:751:15: note: previous declaration of ‘X509_REVOKED_dup’ was here
X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Dt9RiD/pyopenssl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mnXvzL-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-Dt9RiD/pyopenssl/
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

所以在这一点上我不知所措,因为我不确定从这里去哪里。升级 pip 也失败并停留在 8.1.1,但我不相信这真的是我的问题。有什么想法吗?

最佳答案

以下补丁对我来说工作正常(pyOpenSSL==0.12/0.13)

pip download pyOpenSSL==0.13
tar xzf pyOpenSSL-0.13.tar.gz
cd pyOpenSSL-0.13

wget https://gist.githubusercontent.com/brycepg/809501ae24e34e9fdb58a7932c12287b/raw/74e0165e73dadab8051a9041bcb8e657705a706b/fix.patch

patch OpenSSL/crypto/crl.c fix.patch
pip install --no-clean .

您可以在 https://github.com/pyca/pyopenssl/issues/276 看到更多信息

关于python - Ubuntu Server 16 无法安装(降级)到 PyOpenSSL 0.13,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39208269/

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