prefix_data#

用于管理环境中安装的包的工具。

#

PrefixDataType

PrefixData 实例对象的基本缓存。

PrefixData

函数#

get_conda_anchor_files_and_records(...)

返回 Python 包的 Conda 记录的锚文件。

python_record_for_prefix(...)

对于给定的 Conda 前缀,返回已安装 Python 的 PrefixRecord

get_python_version_for_prefix(→ str | None)

对于给定的 Conda 前缀,返回已安装 Python 的版本

delete_prefix_from_linked_data(→ bool)

在这里,路径可以是完整的前缀,也可以是前缀内的 dist

class PrefixDataType#

基类: type

PrefixData 实例对象的基本缓存。

__call__(prefix_path: str | os.PathLike | pathlib.Path, pip_interop_enabled: bool | None = None)#

将自身作为函数调用。

class PrefixData(prefix_path: str | os.PathLike[str] | pathlib.Path, pip_interop_enabled: bool | None = None)#
property _prefix_records#
property is_writable#
property _python_pkg_record#

返回包 python 的前缀记录。

_cache_: dict[pathlib.Path, PrefixData]#
__eq__(other: Any) bool#

返回 self==value。

load()#
reload()#
_get_json_fn(prefix_record)#
insert(prefix_record, remove_auth=True)#
remove(package_name)#
get(package_name, default=NULL)#
iter_records()#
iter_records_sorted()#
all_subdir_urls()#
query(package_ref_or_match_spec)#
_load_single_record(prefix_record_json_path)#
_load_site_packages()#

加载前缀的 site-packages 中非 Conda 安装的 Python 包。

非 Conda 处理的 Python 包通过其他方式安装,例如使用 pip 或使用 python setup.py develop 进行本地开发。

找到的非 Conda 处理的包将转换为前缀记录并在内存中处理。

覆盖 Conda 包的包(即 conda-meta 记录)将从内存表示中删除。

_get_environment_state_file()#
_write_environment_state_file(state)#
get_environment_env_vars()#
set_environment_env_vars(env_vars)#
unset_environment_env_vars(env_vars)#
get_conda_anchor_files_and_records(site_packages_short_path, python_records)#

返回 Python 包的 Conda 记录的锚文件。

python_record_for_prefix(prefix) conda.models.records.PrefixRecord | None#

对于给定的 Conda 前缀,返回在该前缀中安装的 Python 的 PrefixRecord。

get_python_version_for_prefix(prefix) str | None#

对于给定的 Conda 前缀,返回在该前缀中安装的 Python 的版本。

delete_prefix_from_linked_data(path: str | os.PathLike | pathlib.Path) bool#

在这里,路径可以是完整的前缀,也可以是前缀内的 dist