Can conda install source distributions?

后端 未结 2 931
长发绾君心
长发绾君心 2021-02-19 14:26

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

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-19 15:04

    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

提交回复
热议问题