⑴ 如何升級到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