Python Anaconda 站点包

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31003994/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 09:18:50  来源:igfitidea点击:

Anaconda site-packages

pythonpython-2.7pipanaconda

提问by Nyxynyx

After installing a package in an anaconda environment, I'll like to make some changes to the code in that package.

在 anaconda 环境中安装软件包后,我想对该软件包中的代码进行一些更改。

Where can I find the site-packagesdirectory containing the installed packages? I do not find a directory /Users/username/anaconda/lib/python2.7/site-packages

在哪里可以找到site-packages包含已安装软件包的目录?我没有找到目录/Users/username/anaconda/lib/python2.7/site-packages

采纳答案by Arcturus B

You can import the module and check the module.__file__string. It contains the path to the associated source file.

您可以导入模块并检查module.__file__字符串。它包含相关源文件的路径。

Alternatively, you can read the Filetag in the the module documentation, which can be accessed using help(module), or module?in IPython.

或者,您可以阅读File模块文档中的标签,该文档可以使用help(module)module?IPython访问。

回答by jeff_carter

You could also type 'conda list' in a command line. This will print out the installed modules with the version numbers. The path within your file structure will be printed at the top of this list.

您还可以在命令行中键入“conda list”。这将打印出带有版本号的已安装模块。文件结构中的路径将打印在此列表的顶部。

回答by Steve

Linux users can find the locations of all the installed packages like this:

Linux 用户可以像这样找到所有已安装软件包的位置:

pip list | xargs -exec pip show

回答by Vlad Costin

Run this inside python shell:

在 python shell 中运行它:

from distutils.sysconfig import get_python_lib
print(get_python_lib())

回答by Hezi Zhang

I installed miniconda and found all the installed packages in /miniconda3/pkgs

我安装了 miniconda 并在其中找到了所有已安装的软件包 /miniconda3/pkgs

回答by dani bilel

You should find installed packages in :

您应该在以下位置找到已安装的软件包:

anaconda's directory / lib / site_packages

anaconda's directory / lib / site_packages

That's where i found mine.

那是我找到我的地方。