gpt4 book ai didi

python-2.7 - SSL(缩进错误)使用 virtualenvwrapper (_lib.SSL_ST_INIT)

转载 作者:太空宇宙 更新时间:2023-11-03 14:27:57 28 4
gpt4 key购买 nike

然后我想将 --system-site-packages 参数与 virtualenvwrapper 一起使用。但是我有一个 SSL 错误:

$ mkvirtualenv --system-site-packages --python=`which python` my_env
Already using interpreter /usr/bin/python
New python executable in /home/vagrant/.virtualenvs/my_env/bin/python
Command /home/vagrant/.virtualenvs/my_env/bin/python -m pip config list had error code 1
Traceback (most recent call last):
File "/home/vagrant/.local/bin/virtualenv", line 10, in <module>
sys.exit(main())
File "/home/vagrant/.local/lib/python2.7/site-packages/virtualenv.py", line 793, in main
symlink=options.symlink,
File "/home/vagrant/.local/lib/python2.7/site-packages/virtualenv.py", line 1088, in create_environment
install_wheel(to_install, py_executable, search_dirs, download=download)
File "/home/vagrant/.local/lib/python2.7/site-packages/virtualenv.py", line 935, in install_wheel
_install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
File "/home/vagrant/.local/lib/python2.7/site-packages/virtualenv.py", line 964, in _install_wheel_with_search_dir
config = _pip_config(py_executable, python_path)
File "/home/vagrant/.local/lib/python2.7/site-packages/virtualenv.py", line 1043, in _pip_config
config[key] = ast.literal_eval(value)
File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python2.7/ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
_lib.SSL_ST_INIT
^
IndentationError: unexpected indent

python :2.7.9

我的 SSL 配置:

$ dpkg -l | grep ssl
ii libgnutls-openssl27:amd64 3.3.30-0+deb8u1 amd64 GNU TLS library - OpenSSL wrapper
ii libio-socket-ssl-perl 2.002-2+deb8u3 all Perl module implementing object oriented interface to SSL sockets
ii libnet-smtp-ssl-perl 1.01-3 all Perl module providing SSL support to Net::SMTP
ii libnet-ssleay-perl 1.65-1+deb8u1 amd64 Perl module for Secure Sockets Layer (SSL)
ii libssl-doc 1.0.1t-1+deb8u11 all Secure Sockets Layer toolkit - development documentation
ii libssl1.0.0:amd64 1.0.1t-1+deb8u11 amd64 Secure Sockets Layer toolkit - shared libraries
ii openssl 1.0.1t-1+deb8u11 amd64 Secure Sockets Layer toolkit - cryptographic utility
ii python-openssl 0.14-1 all Python 2 wrapper around the OpenSSL library
ii ssl-cert 1.0.35 all simple debconf wrapper for OpenSSL

我在动态库中有一个 .so 文件。这里:/usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so

最佳答案

我刚刚将 .so 文件复制到 virtualenv 文件夹:

cp /usr/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so /home/vagrant/.virtualenvs/my_env/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so

关于python-2.7 - SSL(缩进错误)使用 virtualenvwrapper (_lib.SSL_ST_INIT),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55262883/

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