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

查看:43
本文介绍了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天全站免登陆