在 Ubuntu 为什么我在 python 的 usr/bin 下载时看不到特定版本?

in Ubuntu why don't I see a specific version in usr/bin of python when I download it?

您好,我正在尝试让特定版本的 python 在 vi​​rtualenv

中工作

我尝试了这些解决方案:

https://askubuntu.com/questions/682869/how-do-i-install-a-different-python-version-using-apt-get

我没有编译答案,因为看起来这样做会摆脱我的“旧”新版本 python。

所以我最关心的是第一个答案。我这样做了:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.3

虽然我没有收到“python3.3 已安装消息”,但它似乎运行良好,或者它看起来应该是:

sudo apt-get install python3.3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python3-3parclient' for regex 'python3.3'
The following additional packages will be installed:
  python3-dnspython python3-eventlet python3-greenlet
Suggested packages:
  python-eventlet-doc python-greenlet-doc python-greenlet-dev
  python3-greenlet-dbg
The following NEW packages will be installed:
  python3-3parclient python3-dnspython python3-eventlet python3-greenlet
0 upgraded, 4 newly installed, 0 to remove and 7 not upgraded.
Need to get 316 kB of archives.
After this operation, 1,867 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-greenlet amd64 0.4.15-4.1 [15.7 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/main amd64 python3-dnspython all 1.16.0-1build1 [89.1 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-eventlet all 0.25.1-2ubuntu1 [154 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-3parclient all 4.2.11-0ubuntu1 [57.4 kB]
Fetched 316 kB in 0s (1,007 kB/s)            
Selecting previously unselected package python3-greenlet.
(Reading database ... 212769 files and directories currently installed.)
Preparing to unpack .../python3-greenlet_0.4.15-4.1_amd64.deb ...
Unpacking python3-greenlet (0.4.15-4.1) ...
Selecting previously unselected package python3-dnspython.
Preparing to unpack .../python3-dnspython_1.16.0-1build1_all.deb ...
Unpacking python3-dnspython (1.16.0-1build1) ...
Selecting previously unselected package python3-eventlet.
Preparing to unpack .../python3-eventlet_0.25.1-2ubuntu1_all.deb ...
Unpacking python3-eventlet (0.25.1-2ubuntu1) ...
Selecting previously unselected package python3-3parclient.
Preparing to unpack .../python3-3parclient_4.2.11-0ubuntu1_all.deb ...
Unpacking python3-3parclient (4.2.11-0ubuntu1) ...
Setting up python3-greenlet (0.4.15-4.1) ...
Setting up python3-dnspython (1.16.0-1build1) ...
Setting up python3-eventlet (0.25.1-2ubuntu1) ...
/usr/lib/python3/dist-packages/eventlet/db_pool.py:78: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.max_age is 0 or self.max_idle is 0:
/usr/lib/python3/dist-packages/eventlet/db_pool.py:78: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.max_age is 0 or self.max_idle is 0:
Setting up python3-3parclient (4.2.11-0ubuntu1) ...
/usr/lib/python3/dist-packages/hpe3parclient/http.py:278: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.tries is 0:

完成此操作后,我希望 python 3.3 可以在 usr/bin 中使用,因此我可以用它设置 virtualenv,但事实并非如此。有没有我遗漏的步骤?

谢谢!

发现 3.3 不适用于我的 ubuntu 20.04。我认为因为我的 python2.7 有效,所以我可以升级到 3.3 没问题。我猜 2.7 之所以存在,是因为它是旧版 ubuntu.

的遗留物

无论如何,python3.5 对我有用!

我假设您使用的是 ubuntu 20.04

不幸的是,如果没有资金,我无法在 20.04 上提供 python<3.5 的软件包,因为这些版本从未在上游收到 libssl1.1 补丁。我可以自己修补它们,但我无法合理化免费做的大量工作。所以在 20.04 上你需要使用 python3.5+

安装“东西”的原因是 apt-get “”“有用”“”将您的包名称规范化为完全不相关的东西:

Note, selecting 'python3-3parclient' for regex 'python3.3'

免责声明:我维护 deadsnakes