How to get my code dependencies on conda env?

I wrote some Python code that I would like to install in order to be easily installed from pip and conda.

The code runs in a conda environment containing all its dependencies.

For both pip and conda, it seems that I need to write a file setup.pywith a variable install_requiresto install dependencies. For pip, I also need require.txt with these dependencies.

conda list --export gives me a way to export the environment with everything, including libraries, cython and ipython:

alabaster=0.7.3=py27_0
babel=1.3=py27_0
backports_abc=0.4=py27_0
cairo=1.12.18=3
cffi=0.9.2=py27_0
cython=0.23.4=py27_0
decorator=4.0.4=py27_0
docutils=0.12=py27_0
flake8=2.3.0=py27_0
fontconfig=2.11.1=3
...

but how can I only get the Python packages my code depends on? Do I have to go through all my imports? In this case, how do I manage dependency dependencies?

+4
source share

Source: https://habr.com/ru/post/1619245/


All Articles