简体   繁体   English

conda可以安装源代码分发吗?

[英]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来编译和安装包,但因为安装的软件包这种方法是不理想的pipconda不尊重对方的依赖。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM