我正在用 Python 开发一个项目,我想包含一些自己的模块,这些模块不在常规 Python 搜索路径中,我想添加它们.但是,我只想为我在开发期间使用的 Anaconda 环境执行此操作,并且我希望它们随着时间的推移保持在那里(即,当我重新启动环境时,我希望搜索路径具有该文件夹).
I am developing a project in Python and I want to include some own modules which are not on the regular Python search path and I want to add them. However, I want to do this just for the Anaconda environment I am using during development and I would like them to remain there over time(i.e. when I restart the environment, I want the search path to have that folder).
谢谢!
可以用
conda develop <directory>
这会将 conda.pth 文件写入环境的 site-packages 目录,这将导致您的目录添加到 sys.path.
This will write a conda.pth file to the environment's site-packages directory which will cause your directory to be added to the sys.path.
这篇关于如何将文件夹添加到给定 Anaconda 环境的搜索路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 python 解析非常大的 xml 文件时出现问题Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件时出现问题)
使用 Python 2 在 XML 中按属性查找所有节点Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按属性查找所有节点)
Python - 如何解析 xml 响应并将元素值存储在变量中Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 响应并将元素值存储在变量中?)
如何在 Python 中获取 XML 标记值How to get XML tag value in Python(如何在 Python 中获取 XML 标记值)
如何使用 ElementTree 正确解析 utf-8 xml?How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正确解析 utf-8 xml?)
将 XML 从 URL 解析为 python 对象Parse XML from URL into python object(将 XML 从 URL 解析为 python 对象)