I am new in Python. I want to install many 3rd-party libraries (I think they are also called packages?) like, for example, "AstroPy". But I am not sure where the new source code will be stored (I mean, the new ".py" text files that will be downloaded and will contain the Python functions of "AstroPy").

I would like to keep track of all the libraries that I will install. Is there any way to do that for Python?

I used to use IDL and when I want to install a library, I am used to simply download all the text files containing the IDL scripts and then store them in a folder like "/IDL/libraries". That way, I could easily see what I had and also easily uninstall them.

  • Why not use pip, the package manager for Python? It should already be installed along with recent versions of Python, but if not, you can install it as per pip.pypa.io/en/stable/installing – Munir Jan 30 '18 at 23:04

You can find the location of global site-packages (dist-packages that may have been installed via easy_install or pip, a Python package manager) by running:

python -m site

If the package was installed using pip, you can find the location of a specific package (for example, name) by running:

pip show name

Finally, per-user (local) site-packages can be found by running:

python -m site --user-site

You can find slightly more information about dist-packages versus site-packages on the Debian wiki page for Python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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