0

I have, in /usr/local/lib/python2.7/site-packages multiple versions of the same package.

E.g. I have django-angular-0.7.13-py2.6.egg, django-angular-0.7.13-py2.6.egg-info, and django-angular-0.7.13-py2.7.egg.

Is it safe to delete the two files that are, ostensibly, the wrong version?

When I got into the python interpreter, import the package/module, it tells me it's run from <module 'django_angular' from '/usr/local/lib/python2.7/site-packages/django-angular-0.7.13-py2.6.egg/django_angular/__init__.py'>...

I'm concern I'll irreparably damage my python packages, as is so easy when you mess with these things.

All I could find on the topic is this article, but that's windows specific, and doesn't address having multiple versions of the same thing.

AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173

1 Answers1

1

You shouldn't go and delete the files manually, although it is probably safe. It is quite unlikely that your system depends on Django and Python always uses only one version of the installed packages anyway.

However, I would strongly recommend keeping your development environment separated from your system packages. If you haven't already, take a look at pip and virtualenv. Here is one tutorial for them.

With pip you can also uninstall your system libraries if you really want to do that. However, pip only sees one version at a time, so if you want to uninstall the above packages you have to run pip uninstall multiple times. But after all the versions are gone you can install the version you really want.

Also, a better option for displaying the installed versions is to use yolk. With that you don't have to browse the site-packages manually.

jasaarim
  • 1,806
  • 15
  • 19
  • So the recommendation is to use pip to uninstall of them, then re-install the right one? – AncientSwordRage May 07 '15 at 15:56
  • yes, that's my recommendation. If you run into trouble in uninstalling, see http://stackoverflow.com/questions/1550226/python-setup-py-uninstall. But at least, use pip to install the version you need. – jasaarim May 07 '15 at 16:05
  • I've used pip to install and re-install, and now my server terminal log is printing out things like `NP_INITIALIZATION SUCCEEDED` and the imports still aren't working.....But what you said worked, so have a green tick. – AncientSwordRage May 07 '15 at 16:14