ubuntu14.10 python2.7.8 python3.4.2, /usr/bin/ , python2.7.8
xx@ada:~$ python --version
Python 2.7.8
xx@ada:~$ python3.4 --version
Python 3.4.2
xx@ada:~$ python2.7 --version
Python 2.7.8
xx@ada:~$ which python
/usr/bin/python
xx@ada:~$ which python3.4
/usr/bin/python3.4
xx@ada:~$
python python2.7 python2.7.9, , python2.7.9
python ubuntu :
- 通过ubuntu官方的apt工具包安装
- 通过PPA(Personal Package Archive) 的apt工具包安装
- 通过编译python源代码安装
通过ubuntu官方的apt工具包安装
sudo apt-get install python2.7
sudo apt-get install python3.4
,
xx@ada:~$ python2.7 --version
Python 2.7.8
xx@ada:~$ python3.4 --version
Python 3.4.2
xx@ada:~$
PPA(Personal Package Archives)からaptキットをインストールする
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python2.7
apt python , 。 , python , python2.7.
ソースコードコンパイルからpythonをインストールする
$ wget -c https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
$ tar -xzvf Python-2.7.9.tgz
$ cd Python-2.7.9/
$ LDFLAGS="-L/usr/lib/x86_64-linux-gnu" ./configure
$ make
$ sudo make install
, wget -c (url) , -c , url
“-L/usr/lib/x86_64-linux-gnu” x86_64-linux-gnu /usr/lib/ , x86_64 64 , 。
, , python --version, , which python
xx@ada:~$ python --version
Python 2.7.9
xx@ada:~$ which python
/usr/local/bin/python
xx@ada:~$
, python2.7.9 , python python2.7.9。 , PATH ,
/usr/local/bin/ python /usr/bin/ python , python 。
ubuntu14.10 python, python2.7.8, python2.7.9, python3.4.2, :
xx@ada:~$ python --version
Python 2.7.9
xx@ada:~$ python2.7 --version
Python 2.7.9
xx@ada:~$ python3.4 --version
Python 3.4.2
xx@ada:~$ python2.7
Python 2.7.9 (default, Jan 3 2015, 03:27:08)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
xx@ada:~$
, python , python , :
xx@ada:~$ /usr/bin/python --version
Python 2.7.8
xx@ada:~$ /usr/bin/python2.7 --version
Python 2.7.8
xx@ada:~$ /usr/bin/python3.4 --version
Python 3.4.2
xx@ada:~$ /usr/local/bin/python --version
Python 2.7.9
xx@ada:~$ /usr/local/bin/python2.7 --version
Python 2.7.9
xx@ada:~$
, python ubuntu 。
OK, Enjoy it!!!
, python2.7.9 virtualenv virtualenvwrapper, python2.7.9 , python , :
/usr/local/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python and that PATH is
set properly.
xx@ada:~$
python2.7.9 virtualenvwrapper, ,
$ virtualenv --help
$ mkivrtulaenv --help
$ workon
/usr/local/bin/python: No module named virtualenvwrapper
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python and that PATH is
set properly.
xx@ada:~$ workon
env
xx@ada:~$ workon env
/usr/local/bin/python: No module named virtualenvwrapper
/usr/local/bin/python: No module named virtualenvwrapper
(env)xx@ada:~$ deactivate
/usr/local/bin/python: No module named virtualenvwrapper
/usr/local/bin/python: No module named virtualenvwrapper
xx@ada:~$
, 。 , ...
pip freeze python :
xx@ada:~$ pip freeze
adium-theme-ubuntu==0.3.4
apt-xapian-index==0.46
ccsm==0.9.12
characteristic==0.1.0
chardet==2.2.1
colorama==0.3.1
command-not-found==0.3
compizconfig-python==0.9.12
debtagshw==0.1
defer==1.0.6
dirspec==13.10
duplicity==0.6.23
gevent==1.0.1
greenlet==0.4.5
html5lib==0.999
httplib2==0.9
idna==0.9
lockfile==0.8
lxml==3.3.6
oauthlib==0.6.1
oneconf==0.3.7
PAM==0.4.2
pbr==0.10.7
pexpect==3.2
Pillow==2.6.1
piston-mini-client==0.7.5
pyasn1==0.1.7
pyasn1-modules==0.0.5
pycrypto==2.6.1
pycups==1.9.67
pycurl==7.19.5
pygobject==3.14.0
pyOpenSSL==0.13.1
pyserial==2.6
python-apt===0.9.3.10ubuntu1
python-debian==0.1.22
pyxdg==0.25
reportlab==3.1.8
requests==2.3.0
service-identity==1.0.0
sessioninstaller==0.0.0
six==1.7.3
software-center-aptd-plugins==0.0.0
stevedore==1.1.0
system-service==0.1.6
Twisted-Core==14.0.2
Twisted-Web==14.0.2
unity-lens-photos==1.0
urllib3==1.8.3
virtualenv==12.0.4
virtualenv-clone==0.2.5
virtualenvwrapper==4.3.1
wheel==0.24.0
xdiagnose==3.6.6
zope.interface==4.1.1
xx@ada:~$
...