Python編程基礎環境安裝

來源:互聯網
上載者:User

標籤:

安裝python2.7

wget https://www.Python.org/ftp/Python/2.7.8/Python-2.7.8.tgz

tar xvf Python-2.7.8.tgz
cd Python-2.7.8
./configure –prefix=/usr/local/python27
make
make install
mv /usr/bin/python /usr/bin/python_old
ln -s /usr/local/python27/bin/python /usr/bin/
python # 查看版本

解決YUM無法使用的問題

vim /usr/bin/yum
首行#!/usr/bin/python 替換為老版本python #!/usr/bin/python2.4 注意可能為2.6

pip模組安裝

yum install python-pip # centos安裝pip
sudo apt-get install python-pip # ubuntu安裝pip
pip官方安裝指令碼
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python get-pip.py
pip編譯安裝
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install
wget https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e
tar zxvf pip-1.5.6.tar.gz
cd pip-1.5.6
python setup.py build
python setup.py install
載入環境變數
vim /etc/profile
export PATH=/usr/local/python27/bin:$PATH
. /etc/profile

pip install Package # 安裝包 pip install requests
pip show –files Package # 查看安裝包時安裝了哪些檔案
pip show –files Package # 查看哪些包有更新
pip install –upgrade Package # 更新一個軟體包
pip uninstall Package # 卸載軟體包

Python編程基礎環境安裝

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.