必须安装 setuptools 才能从源代码分发版进行安装

必须安装 setuptools 才能从源代码分发版进行安装

我正在尝试安装 pywavelets lib,我给出了一个命令,pip install pywavelets 它给了我一个错误,必须安装 setuptools 才能从源分发版安装。

检查这个错误时,我看到一些帖子说使用命令sudo pip install -U setuptools 完成后会显示以下内容

The directory '/home/raady/.cache/pip/http' or its parent directory is  
not owned by the current user and the cache has been disabled. Please
check the permissions and owner of that directory. If executing pip 
with sudo, you may want sudo's -H flag. You are using pip version 
7.1.0, however version 8.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' 
command. The directory '/home/raady/.cache/pip/http' or its parent 
directory is not owned by the current user and the cache has been 
disabled. Please check the permissions and owner of that directory.
If executing pip with sudo, you may want sudo's -H flag.
/usr/local/lib/python2.7/dist-packages/pip-7.1.0-
py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: 
InsecurePlatformWarning: A true SSLContext object is not available. 
This prevents urllib3 from configuring SSL appropriately and may cause 
certain SSL connections to fail. For more information, see  
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Requirement already up-to-date: setuptools in usr/local/lib/python2.7/dist-packages/setuptools-23.0.0-py2.7.egg

在我看到的说明中,我虽然必须升级,但尝试使用该命令时pip install --upgrade pip 显示以下错误 在此处输入图片描述 如何纠正这个问题以便我安装 pywavelet 库。

我正在尝试安装链接中的软件包`安装 python 所需的软件包我无法安装任何软件包。

问题可能出在哪里?如何解决?

答案1

我不明白错误是什么,但可以设法使其工作。

我使用了以下命令

sudo apt-get install python-pkg-resources=3.3-1ubuntu1
sudo apt-get install python-setuptools
pip install pywavelets

它解决了我的问题。

答案2

因此首先确保您在安装时拥有所有必要的权限。

例如:

pip install --upgrade pip

因 而失败Permission denied

要解决此问题sudo,请按如下方式运行它:

sudo pip install --upgrade pip

相关内容