为什么在尝试使用 pip 安装 pillow 时出现错误“\[Errno 42\] 非法字节序列”?

新手上路,请多包涵

我想安装枕头,但是当我在 cmd 中运行 pip install pillow 时,我收到以下消息:

 DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pillow
  Downloading https://files.pythonhosted.org/packages/5e/b6/8960697526a79bd1cb4520293078be3a10d725f23f20abbee298ebdeaabd/Pillow-6.2.2-cp27-cp27m-win_amd64.whl (1.9MB)
     |ERROR: Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence

WARNING: You are using pip version 19.2.3, however version 20.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Python 3.8.2 已经安装在我的电脑上,我将它添加到 PATH 中。

我也跑了 python -m pip install --upgrade pip 没有任何改变。

问题是什么?我需要更新 Python 版本吗?

原文由 Shir Cohen 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 522
1 个回答

使用第三方 PPA 存储库安装

第 1 步: 如果您的系统上尚未安装 Ubuntu 软件属性包,请先安装它。

 $ sudo apt update

$ sudo apt install software-properties-common

第 2 步: 之后运行命令添加 PPA。

 $ sudo add-apt-repository ppa:deadsnakes/ppa

第 3 步: 最后,运行以下命令安装 Python 3.8

 $ sudo apt update
$ sudo apt install python3.8

您可以检查如下:

 $ python3 --version

蟒蛇 3.8.1

OK完成。

原文由 Tharun Vempati 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题