[python专题笔记]pip 问题

一 pip3 如下报错

问题现象
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

解决方法
curl -fsSL -o- https://bootstrap.pypa.io/pip/3.5/get-pip.py|python3.5

二 pip3 报错如下

问题现象
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/00/9e/92de7e1217ccc3d5f352ba21e52398372525765b2e0c4530e6eb2ba9282a/cffi-1.15.0.tar.gz (484 kB)
Requirement already satisfied: pycparser in /home/spd_vspfeed/.local/lib/python3.5/site-packages (from cffi>=1.0->soundfile) (2.21)
Building wheels for collected packages: cffi
  Building wheel for cffi (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-i6djzrkb/cffi_3fba870a8d544416aee0a8ac798ff394/setup.py'"'"'; __file__='"'"'/tmp/pip-install-i6djzrkb/cffi_3fba870a8d544416aee0a8ac798ff394/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-d5e8dtc6
       cwd: /tmp/pip-install-i6djzrkb/cffi_3fba870a8d544416aee0a8ac798ff394/
  Complete output (54 lines):
  Package libffi was not found in 
解决方法
sudo apt-get install build-essential libssl-dev libffi-dev python-dev

三 pip 报错如下

pip3 install esptool      
Traceback (most recent call last):
  File "/usr/bin/pip3", line 11, in <module>
    sys.exit(main())
  File "/home/spd-pub/.local/lib/python3.5/site-packages/pip/__init__.py", line 11, in main
    from pip._internal.utils.entrypoints import _wrapper
  File "/home/spd-pub/.local/lib/python3.5/site-packages/pip/_internal/utils/entrypoints.py", line 12
    f"pip{sys.version_info.major}",
                                 ^
SyntaxError: invalid syntax

解决方法
wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
python3 get-pip.py
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值