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

问题描述 投票:3回答:1

运行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,虽然我不相信这是我的问题。有任何想法吗?

python ubuntu pyopenssl
1个回答
0
投票

以下补丁对我来说很好(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看到更多这个

© www.soinside.com 2019 - 2024. All rights reserved.