我无法从pip
和easy_install
安装python包。有一些荒谬的错误不断涌现。请帮助纠正它。
使用python setup.py install
时出现相同的错误。
安装 django-memcached
时出错C:\Users\Praful\Desktop\django-redis-master>easy_install django-memcached
Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 9, in <module>
load_entry_point('distribute==0.6.27', 'console_scripts', 'easy_install')()
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\com
mand\easy_install.py", line 1915, in main
with_ei_usage(lambda:
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\com
mand\easy_install.py", line 1896, in with_ei_usage
return f()
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\com
mand\easy_install.py", line 1919, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "C:\Python27\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\dis
t.py", line 222, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\pkg_resources.
py", line 486, in iter_entry_points
entries = dist.get_entry_map(group)
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\pkg_resources.
py", line 2315, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\pkg_resources.
py", line 2101, in parse_map
raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
安装 python-memcache
时出错C:\Users\Praful\Desktop\mem>python setup.py install
Traceback (most recent call last):
File "setup.py", line 24, in <module>
"Topic :: Software Development :: Libraries :: Python Modules",
File "C:\Python27\lib\distutils\core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\setuptools\dis
t.py", line 222, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\pkg_resources.
py", line 486, in iter_entry_points
entries = dist.get_entry_map(group)
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\pkg_resources.
py", line 2315, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "C:\Python27\lib\site-packages\distribute-0.6.27-py2.7.egg\pkg_resources.
py", line 2101, in parse_map
raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
答案 0 :(得分:4)
get_entry_map(self, group=None):
。在print self.egg_info
python setup.py
并查看最后打印的包装。
记住它,稍后再安装。删除损坏的文件夹
包和文件夹broken_package-version.dist-info
。再次运行段落 2 ,直到错误消失。python setup.py install 'broken_package'
答案 1 :(得分:0)
可能是distribute
的问题。我建议重新安装Python。
答案 2 :(得分:0)
我发现同样的问题是由于我的一个鸡蛋中的一个错误的entry_points.txt文件引起的。
如果有很多,可能很难找到哪一个。
我设法通过为虚拟包创建并运行setup.py来找到小ba#@!“
<强> setup.py 强>
from setuptools import setup, find_packages
setup(
name = "IWillFindYou",
version = "0.1",
packages = find_packages()
)
在调试模式下运行它会指向pkg_resources.py
中的这一行 def parse_map(cls, data, dist=None):
[...]
raise ValueError("Entry points must be listed in groups")
如果你回到堆栈跟踪,你会看到在这里调用parse_map:
def get_entry_map(self, group=None):
[...]
ep_map = self._ep_map = EntryPoint.parse_map(
self._get_metadata('entry_points.txt'), self
)
评估self.egg_info
会指出你的邪恶蛋,这样你就可以查看entry_points.txt文件了。
如果您对调试器不方便,可以尝试将print self.egg_info
放在get_entry_map
中,并查看最后一个打印的人。
答案 3 :(得分:0)
平台:Windows 10,ConEmu-Maximus5
通过poetry install
命令自动创建的虚拟环境。
Windows用户可以在下面的路径中找到虚拟环境文件夹
C:\ Users \ YOUR_PC_USERNAME \ AppData \ Local \ pypoetry \ Cache \ virtualenvs
(不知道linux路径)
关闭终端/命令提示符
打开终端/命令提示符并导航到项目文件夹
重新运行poetry install
我希望它能对您有所帮助...
这是我第一次使用诗歌,在运行poetry install
时,该过程被中断了。再次运行命令会弹出错误。
答案 4 :(得分:0)
此错误发生在我安装任何软件包时。我的解决方案是转到文件浏览器,在路径栏中输入%appdata%
,转到Python
文件夹,然后删除其中的所有内容。