2013-08-01 201 views
2

我無法安裝pipeasy_install的python軟件包。有一些荒謬的錯誤持續出現。請幫助糾正它。安裝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

可能是一個問題distribute。我建議重新安裝Python。

0

我發現同樣的問題是由於一個instelled egg中出現misfometted entry_points.txt文件引起的。

如果有很多人,可能很難找出哪一個是。

我設法找到那個小BA#@「通過創建和虛擬包運行setup.py D:!

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中,然後查看最後打印的人物。

4
  1. get_entry_map(self, group=None):找到python \ Lib \ sitepackages \ pkg_resources \ __ init__.py。插入後print self.egg_info
  2. 運行python setup.py並看看最後一個打印破碎的包。 記住它,稍後再安裝。刪除損壞的文件夾 包和文件夾broken_package-version.dist-info。再次運行段落,直到錯誤消失。
  3. 刪除段落的更改。
  4. python setup.py install 'broken_package'