【问题标题】:Error in installing matplotlib安装 matplotlib 时出错
【发布时间】:2023-03-03 11:18:01
【问题描述】:

我正在 Linux 上的 python 中安装 matplotlib。

我使用以下命令安装。

pip install matplotlib

它显示以下错误:

error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pylab.py'

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_grayhat/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-YC1nG2-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_grayhat/matplotlib
Traceback (most recent call last):
   File "/usr/bin/pip", line 9, in <module>
   load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
   File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
return command.main(cmd_args)
   File "/usr/lib/python2.7/di`enter code here`st-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 40: ordinal not in range(128)

【问题讨论】:

  • 试试sudo pip install matplotlib

标签: python linux matplotlib terminal installation


【解决方案1】:

试试:

sudo pip install matplotlib

您的用户帐户无权写入/usr/local/lib/python2.7/dist-packages,但root 有。

【讨论】:

    猜你喜欢
    • 2021-02-20
    • 2012-10-06
    • 2021-02-07
    • 1970-01-01
    • 2016-02-04
    • 1970-01-01
    • 2020-02-15
    • 2022-01-17
    相关资源
    最近更新 更多