11

So I decided to install python packages (technically Django apps) directly from the downloaded tar file, by extracting it and using the following command:

python setup.py install

However, inside my site-packages directory, I find that the package was installed inside a .egg directory that also has version numbers. The directories look annoyingly like this:

site-packages/django_cms-2.1.3-py2.7.egg/cms
site-packages/django_cms-2.1.3-py2.7.egg/mptt

I need the packages to install as a directory with the package name with no .egg or version number, otherwise, Django can't find the package. It should be like this:

site-packages/cms
site-packages/mptt

Attempting to install the same package from pip, and it works fine. This is frustrating, so some help would be appreciated.

I tracked down a thread that discusses something similar, but it didn't give a solution that worked.

The Django project is unable to locate the packages I installed because the packages aren't installed at the root of site-packages dir. Instead, it resides inside the .egg directories. What I had to do is manually move the package to the root, but how do you correctly install python packages?

Also, I didn't suppress the easy-install.pth file, but it isn't picked up by PyDev.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
GoogleDroid
  • 185
  • 1
  • 6
  • You haven't explained what didn't work how. – Ignacio Vazquez-Abrams Jun 28 '11 at 17:42
  • 1
    Exactly. It doesn't matter what the folder is named. If I had to guess, you're probably talking about not being able to load templates, in which case you just need to add the egg loader to your template loaders list. – Chris Pratt Jun 28 '11 at 18:39
  • 3
    A package doesn't need to be in `site-packages/` if there's a `.pth` file that points to it. Did you suppress generation of the `.pth` file? – Ignacio Vazquez-Abrams Jun 28 '11 at 23:00
  • Sorry, I didn't know that was the problem until you pointed out the .pth file as I realized that it was occasionally running fine in a shell. However, I noticed that not all of the packages actually install itself into the .pth file either. Now is there a solution to this beyond just manually moving the package within the virtualenv? – GoogleDroid Jun 28 '11 at 23:30
  • And now virtualenv is in the mix. This stuff is important... – Ignacio Vazquez-Abrams Jun 28 '11 at 23:32

0 Answers0