首页 > 解决方案 > 如果没有 python 3.5 或更高版本和 pip 18 及更高版本,MatPlotLib 将无法安装,而且我没有 root 访问权限

问题描述

我已获得对服务器的远程访问权限。而且我需要使用诸如pyswarms之类的模块。但是 pyswarms 尝试安装 Matplotlib 和 Matplotlib 3 需要 python 3.5 或更高版本和/或 pip 9 或更高版本。在该服务器上有 python 3.4 和 pip 8。我一直在使用 --user 安装模块。我没有root访问权限,所以我不能使用sudo。我尝试更新 pip 但它再次安装了相同的版本(8)。有什么办法吗?

收集 matplotlib>=1.3.1(来自 pyswarms)使用缓存的https://files.pythonhosted.org/packages/89/0c /653aec68e9cfb775c4fbae8f71011206e5e7fe4d60fcf01ea1a9d3bc957f/matplotlib-3.0.2.tar.gz 命令 python setup.py egg_info 的完整输出:

Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4.
Beginning with Matplotlib 3.0, Python 3.5 and above is required.

This may be due to an out of date pip.

Make sure you have pip >= 9.0.1.

标签: pythonmatplotlibpiproot

解决方案


安装有约束的包:

pip install pyswarms 'matplotlib<3.0'

即安装pyswarms(任意版本),安装低于3.0版本的matplotlib。


推荐阅读