SoFunction
Updated on 2024-11-21

How to find python package storage path site-packages on mac.

I'm trying to find the site-packages directory for python on a mac, and if I use the install directory or something like that from an online search to find it, it's a waste of time to go in and have a lot of soft links at each level;

The quicker way is as follows:

MacBook-Pro-6:Scrapy-1.5.0 haizhi$ python

Python 2.7.10 (default, Jul 30 2016, 18:31:42) 

[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import sys

>>> print()

['', '/System/Library/Frameworks//Versions/2.7/lib/', '/System/Library/Frameworks//Versions/2.7/lib/python2.7', '/System/Library/Frameworks//Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks//Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks//Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks//Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks//Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks//Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks//Versions/2.7/Extras/lib/python', '/System/Library/Frameworks//Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages/Scrapy-1.5.0-py2.']

>>> 

Above this under the mac to find python package storage path site-packages implementation method is all I share with you, I hope to give you a reference, but also hope that you support me more.