Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 AgentCool, 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.

    
    
    
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
add comment

1 Answer 1

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
add comment

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