Can conda install source distributions?

跟風遠走 提交于 2020-03-18 11:24:06

问题


Can conda install be used to install source-distributions (i.e. non-archived import packages that have a setup.py)?


回答1:


Yes and no. You can not conda install per se. However, as the Conda documentation says, Conda ships with pip, so you should be able to pip install -e . your package. You can also install with traditional python setup.py [install|develop].

Remember to activate your Conda environment before installation if you're using one instead of site packages.




回答2:


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.

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 build meta.yaml

Afterwards, you will have a local tar.gz of the build package with meta-data that conda can understand. This is what you download from the internet whenever you install a package using conda.

Finally, you can install the package you built locally using:

$ conda install --use-local



来源:https://stackoverflow.com/questions/40756482/can-conda-install-source-distributions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!