python模块在哪里存储? [英] Where are the python modules stored?
本文介绍了python模块在哪里存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近开始学习Python,而且我有两个与模块相关的问题。
I have recently started learning Python and I have 2 questions relating to modules.
- 有没有办法获取Python的列表模块可用(即安装)在机器上?
- 我正在使用Ubuntu Karmic和Synaptic进行包管理。我刚刚安装了一个python模块。模块代码实际存储在我的机器上? (存在模块存储的默认[推荐]位置)?
推荐答案
1)有没有办法获得一个
可用的Python模块列表(即安装
)在一个mchine?
1) Is there a way to obtain a list of Python modules available (i.e. installed) on a mchine?
这对我有用:
help('modules')
。
2)模块代码实际上是
存储在我的机器上?
2) Where is the module code actually stored on my machine?
通常在 / lib / site-packages
在你的Python文件夹。 (至少在Windows上)
Usually in /lib/site-packages
in your Python folder. (At least, on Windows.)
您可以使用 sys.path
找出要搜索的目录模块。
You can use sys.path
to find out what directories are searched for modules.
这篇关于python模块在哪里存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文