linux下Python环境安装配置步骤
2019/10/10/17:44:45 阅读:2178 来源:谷歌SEO算法 标签:
挖矿
Python环境安装配置算是学习python的第一步了,我们下面来为各位介绍在linux下Python环境安装配置过程了,有需要了解的可以进入 来看看.
安装python2.7:
- wgethttps://www.Python.org/ftp/Python/2.7.8/Python-2.7.8.tgz
- tarxvfPython-2.7.8.tgz
- cdPython-2.7.8
- ./configure–prefix=/usr/local/python27
- make
- makeinstall--phpfensi.com
- 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模块安装:
- yuminstallpython-pip#centos安装pip
- sudoapt-getinstallpython-pip#ubuntu安装pip
pip官方安装脚本:
- wgethttps://raw.github.com/pypa/pip/master/contrib/get-pip.py
- pythonget-pip.py
pip编译安装:
- wgethttp://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
- tarzxvfsetuptools-0.6c11.tar.gz
- cdsetuptools-0.6c11
- pythonsetup.pybuild
- pythonsetup.pyinstall
- wgethttps://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e
- tarzxvfpip-1.5.6.tar.gz
- cdpip-1.5.6
- pythonsetup.pybuild
- pythonsetup.pyinstall
加载环境变量:
- vim/etc/profile
- exportPATH=/usr/local/python27/bin:$PATH
- ./etc/profile
- pipinstallPackage#安装包pipinstallrequests
- pipshow–filesPackage#查看安装包时安装了哪些文件
- pipshow–filesPackage#查看哪些包有更新
- pipinstall–upgradePackage#更新一个软件包
- pipuninstallPackage#卸载软件包
热门评论