简体   繁体   English

在哪里安装了第二个Python版本?

[英]Where is the second Python version installed?

I have a cpanel server with python 2.6.6 by default. 我有一个默认使用python 2.6.6的cpanel服务器。

root@vps [~]# python --version
Python 2.6.6
root@vps [~]#

However, I also have Zope 2.9.5 installed which is running on an earlier version of Python. 但是,我还安装了在早期版本的Python上运行的Zope 2.9.5。 This is the info from the Zope admin page: 这是来自Zope管理页面的信息:

Zope Version
(Zope 2.9.5-final, python 2.4.3, linux2)
Python Version
2.4.3 (#1, Jul 1 2014, 04:19:44) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
System Platform
linux2
SOFTWARE_HOME
/opt/Zope-2.9/lib/python
ZOPE_HOME
/opt/Zope-2.9
INSTANCE_HOME
/usr/local/zope_new_instance
CLIENT_HOME
/usr/local/zope_new_instance/var
Network Services
ZServer.HTTPServer.zhttp_server (Port: 8080)
Process Id
8781 (140167694149376)
Running For
59 days 4 hours 5 min 4 sec

I am trying to setup a new cpanel server with EXACTLY the same setup regarding Zope and Python. 我正在尝试使用与Zope和Python完全相同的设置来设置新的cpanel服务器。 I do have the source for both Zope 2.9.5 as well as the source for Python 2.4.3. 我确实有Zope 2.9.5的源代码以及Python 2.4.3的源代码。 I am not sure where to install Python 2.4.3 though. 我不确定在哪里安装Python 2.4.3。 Is there a command that will show me other python locations? 是否有命令可以向我显示其他python位置? which python shows me the default Python location. 哪个python向我显示了默认的Python位置。

I don't know Zope, but it looks like you're in Unix, so if you installed Python through apt, dnf, etc...: 我不了解Zope,但看起来您在Unix中,因此如果您通过apt,dnf等安装了Python,则:

  • The symbolic link to Python is usually installed in /usr/bin . 到Python的符号链接通常安装在/usr/bin If you search by "python" in that folder you should find all the python available for you. 如果您在该文件夹中通过“ python”进行搜索,则应找到所有可用的python。

  • If you are looking for the headers in /usr/include you should have a folder for each version of Python installed. 如果要在/usr/include中查找标题,则应该为每个版本的Python安装一个文件夹。

And you say: "I am not sure where to install Python 2.4.3 though". 而且您说:“不过,我不确定在哪里安装Python 2.4.3”。

If you're installing Python from source it will be installed in your local folder: /usr/local/bin (for symbolic link) and /usr/local/include for headers. 如果您要从源代码安装Python,它将安装在本地文件夹中: /usr/local/bin (用于符号链接)和/usr/local/include用于标题)。 Also, make sure to enable symbolic links when compiling. 另外,请确保在编译时启用符号链接。 If I'm not wrong in the ./configure step, you can use ./configure --enable-shared to make sure that when you compile the source code it will installs you a symbolic link for that version in you /usr/local/bin 如果我在./configure步骤中输入的没错,则可以使用./configure --enable-shared来确保在编译源代码时它将在您的/usr/local/bin安装该版本的符号链接/usr/local/bin

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

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