1、首先必须在Ubuntu上安装好Python-3.5版本
2、进入到对应的路径下Python-3.5
3、安装完成之后,自带版本pip3
4、安装个模块试试:
1 [root@localhost Python-3.5.2]# pip3 install pymysql 2 Collecting pymysql 3 Downloading PyMySQL-0.7.9-py3-none-any.whl (78kB) 4 100% |████████████████████████████████| 81kB 6.3kB/s 5 Installing collected packages: pymysql 6 Successfully installed pymysql-0.7.9 7 You are using pip version 8.1.1, however version 9.0.1 is available. 8 You should consider upgrading via the 'pip install --upgrade pip' command.
1 [root@localhost Python-3.5.2]# pip3 install --upgrade pip 2 Collecting pip 3 Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB) 4 100% |████████████████████████████████| 1.3MB 3.2kB/s 5 Installing collected packages: pip 6 Found existing installation: pip 8.1.1 7 Uninstalling pip-8.1.1: 8 Successfully uninstalled pip-8.1.1 9 Successfully installed pip-9.0.1 10 [root@localhost Python-3.5.2]# pip3 --version 11 pip 9.0.1 from /usr/local/lib/python3.5/site-packages (python 3.5)
6、升级完成
补充:pip工具升级
如果你在执行 pip
命令,需要下面的输出:
You areusing pip version7.1.2, however version8.1.2 is available.
You should consider upgrading viathe'python -m pip install --upgrade pip'command.
它提示你目前的pip工具不是最新的,需要更新。用Pip更新操作入下所示:
python -m pip install --upgrade pip #更新至9.0.1的关键代码
pip3 install --upgrade pip#pip3升级
|
sudo
-H pip3
install
--upgrade pip #python3
|
sudo pip3 uninstall tensorflow # for Python 3.n #卸载tensorflow
下面是简便的安装的方法:
安装Python-opencv:
sudo apt-get install python-opencv
sudo apt-get install python-numpy