首页 > 解决方案 > 无法为 python 3.6.5 安装 numpy

问题描述

我正在尝试使用命令安装 numpypip3 install numpy 但我收到以下错误:

Collecting numpy
  Using cached https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: numpy
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/site-packages/numpy-1.16.2.dist-info'
Consider using the `--user` option or check the permissions.

它说permission denied所以我运行它sudo并正确安装。

但是,当我使用任何使用 numpy 的脚本时,python3 abc.py我收到一条错误消息,指出没有名为 numpy 的模块。它适用于 sudo

如何安装 numpy 以在没有 sudo 的情况下使用?

我在 Ubuntu 18.04 上运行 python 3.6.5

标签: numpypippython-3.6

解决方案


推荐阅读