(py36venv)vagrant @ pvagrant-dev-vm:/ vagrant/venvs $ pip3 install pep8
pip配置了需要TLS/SSL的位置,但Python中的ssl模块不可用.
收集pep8无法获取URL https://pypi.python.org/simple/pep8/:确认ssl证书时出现问题:无法连接到HTTPS URL,因为SSL模块不可用. - 跳过
找不到满足要求pep8的版本(来自版本:)没有为pep8找到匹配的发行版
背景信息 - 试图转向python 3.6.
使用以下命令安装python3.6:
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar -xvf Python-3.6.0.tgz
cd Python-3.6.0
./configure --enable-optimizations
make -j8 sudo make altinstall python3.6
通过以下方式创建virtualenv:
python3.6 -m venv py36venv
源py36venv/bin/activate
试图安装pep8
(py36venv)pip3安装pep8
pip配置了需要TLS/SSL的位置,但Python中的ssl模块不可用.收集pep8
无法获取URL https://pypi.python.org/simple/pep8/:确认ssl证书时出现问题:无法连接到HTTPS URL,因为
SSL模块不可用. - 跳过找不到满足要求的版本pep8(来自版本:)没有为pep8找到匹配的发行版
我正在尝试在 RHEL 上编译 python,因为我当前的 python 使用的是旧的 1.0.2k ssl 版本。
\n(test_env) [brad@reason tlscheck]$ python3 --version\nPython 3.9.3\n(test_env) [brad@reason tlscheck]$ python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"\nOpenSSL 1.0.2k-fips 26 Jan 2017\n(test_env) [brad@reason tlscheck]$ openssl version\nOpenSSL 1.1.1l 24 Aug 2021\nRun Code Online (Sandbox Code Playgroud)\n我认为问题是当我编译 3.9.3 时,我没有更新我的 OpenSSL 版本。我已经更新了我的 OpenSSL 并需要将它与 python 一起使用。所以我下载了最新的python 3.10,但在make阶段我收到一个错误,它不会用ssl制作。我的消息如下:
\nFollowing modules built successfully but were removed because they could not be imported:\n_hashlib _ssl \n\n\nCould not build the ssl module!\nPython requires a OpenSSL 1.1.1 or newer\nRun Code Online (Sandbox Code Playgroud)\n这是尝试编译的完整日志:\n https://pastebin.com/36EntpFz
\n当我使用 @tony-yip 提到的配置选项时,我在配置中得到以下内容。 …
我正在使用远程服务器.当我尝试在我的虚拟环境中使用pip安装任何东西时,我收到一个错误:
(venv) [barta@bivoj program]$ pip install -r requirements.txt
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting joblib==0.11 (from -r requirements.txt (line 1))
Could not fetch URL https://pypi.python.org/simple/joblib/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Run Code Online (Sandbox Code Playgroud)
使用python 2.7一切正常.我可以自己解决这个问题(我没有root权限)或者我是否需要联系管理员?
首先,当我在我的主文件夹中安装python 3.6时,我遇到了这个问题.我想问题可能是因为它在我的主文件夹中,所以我要求干净安装python 3.6.
我考虑更改setup.py并再次安装在我的家中,正如Claudio所建议的那样:
由于ssl模块不可用,pip3安装在虚拟环境中,python3.6失败
但我没有找到任何openssl文件夹./ usr/bin中有openssl,但这不是目录.我搜索了ssl.h文件,但没有在任何地方找到它.
我正在运行centos 6.10的专用服务器上安装Python 3.7.在跳过一些箍尝试这样做之后,我又遇到了另一个错误.使用Python 3.7尝试并保持最新,使用pip安装遇到SSL问题是一个相当常见的问题.我得出结论,解决这个问题的最好方法是获得正确版本的OpenSSL.所以我这样做了,并编辑了我的python模块/ Setup.dist文件,重新配置它,重新制作altinstall,而一切似乎都很好.出于某种原因,Python3.7之前用于运行此python的命令的命令突然变得无法识别为命令,而在Python3.7目录中python现在是一个文件夹,在执行时(在编辑环境路径后打开Python3). 7.事先并非如此,只是Python3.7 有人知道这里会发生什么吗?
此外,我对这整个SSL问题的最终结论,我已经阅读了太阳下的每一篇文章.以下列出了我最近执行的一些命令:
#Unpacked Python3.7 into /usr/src directory
./configure --enable-optimizations --enable-loadable-sqlite-extensions
make altinstall
#installation failed from no '_ctypes' module
yum install libffi-devel
#repeat configure above
#yaaay python
#Successfully installed pip-10.0.1 setuptools-39.0.1 was the final message of the installation
Python3.7 -m venv /my/project/directory/ENV
pip install {library}
#this is where my issues began with SSL
Run Code Online (Sandbox Code Playgroud)
日志:
(ENV) [root@s1.1.1.1 ProjectDirectory]# pip3 install twisted
pip is configured with locations that require TLS/SSL, however, the …Run Code Online (Sandbox Code Playgroud) 我正在尝试在 CentOS 7 上构建支持 SSL 的 Python 3.9.1。
[myuser@server Python-3.9.1]$ which openssl
/usr/local/bin/openssl
[myuser@server Python-3.9.1]$ openssl version
OpenSSL 1.1.1g 21 Apr 2020
Run Code Online (Sandbox Code Playgroud)
运行这个命令
sudo ./configure CPPFLAGS="-I/usr/local/openssl/include" LDFLAGS="-L/usr/local/openssl/lib" --with-ssl
Run Code Online (Sandbox Code Playgroud)
接下来的“make”适用于 Python 3.7,但是当我在 3.9 上运行上面的代码然后运行 make 时,我得到了这个输出
...
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_lzma _tkinter _uuid
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by …Run Code Online (Sandbox Code Playgroud) 使用本地openssl-1.0.1f共享安装编译python-3.4.0rc3时,make打印没有错误但是我在make install或make test上得到以下核心转储:
Program terminated with signal 11, Segmentation fault.
(gdb) bt
#0 0x00007f131dd10510 in EVP_PKEY_CTX_dup () from /data2/soft/openssl/lib/libcrypto.so.1.0.0
#1 0x00007f131dd0284f in EVP_MD_CTX_copy_ex () from /data2/soft/openssl/lib/libcrypto.so.1.0.0
#2 0x00007f131e256ab5 in EVPnew (name_obj=0x7f131e46a500, digest=0x0, initial_ctx=0x7f131e459a40, cp=0x0, len=0) at /data2/soft/python3/Python-3.4.0rc3/Modules/_hashopenssl.c:410
#3 0x00007f131e25726e in EVP_new_md5 (self=<value optimized out>, args=<value optimized out>) at /data2/soft/python3/Python-3.4.0rc3/Modules/_hashopenssl.c:799
#4 0x00000000004c7eef in ?? ()
Run Code Online (Sandbox Code Playgroud)
以下是使用的完整命令列表
tar -axf Python-3.4.0rc3.tgz
cd Python-3*
# For lzma and a pip-compatible openssl
export CFLAGS='-I/data2/soft/openssl/include/openssl -I/data2/local/include/'
export LDFLAGS='-L/data2/soft/openssl/lib -L/data2/local/lib/'
export LD_LIBRARY_PATH="/data2/soft/openssl/lib:/data2/local/lib/:$LD_LIBRARY_PATH"
# Ready ! …Run Code Online (Sandbox Code Playgroud) 问题:
重新安装Anaconda之后,我将无法再使用命令窗口导航到一个文件夹,在该窗口中我有一些.pynb文件,键入文件jupyter notebook并启动并运行。我收到这些错误:
C:\ scripts \ notebooks> jupyter笔记本Traceback(最近一次通话最近):文件“ C:\ Users \ MYUSERID \ AppData \ Local \ Continuum \ anaconda3 \ lib \ site-packages \ notebook \ services \ sessions \ sessionmanager.py” ,从sqlite3.dbapi2 import导入sqlite3文件“ C:\ Users \ MYUSERID \ AppData \ Local \ Continuum \ anaconda3 \ lib \ sqlite3__init __。py”的第10行,导入*文件“ C:\ Users \ MYUSERID \ AppData \ Local \ Continuum \ anaconda3 \ lib \ sqlite3 \ dbapi2.py”,第27行,来自_sqlite3 import * ImportError:DLL加载失败:找不到Procedyre
在处理上述异常期间,发生了另一个异常:
回溯(最近一次通话):文件“ …
在 MacOS 上从源代码构建 python 时,我不小心覆盖了 MacOS 附带的 python,现在它没有 SSL。我尝试通过运行--with-ssl选项再次构建
./configure --with-ssl
Run Code Online (Sandbox Code Playgroud)
但是当我后来跑的时候make,它说了这个
Python build finished, but the necessary bits to build these modules were not found:
_bsddb _ssl dl
imageop linuxaudiodev ossaudiodev
readline spwd sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Run Code Online (Sandbox Code Playgroud)
通过查看setup.py我应该做什么来找到“必要的位” ,我并不清楚。我该怎么做才能在 MacOS 上使用 SSL 构建 python?
我需要在Ubuntu 16.04中使用openssl-1.1.1尝试python 3.7。python和openssl版本都是预发行版本。按照上一篇文章中有关如何统计将openssl链接到python 的说明,我下载了opnssl-1.1.1的源代码。然后导航到openssl的源代码并执行:
./config
sudo make
sudo make install
Run Code Online (Sandbox Code Playgroud)
然后,编辑Modules/Setup.dist以取消注释以下行:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
Run Code Online (Sandbox Code Playgroud)
然后下载python 3.7源代码。然后,在源代码中导航并执行:
./configure
make
make install
Run Code Online (Sandbox Code Playgroud)
执行后make install,在终端输出的末尾出现此错误:
./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
generate-posix-vars failed
Makefile:596: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1
Run Code Online (Sandbox Code Playgroud)
我不知道问题出在哪里,我需要做什么。
我正在尝试根据https://bugs.python.org/issue29095上的说明在macOS 10.11上编译Python 3.6.2 .
我用自制OpenSSL的安装到标准位置,然后加入LDFLAGS,CFLAGS以及CPPFLAGS我ENV:
$ printenv | grep FLAGS
LDFLAGS=/usr/local/Cellar/openssl/1.0.2l/lib/
CFLAGS=-I/usr/local/Cellar/openssl/1.0.2l/include/openssl
CPPFLAGS=-I/usr/local/Cellar/openssl/1.0.2l/include/openssl
Run Code Online (Sandbox Code Playgroud)
然后在同一个shell中,我将Python编译到我的用例所需的自定义位置:
$ sudo ./configure --prefix=/oebuild/python/python-3.6.1
$ sudo make
$ sudo make install
Run Code Online (Sandbox Code Playgroud)
但是,SSL模块无法构建.构建日志说明了这一点:
Python构建成功完成!找不到构建这些可选模块的必要位:_gdbm _ssl ossaudiodev
spwd
要查找必要的位,请在detect_modules()中的setup.py中查找模块的名称.
我正在尝试使用 OpenSSL 在 Linux 上静态编译 Python 3.6。
我的构建发生在 dockerfile 中,但本质上是:
$ ./configure --prefix=/task/build --disable-shared LDFLAGS="-static"
$ make altinstall
Run Code Online (Sandbox Code Playgroud)
通过更新使其Modules/Setup.local看起来像:
*static*
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
Run Code Online (Sandbox Code Playgroud)
但是,在配置步骤中,我收到错误:
Step 9/14 : RUN ./configure --prefix=/task/build --disable-shared LDFLAGS="-static"
---> Running in cb79ee47052b
checking for git... found
checking build system type... x86_64-pc-linux-gnu
checking host …Run Code Online (Sandbox Code Playgroud) 我正在尝试从容器中的源代码构建 Python 和 OpenSSL。两者似乎都构建正确,但 Python 没有成功创建_ssl模块。
我在网上找到了一些指南 ,其中提到取消 Python 中的注释和行3.X.X/Modules/Setup,并将--openssldir=/usr/local/ssl标志添加到./configureOpenSSL 的步骤中。我在我的 dockerfile 中执行这些操作。这导致在./configurePython 输出期间,我看到以下行。
checking for X509_VERIFY_PARAM_set1_host in libssl... yes
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
[91m*** WARNING: renaming "_ssl" since importing it failed: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by build/lib.linux-x86_64-3.8/_ssl.cpython-38-x86_64-linux-gnu.so)
[0m[91m*** WARNING: renaming "_hashlib" since importing it failed: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by build/lib.linux-x86_64-3.8/_hashlib.cpython-38-x86_64-linux-gnu.so)
[0m
Python build finished successfully!
Run Code Online (Sandbox Code Playgroud)
...
Following modules built successfully but were removed because they …Run Code Online (Sandbox Code Playgroud) python ×11
openssl ×7
ssl ×5
linux ×2
centos7 ×1
compilation ×1
docker ×1
jupyter ×1
macos ×1
makefile ×1
pip ×1
pyopenssl ×1
python-3.6 ×1
python-3.9 ×1
python-venv ×1
redhat ×1
sqlite ×1