我对osx上的python有点困惑.我不知道笔记本电脑的前任用户是否使用macport安装了macpython.我记得osx有内置版本的python.我尝试使用type -a python并返回结果
python is /usr/bin/python
python is /usr/local/bin/python
Run Code Online (Sandbox Code Playgroud)
然而,在这些位置运行两个python给了我[GCC 4.2.1 (Apple Inc. build 5646)] on darwin.他们都提到了相同的内置python mac提供的吗?
我还读到安装macpython会
A MacPython 2.5 folder in your Applications folder. In here you
find IDLE, the development environment that is a standard part of
official Python distributions...
Run Code Online (Sandbox Code Playgroud)
我看着Applications,还有一个MacPort文件夹python2.6和里面提到的东西.但是运行IDLE,我发现了与上面相同的消息.
嗯,我有点困惑.哪个是哪个?
这是我的情况:
我正在使用Ubuntu 10.04(Lucid Lynx).系统的默认Python是v2.6.5,但我需要Python v2.7.所以我从python.org下载了源代码并尝试安装它.
我第一次安装它时,我跑了:
cd Python2.7.4
./configure --prefix=/usr
make
su root
make install
Run Code Online (Sandbox Code Playgroud)
这会将Python 2.7安装到我的系统中.它将创建一个链接,"python",也/usr/bin链接到.因此,当我输入时,系统将为我启动Python 2.7.4,就像我输入时一样.python2.7/usr/bin>python>python2.7
但是当我以这种方式安装时:
cd Python2.7.4
./configure --prefix=/usr
make
su root
make altinstall
Run Code Online (Sandbox Code Playgroud)
链接"python" /usr/bin仍然存在,并且链接到python2.6默认系统版本.当然,我可以删除它并创建一个链接到的新软链接python2.7.
除了链接之外,命令"make install"和"make altinstall"之间有什么区别/usr/bin?