/usr/local/bin/python3:没有名为 pip 的模块第 85 行或附近出现错误;以状态 1 退出

/usr/local/bin/python3:没有名为 pip 的模块第 85 行或附近出现错误;以状态 1 退出

我正在安装英特尔 OpenVINO 工具包我在其中配置了模型优化器。

(ankit) ankit@ankit-HP-Notebook:~/intel/computer_vision_sdk_2018.3.343/deployment_tools/model_optimizer/install_prerequisites$ sudo ./install_prerequisites.sh
Hit:1 https://download.docker.com/linux/ubuntu xenial InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu xenial InRelease                     
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]     
Hit:4 http://archive.canonical.com xenial InRelease                            
Get:5 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]    
Get:6 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]  
Get:7 http://in.archive.ubuntu.com/ubuntu xenial-proposed InRelease [260 kB]
Fetched 583 kB in 2s (287 kB/s)   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
21 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-venv is already the newest version (3.5.1-3).
libgfortran3 is already the newest version (5.4.0-6ubuntu1~16.04.10).
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
/usr/local/bin/python3: No module named pip
Error on or near line 85; exiting with status 1

我已经尝试了很多方法,那么我该如何解决呢?

我尝试了很多事情

答案1

这意味着你需要使用此命令安装 pip -

sudo apt install python3-pip

如果 python3 是唯一安装的 python 版本,那么pip使用时应该调用 pip3。

答案2

因为您已经python3-pip安装了包,所以您需要按如下方式调用它pip3

pip3 list
sudo pip3 install virtualenv

答案3

创建一个符号链接,在/usr/local/bin/python3/pip其中引用文件/usr/local/bin/pip2.7

sudo ln -s /usr/local/bin/pip2.7 /usr/local/bin/python3/pip  

然后将目录更改为~/intel/computer_vision_sdk_2018.3.343/deployment_tools/model_optimizer/install_prerequisites并运行sudo ./install_prerequisites.sh

相关内容