gpt4 book ai didi

python - 属性错误 : 'module' object has no attribute 'python_implementation' running pip

转载 作者:太空狗 更新时间:2023-10-29 18:25:40 25 4
gpt4 key购买 nike

我使用 Python 设置工具安装了 Cygwin。当我尝试运行 pip install awscli 时,出现以下错误:

$ pip install awscli
Traceback (most recent call last):
File "/usr/bin/pip", line 8, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "build/bdist.linux-i686/egg/pkg_resources.py", line 318, in load_entry_point
File "build/bdist.linux-i686/egg/pkg_resources.py", line 2221, in load_entry_point
File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/__init__.py", line 9, in <module>
from pip.log import logger
File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/log.py", line 9, in <module>
from pip._vendor import colorama, pkg_resources
File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/_vendor/pkg_resources.py", line 1112, in <module>
class MarkerEvaluation(object):
File "/usr/lib/python2.5/site-packages/pip-1.5.4-py2.5.egg/pip/_vendor/pkg_resources.py", line 1120, in MarkerEvaluation
'python_implementation': platform.python_implementation,
AttributeError: 'module' object has no attribute 'python_implementation'

我是不是在我的路径中遗漏了一些东西,或者我的 Python 实现是否被破坏了?

最佳答案

您的 Python 应用程序中是否有名为“/platform”的文件夹?

如果这样做,它会影响 native python“平台”模块。当您使用的模块尝试获取有关系统的信息时,它们将返回一个空对象。这通常会导致错误,例如:

AttributeError: 'module' 对象没有属性 'version'

AttributeError: 'module' 对象没有属性 'machine'

AttributeError: 'module' 对象没有属性 'python_implementation'

只需将“/platform”文件夹重命名为其他名称即可解决问题。

关于python - 属性错误 : 'module' object has no attribute 'python_implementation' running pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22438609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com