Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Ubuntu 12.10. What is the advised directory to put a downloaded python library? Should I be concerned about confusing apt?

share|improve this question

closed as off topic by Raja, hhlp, Jorge Castro, Vojtech Trefny, Eric Carvalho Feb 28 '13 at 0:23

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.… – Raja Feb 27 '13 at 18:01
A python module is pretty much just a simple file. Why would that confuse apt (even if you place it in say /bin)? Apt only cares with package descriptors, and anything else is pretty much ignored by it. So as long as you don't overwrite anything you're good. – Wolfer Feb 27 '13 at 18:58
up vote 1 down vote accepted

If you are the only user on the machine that needs access to this Python module then avoid placing it anywhere outside your home directory. You can place it pretty much anywhere under your home directory and add that directory to your PYTHONPATH environment variable. For example, you may place it under ~/Projects/MySoftwareProject/Packages/ and then add this directory to PYTHONPATH whenever you work on that project. A more convenient method of doing this is to use virtualenv to create isolated Python environment for different projects.

If you need to install this Python module system wide (so that multiple users may be able to use it) look for it in the standard package repository first. If you cannot find it there then look for a PPA for it; maybe the developer of this module has created one. If you cannot find one, you may want to create one (it will help others). Installing it manually ought to be the last resort. :D

Having said that, if you absolutely do need to install it manually, a good place to install packages locally is /usr/local. So, for example, this module may be placed under /usr/local/lib/python2.7/site-packages.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.