qq_42279801
2021-08-11 09:37
采纳率: 33.3%
浏览 107
已结题

Ubuntu升级Python3版本后pip无法使用

输入pip命令后结果如下

caros@ubuntu:~$ pip3
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = ':/home/caros/otaclient/:/home/caros/secure_upgrade/python/'
  program name = '/usr/bin/python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '/usr/local/python3'
  sys.base_exec_prefix = '/usr/local/python3'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '/usr/local/python3'
  sys.exec_prefix = '/usr/local/python3'
  sys.path = [
    '',
    '/home/caros/otaclient/',
    '/home/caros/secure_upgrade/python/',
    '/usr/local/python3/lib/python38.zip',
    '/usr/local/python3/lib/python3.8',
    '/usr/local/python3/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fdb42ed8740 (most recent call first):
<no Python frame>


  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • 小陈码上有对象 2021-08-11 10:04
    已采纳

    首先卸载原来的pip3
    sudo apt remove python3-pip
    然后在安装一下
    sudo apt install python3-pip

    评论
    解决 无用
    打赏 举报
查看更多回答(3条)

相关推荐 更多相似问题