I want to find out where the Python package is installed

Asked 2 years ago, Updated 2 years ago, 22 views

I accidentally installed the package in its default location, but I forgot where it was. How do I know the default installation location?

python installation

2022-09-22 14:59

1 Answers

Write python-msite --user-site in the command line Outputs the absolute path.

In the site module, site.getsitepackages() return a list with the global site-package directory as its element.

import site; 
print site.getsitepackages()

Result: ['/System/Library/Frameworks/Python.framework/Version/2.7/Extras/lib/python', '/Library/Python/2.7/site-packages']


2022-09-22 14:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.