Mac上Python的全局库的位置? [英] Location of global libraries for Python on Mac?

查看:216
本文介绍了Mac上Python的全局库的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与Mac OS X上用于Python的安装SIP进行斗争.最终,在编译和安装后,当我运行SIP的控制台表单文件夹(本地)时,我可以导入sipconfig,但是当我在其他文件夹中时,我不能-没有名为sipconfig的模块.

I'm fighting with installation SIP for Python on Mac OS X. Finally after compilation and installation when I run console form folder of SIP (locally) I can import sipconfig, but when I`m in other folder I cant - there is no module called sipconfig.

我的问题是-如果要将模块全局可用(例如"import os"),或者必须如何将其复制到哪个文件夹中,或者该如何检查它,因为位置为"/Library/Python/2.6/site-packages/"不起作用.

My question is - Where is folder to which I have to copy modules if I want to have them available globally (like "import os"), or how I can check it, because location "/Library/Python/2.6/site-packages/" doesn`t work.

推荐答案

尝试使用以下方法检查您的python的sys.path列表:

Try checking your python's sys.path list with:

import sys
print(sys.path)

这篇关于Mac上Python的全局库的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆