更新python2.7.3后安装pip,steuptools等工具
来源:互联网 发布:智慧的云计算 pdf 编辑:程序博客网 时间:2024/06/16 17:05
1.首先安装setuptools:
#yum install zlib
#yum install zlib-devel
#wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
#tar -jxvf setuptools-1.4.2.tar.gz
#cd setuptools-1.4.2
#python setup.py install
出现报错:RuntimeError: Compression requires the (missing) zlib module,但实际已经安装成功。
解决办法:进入python27的安装目录中重新make,make install后进入setuptools-1.4.2目录中重新运行setup.py
2.接着安装pip:
#wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-6.0.7.tar.gz
#tar -jxvf pip-6.0.7.tar.gz
#cd pip-6.0.7
#python setup.py install
安装pip后,报pip:command not found 。
原因:重新编译过python,重新安装的python的bin目录不在$PATH中。这就导致了‘command not found’
解决办法,在.bashrc中加入PATH环境变量:export PATH=$HOME/bin:/usr/local/python27/bin:/usr/local/bin:$PATH
执行source命令,更新PATH。
#source .bashrc
重新pip后,报ImportError: cannot import name HTTPSHandler;
原因在于openssl,openssl-devel两个文件包未正确安装。
解决办法:用下来的命令来安装:
#yum install openssl -y
#yum install openssl-devel -y
安装完成后,重新安装python:#make #make install,最后重新安装pip。
3.安装virtualenv
virtualenv 可用来创建python中的虚拟开发环境,
#pip install vitrualenv
安装完毕后检查是否安装成功:
#virtualenv -h
正确安装结果为:Usage: virtualenv [OPTIONS] DEST_DIROptions: --version show program's version number and exit -h, --help show this help message and exit -v, --verbose Increase verbosity. -q, --quiet Decrease verbosity. -p PYTHON_EXE, --python=PYTHON_EXE The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 interpreter to create the new environment. The default is the interpreter that virtualenv was installed with (/usr/local/python27/bin/python) --clear Clear out the non-root install and start from scratch. --no-site-packages DEPRECATED. Retained only for backward compatibility. Not having access to global site-packages is now the default behavior. --system-site-packages Give the virtual environment access to the global site-packages. --always-copy Always copy files rather than symlinking. --unzip-setuptools Unzip Setuptools when installing it. --relocatable Make an EXISTING virtualenv environment relocatable. This fixes up scripts and makes all .pth files relative. --no-setuptools Do not install setuptools in the new virtualenv. --no-pip Do not install pip in the new virtualenv. --no-wheel Do not install wheel in the new virtualenv. --extra-search-dir=DIR Directory to look for setuptools/pip distributions in. This option can be used multiple times. --download Download preinstalled packages from PyPI. --no-download, --never-download Do not download preinstalled packages from PyPI. --prompt=PROMPT Provides an alternative prompt prefix for this environment. --setuptools DEPRECATED. Retained only for backward compatibility. This option has no effect. --distribute DEPRECATED. Retained only for backward compatibility. This option has no effect.
- 更新python2.7.3后安装pip,steuptools等工具
- python2 手动安装更新pip
- centos7.2+python2.7 gdal安装教程(校园网开启防火墙,无法使用yum,pip等工具)
- centos安装更新Python2.7以及pip的安装
- centos安装更新Python2.7以及pip的安装
- Python2.7.10以上pip更新及其他包安装
- python2.7.13安装pip
- python2.7下,使用pycharm更新pip后,命令框还是老版本的pip
- python安装后的pip工具安装
- mac工具安装-wget、homebrew、pip等
- centos 6.8 下python2.6 升级python2.7,安装pip工具
- win7,python2.7.6安装pip
- python2以及pip windows 安装
- python2.7pip安装错误
- Python2.7中安装pip
- 【python】 python2.7.5 安装pip
- python2 pip 安装报错
- Python2.6下安装pip
- Redis 数据类型
- 浅谈css引入方式:link与@import的区别
- A*算法的简单运用
- 人工智能的应用
- java获取某段时间内的所有日期
- 更新python2.7.3后安装pip,steuptools等工具
- 解决redis服务端不能任意ip访问的问题
- sublime text3---Emmet:HTML/CSS代码快速编写神器
- 数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和,对于每组输入数据,输出该数列的和,每个测试实例占一行,要求精度保留2位小数
- ObjectBox入门(续)
- Sublime Text 3 绝对神器
- KNN算法
- Ubuntu中虚拟环境pip安装包超时问题
- jvm内存模型