Linux——未完成

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   io   使用   strong   ar   

終於決定將學習環境徹底轉到Linux上來,下面記錄一下轉移學習環境的各種軟體和環境的安裝和配置。

1、centos內建python2.6,之前的博文已經說到已成功更新到python3.3,下面首先安裝python的包管理器(pip或easy_install)

  CentOS 6.3安裝pip

  CentOS安裝python包管理安裝工具pip的方法如下:

  寫本文的時候,pip最新為 1.5.5

    wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.6.tar.gz

  注意:wget擷取https的時候要加上:--no-check-certificate

    tar zvxf 1.5.6.tar.gz    #解壓檔案    cd pip-1.5.6/    python setup.py install  #這一步出錯了,需要安裝setuptools
Traceback (most recent call last):  File "setup.py", line 6, in <module>    from setuptools import setup, find_packagesImportError: No module named ‘setuptools‘    #需要安裝setuptools
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gztar zxvf setuptools-0.6c11.tar.gzcd setuptools-0.6c11python setup.py buildpython setup.py install       #安裝setuptools時出現錯誤,缺少zlib module
 "Compression requires the (missing) zlib module")RuntimeError: Compression requires the (missing) zlib module
  # 缺少zlib,安裝setuptools時出錯。  # issue: RuntimeError: Compression requires the (missing) zlib module  yum install zlib zlib-devel -y    #zlib安裝成功!  # 重make Python3.3.3再安裝  cd ../Python-3.3.3  make  # 這時才注意先前make時缺了好多模組  make install

由於zlib安裝成功,setuptools也安裝成功!開始安裝pip。

python setup.py install 
...
Installed /usr/local/python3.3.3/lib/python3.3/site-packages/pip-1.5.6-py3.3.egg
Processing dependencies for pip==1.5.6
Finished processing dependencies for pip==1.5.6     #pip安裝成功!版本1.5.6

使用pip命令出錯:

can‘t find commond.    #需要增加環境變數

全域的對所有使用者都可以的使用的PATH: 可以通過修改設定檔: /etc/bashrc 和 /etc/profile 來時配置,全域的PATH; 
例如: vi /etc/profile
在最後後加一行:PATH=THE_SET_GLOBLE_ENV_PATH:$PATH;
接著換行: export PATH
如果使其立即生效: source /etc/profile
# 缺少ssl模組,pip使用時出錯# issue: ImportError: cannot import name HTTPSHandleryum install openssl openssl-devel -ymake  # Python-2.7.6目錄make install

pip可以使用!

Linux——未完成

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.