[英]Can conda install source distributions?
可以使用conda install
来安装源代码分发(即具有setup.py
非归档导入包)吗?
Yes and no. 是的,不是。 You can not conda install
per se. 你不能conda install
本身。 However, as the Conda documentation says, Conda ships with pip, so you should be able to pip install -e .
但是,正如Conda文档所说,Conda附带了pip,所以你应该可以pip install -e .
your package. 你的包裹。 You can also install with traditional python setup.py [install|develop]
. 您也可以使用传统的python setup.py [install|develop]
。
Remember to activate your Conda environment before installation if you're using one instead of site packages. 如果您使用的是一个而不是站点包,请记住在安装之前激活您的Conda环境。
As mentioned by vaiski , you can use pip
and/or setup.py
to build and install the package, but this method is not ideal because packages installed with pip
and conda
do not respect each other's dependencies. 正如提到vaiski ,您可以使用pip
和/或setup.py
来编译和安装包,但因为安装的软件包这种方法是不理想的pip
和conda
不尊重对方的依赖。
Thus, if the source distribution includes a conda
build recipe ( meta.yaml
), then you can created the anaconda
archive on your own machine by using the conda-build
tool: 因此,如果源分布包括conda
构建配方( meta.yaml
),那么你就可以创建的anaconda
使用自己的机器上存档conda-build
工具:
$ conda build meta.yaml
Afterwards, you will have a local tar.gz
of the build package with meta-data that conda
can understand. 之后,您将拥有构建包的本地tar.gz
,其中包含conda
可以理解的元数据。 This is what you download from the internet whenever you install a package using conda
. 这是您使用conda
安装软件包时从Internet下载的内容。
Finally, you can install the package you built locally using: 最后,您可以使用以下命令安装本地构建的软件包:
$ conda install --use-local
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.