python - 在 python (Mac) 上安装模块时遇到问题
问题描述
我对使用 pip 在 Python 上安装模块有点陌生。我相信我已经安装了 pip,但是当我尝试使用我尝试使用 pip 安装的模块时,它说没有这样的模块。我将发布终端响应以查看发生了什么。如果有人可以让我知道我是否在安装模块时出错,我将非常感激,感谢您的宝贵时间。
faizrahman@138-38-186-80 ~ % sudo pip install matplotlib
Password:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: The directory '/Users/faizrahman/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: matplotlib in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.3.1)
Requirement already satisfied: numpy>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.8.0rc1)
Requirement already satisfied: python-dateutil in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (1.5)
Requirement already satisfied: tornado in /Library/Python/2.7/site-packages (from matplotlib) (5.1.1)
Requirement already satisfied: pyparsing>=1.5.6 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from matplotlib) (2.0.1)
Requirement already satisfied: nose in /Library/Python/2.7/site-packages (from matplotlib) (1.3.7)
Requirement already satisfied: singledispatch in /Library/Python/2.7/site-packages (from tornado->matplotlib) (3.4.0.3)
Requirement already satisfied: futures in /Library/Python/2.7/site-packages (from tornado->matplotlib) (3.3.0)
Requirement already satisfied: backports-abc>=0.4 in /Library/Python/2.7/site-packages (from tornado->matplotlib) (0.5)
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado->matplotlib) (1.12.0)
faizrahman@138-38-186-80 ~ %
解决方案
您需要从 python3 调用 pip:
sudo python3 -m pip install matplotlib
推荐阅读
- r - R - 为两个向量的元素创建随机组合
- json - 错误:类型 'Any' 没有下标成员 AlamoFire 与 Swift 4
- python - 使用 PCA 特征作为 X 和 Y 轴绘制集群
- amazon-web-services - AWS Sagemaker init 1K+ 模型“端点”?
- elasticsearch - Elasticsearch null_pointer_exception 与 top_hits 聚合
- javascript - 如何使用 Swift 将收据数据发送到 Node.js 服务器
- java - 字符串(日期)到 int(天)+ int(mont)+ int(年)到 LocalDate
- google-maps - 如何在 Flutter 中的 Google 地图上绘制多边形并获取其中的所有 POI?
- python - 生成多个 OR/AND 语句
- android - 如何更新现有cordova项目android平台中的文件?