[Django]-Errors while installing python packages

8👍

  1. Find get_entry_map(self, group=None): into python\Lib\sitepackages\pkg_resources\__init__.py. Insert after print self.egg_info
  2. Run python setup.py and look to the last printed – broken package.
    Remember it, later to install again. Delete the folder of broken
    package and folder broken_package-version.dist-info. Run again paragraph 2, until the error disappears.
  3. Remove changes from paragraph 1.
  4. python setup.py install 'broken_package'

1👍

This error happened to me installing any package. My solution was going to my file explorer, typing in the path bar %appdata%, going to the Python folder, and deleting everything inside.

0👍

I found the same problem to be caused by a misfometted entry_points.txt file in one instelled egg of mine.

It can be quite hard to track down which one is if there are many.

I managed to find that little ba#@!”d by creating and run setup.py for a dummy package:

setup.py

from setuptools import setup, find_packages
setup(
    name = "IWillFindYou",
    version = "0.1",
    packages = find_packages()
)

run this in debug mode would point to this line in pkg_resources.py

    def parse_map(cls, data, dist=None):
        [...]
            raise ValueError("Entry points must be listed in groups")

if you go back to the stack trace, you will see that parse_map is called here:

def get_entry_map(self, group=None):
    [...]
        ep_map = self._ep_map = EntryPoint.parse_map(
            self._get_metadata('entry_points.txt'), self
        )

evaluating self.egg_info will point up your evil egg so you can give a look to the entry_points.txt file.

If you are not handy with debugger, you may try to place print self.egg_info in get_entry_map and look to the last guy printed.

👤FxIII

0👍

My Resolution Approach

Platform: windows 10, ConEmu-Maximus5

  • Delete virtual environment automatically created by poetry install command.

    windows users can find the virtual environment folder in the path below

    C:\Users\YOUR_PC_USERNAME\AppData\Local\pypoetry\Cache\virtualenvs

    (don’t know of linux path)

  • close terminal / command prompt

  • open terminal / command prompt and navigate to project folder

  • re run poetry install

I hope it helps…

How i encountered the error

It was my first time using poetry, while running poetry install, the process got interrupted. running the command again popped out the error.

-1👍

Could be a problem with distribute. I’d recommend re-installing Python.

Leave a comment