⑴ 如何升级到python3版本并且安装pip3及ipython3
1、自定义编译安装python3.x版本
[html] view plain 在CODE上查看代码片派生到我的代码片
tar Jxf Python-3.5.2.tar.xz
cd Python-3.5.2
./configure --prefix=/usr/local/Python3
make && make install
2、安装pip3.x,安装会提示需要setuptools模块,所以需要先安装setuptools模块
[objc] view plain 在CODE上查看代码片派生到我的代码片
tar zxf pip-8.1.2.tar.gz
tar zxf setuptools-24.0.2.zip
cd setuptools-24.0.2
ln -s /usr/local/Python/bin/python3 /usr/bin/python3
python3 setup.py install
cd ..
cd pip-8.1.2
python3 setup.py install
ln -s /usr/local/Python3/bin/pip3 /usr/bin/pip3
3、验证模块是否正常安装
[html] view plain 在CODE上查看代码片派生到我的代码片
python3 -m pip list
decorator (4.0.10)
ipython (4.2.1)
ipython-genutils (0.1.0)
pexpect (4.2.0)
pickleshare (0.7.2)
pip (8.1.2)
ptyprocess (0.5.1)
setuptools (24.0.2)
simplegeneric (0.8.1)
traitlets (4.2.2)
4、安装ipython
[html] view plain 在CODE上查看代码片派生到我的代码片
python3 -m pip install ipython
ln -s /usr/local/Python3/bin/ipython3 /usr/bin/ipython3
⑵ 如何安装python扩展包
cmd里输入pip命令
pip install opencv-python
这样就是在安装opencv