在mac下查找python包存放路径site-packages的实现方法

yipeiwu_com5年前Python基础

想查找mac下python的site-packages目录,如果用网上搜的安装目录之类的去找,进去每一层很多都是软链接形式存在,比较浪费时间;

比较快捷的方法如下:

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(sys.path)

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

>>> 

以上这篇在mac下查找python包存放路径site-packages的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

python读写Excel表格的实例代码(简单实用)

python读写Excel表格的实例代码(简单实用)

安装两个库:pip install xlrd、pip install xlwt 1.python读excel——xlrd 2.python写excel——xlwt 1.读excel数据,...

Python安装第三方库及常见问题处理方法汇总

源码安装 Python第三方库几乎都可以在github或者 pypi上找到源码。源码包格式大概有zip 、 tar.zip、 tar.bz2。解压这些包,进入解压好的文件夹,通常会有一个...

python开发之thread实现布朗运动的方法

python开发之thread实现布朗运动的方法

本文实例讲述了python开发之thread实现布朗运动的方法。分享给大家供大家参考,具体如下: 这里我将给大家介绍有关python中thread来实现布朗运动的一个例子 下面是运行效果...

用smtplib和email封装python发送邮件模块类分享

复制代码 代码如下:#!/usr/bin/python# encoding=utf-8# Filename: send_email.pyfrom email.mime.image imp...

python程序快速缩进多行代码方法总结

python程序快速缩进多行代码方法总结

该语言中缩进是其精髓,通过缩进可以表示函数、循环等程序结构的范围。有时写完程序后,发现所有程序需要放入函数def中,这时就需要对一整块程序同时进行缩进,还有其他一些情况,也会需要多行整体...