Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PyEnv中Ubuntu 20.04上的Python 2.7.12_Python_Pyenv_Ubuntu 20.04 - Fatal编程技术网

PyEnv中Ubuntu 20.04上的Python 2.7.12

PyEnv中Ubuntu 20.04上的Python 2.7.12,python,pyenv,ubuntu-20.04,Python,Pyenv,Ubuntu 20.04,我有一些在Python2.7.12上运行的传统网站,并且刚刚将我的开发机器更新为Ubuntu20.04 我试图让PyEnv安装python2.7.12,但这似乎取决于libssl1.0-dev,而libssl1.0-dev已在ubuntu20.04中删除 我得到一个错误: Installing Python-2.7.12... ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? Please co

我有一些在Python2.7.12上运行的传统网站,并且刚刚将我的开发机器更新为Ubuntu20.04

我试图让PyEnv安装python2.7.12,但这似乎取决于libssl1.0-dev,而libssl1.0-dev已在ubuntu20.04中删除

我得到一个错误:

Installing Python-2.7.12...
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (Ubuntu 20.04 using python-build 20180424)
我的建议如下:

我得到一个错误:

Installing Python-2.7.12...
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (Ubuntu 20.04 using python-build 20180424)
E:包'libssl1.0-dev'没有安装候选程序

有没有办法做到这一点?如果是的话,请怎么办


谢谢。

正如Klaus提到的,您可以将docker映像用于p,但ssl库非常重要,所以它没有安装候选程序,这很奇怪。focal的包
libssl-dev
已经列出了

我看不到让PyEnv使用如此旧版本的Python的方法,所以选择使用Klaus和Rafal建议的Docker。多谢各位


对于其他与此相关的人,.

您可以从以前的Ubuntu 18.04版本安装libssl1.0-dev:

wget -P /tmp/ http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2n-1ubuntu5.5_amd64.deb
wget -P /tmp/ http://ftp.osuosl.org/pub/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.5_amd64.deb
apt install /tmp/libssl1.0.0_1.0.2n-1ubuntu5.5_amd64.deb
apt install /tmp/libssl1.0-dev_1.0.2n-1ubuntu5.5_amd64.deb
它是有效的,但这不是推荐的方法。因为libssl1.0包将来不会收到安全更新!也许python 2.7.17适合您?您可以通过apt安装:

apt install python2

您是否考虑过在Docker容器中运行遗留应用程序?这样你就不需要用旧的依赖关系把整个系统搞得乱七八糟了。谢谢。我以前从未用过Docker,但我想试试。也就是说,看起来Python最古老的支持版本是2.7.17,除非我遗漏了什么?你看的是worong方面。是PythonImages的官方docker中心。我认为它被贬低了,取而代之的是libssl1.1-dev。我已经决定回滚到以前的操作系统,尽管brain已经开始为此流血了。不过,谢谢你的链接,我可能还是会尝试一下,因为我现在在回滚到Ubuntu 18.04.4时遇到了其他问题。我刚刚和docker玩了一场,看起来很神奇。看起来这会帮我解决问题,所以谢谢你们。答案中的两个链接不再有效。
wget
的更新命令是:
wget-P/tmp/http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0-dev_1.0.2n-1ubuntu5_amd64.deb
wget-P/tmp/http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb
apt install
的更新命令将是:
sudo apt install/tmp/libssl1.0.0_1.0.2n-1ubuntu5_amd64.deb
sudo apt install/tmp/libssl1.0-dev_1.0.2n-1ubuntu5_amd64.deb