栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

ubuntu使用pip安装时报错

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ubuntu使用pip安装时报错

Q1、使用Pip时报错

Traceback (most recent call last):
	……
  File "/usr/bin/pip3", line 9, in 
    from pip import __main__
  File "……/python3.5/dist-packages/pip/__main__.py", line
21, in 
    from pip._internal.cli.main import main as _main
  File "……/python3.5/dist-packages/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

原因: Pip版本不匹配Python3.5版本
解决: 重新安装Pip

sudo apt-get purge --auto-remove python3-pip
sudo apt-get purge --auto-remove python3-pip
wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
python3 get-pip.py

报错Q2

Q2、安装Pip时报错

Traceback (most recent call last):
	……
  File "……/python3.5/dist-packages/setuptools/__init__.py", line 18, in 
    from setuptools.dist import Distribution
  File "……//python3.5/dist-packages/setuptools/dist.py", line 294
    warnings.warn(f"{attr} is ignored.", DistDeprecationWarning)
                                      ^
SyntaxError: invalid syntax

原因: Setuotools版本过高
解决: 重新安装低版本Setuptools 19.6(其他版本未测试)

wget --no-check-certificate  https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
tar -zxvf setuptools-19.6.tar.gz
cd setuptools-19.6
python3 setup.py build
sudo python3 setup.py install

报错Q3

Q3、Pip安装黄色警告:

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

原因: Pip安装路径未包含
解决:

echo 'export PATH=**提示的路径**:$PATH' >>~/.bashrc
source ~/.bashrc
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/321789.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号