easy_install失败,找不到setuptools

时间:2018-03-28 12:23:25

标签: python easy-install

我有一个下载的.egg文件,我想<xsl:for-each select="./command/ProviderTable/row"> <xsl:element name="SERVICE_PROVIDER"> <SERVICE_PROVIDER_ID> <xsl:value-of select="col[1]"/> </SERVICE_PROVIDER_ID> <SERVICE_PROVIDER_NAME> <xsl:value-of select="col[2]"/> </SERVICE_PROVIDER_NAME> <IS_ENTERPRISE> <xsl:value-of select="col[3]"> </IS_ENTERPRISE> </xsl:element> </xsl:for-each> 。所以我发出:easy_install并且它失败了:

easy_install my.egg

所以我尝试$ which easy_install /usr/local/opt/python2/libexec/bin/easy_install $ easy_install my.egg Traceback (most recent call last): File "/usr/local/opt/python2/libexec/bin/easy_install", line 6, in <module> from pkg_resources import load_entry_point File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3195, in <module> @_call_aside File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3179, in _call_aside f(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3208, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 683, in _build_master return cls._build_from_requirements(__requires__) File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 696, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 885, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'setuptools==38.5.1' distribution was not found and is required by the application 也失败了:

pip setuptools

我不知道pip怎么会进入一个不起作用的状态,但我发现https://stackoverflow.com/a/43311811/201657让我发现我在$ pip setuptools Traceback (most recent call last): File "/usr/local/opt/python2/libexec/bin/pip", line 6, in <module> from pkg_resources import load_entry_point File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3195, in <module> @_call_aside File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3179, in _call_aside f(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3208, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 683, in _build_master return cls._build_from_requirements(__requires__) File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 696, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 885, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application 有另一个点:

/usr/local/bin/pip

所以我尝试着:

$ /usr/local/bin/pip --version
pip 9.0.3 from /usr/local/lib/python2.7/site-packages (python 2.7)

我承认我不知道这里发生了什么,或者如何解决它。我害怕,我有点像蟒蛇菜鸟。一些指针会很方便。如何成功运行$ /usr/local/bin/pip install setuptools Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages

顺便说一下,我在使用macOS。

1 个答案:

答案 0 :(得分:1)

执行:

sudo easy_install pip

应该解决这个问题。固定点后你可以继续下载其他包。