隨便逛逛看到這篇, 感覺用的人很安心, 就來試試看吧
$ python -V Python 2.6.5 $ curl -kL https://raw.github.com/utahta/pythonbrew/master/pythonbrew-install | bash $ . $HOME/.pythonbrew/etc/bashrc $ pythonbrew install 2.7.2 $ pythonbrew switch 2.7.2 Switched to Python-2.7.2 $ python -V Python 2.7.2再來是搞定 pip
原來用 pip 安裝的模組預設會在 /usr/lib/pymodules/python2.6 下, 所以即使更新到 Python 2.7 以後, 想要更新模組都會出現
Requirement already satisfied (use --upgrade to upgrade): xxxx in /usr/lib/pymodules/python2.6做法就是先將 /usr/bin/python 的 alias 換成 Python 2.7, 再移除舊版的 pip, 再下載安裝 pip 即可
ls -al /usr/bin/python* sudo rm /usr/bin/python sudo ln -s /home/USER/.pythonbrew/pythons/Python-2.7.2/bin/python /usr/bin/python sudo apt-get remove --purge python-pip wget --no-check-certificate https://raw.github.com/pypa/pip/master/contrib/get-pip.py /usr/bin/python get-pip.pyreference: Python 2.7 on Ubuntu
沒有留言:
張貼留言