简体   繁体   English

安装2个python版本linux

[英]Install 2 python versions linux

So one of our servers has v2.6 installed.所以我们的一台服务器安装了 v2.6。 I've checked and most of the scripts that runs in this server are unix scripts.我已经检查过,在此服务器中运行的大多数脚本都是 unix 脚本。 There are few python scripts but I'm not sure if it's still being used. python 脚本很少,但我不确定它是否仍在使用。 They are not in cron.它们不在 cron 中。 I don't know their users as well.我也不了解他们的用户。

Now I want to install another version which is v3.10.现在我想安装另一个版本是 v3.10。 In short there will be two versions in the server — v2.6 and 3.10.简而言之,服务器中会有两个版本——v2.6 和 3.10。

My question is — is there a chance that those scripts running in v2.6 will encounter any issues once we install v3.10?我的问题是——一旦我们安装了 v3.10,那些在 v2.6 中运行的脚本是否有可能遇到任何问题?

If these scripts explicitly point to your python 2.x interpreter (with a shebang), then no, you won't have any issues.如果这些脚本明确指向您的 python 2.x 解释器(带有 shebang),那么不,您不会有任何问题。

However, if your question is : 'will my scripts written for python 2.x run without issue within python 3.10', then the answer is it depends.但是,如果您的问题是:“我为 python 2.x 编写的脚本是否会在 python 3.10 中正常运行”,那么答案取决于它。

Some python2 will run perfectly fine with python3.一些 python2 可以在 python3 上运行得很好。

Note that even if you install python3.10 on let's say Ubuntu, then python will still refer to your python2 installation by default.请注意,即使您在 Ubuntu 上安装了 python3.10,默认情况下python仍然会引用您的 python2 安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM