Reputation: 81
I hava a conda environment called test and a requirements file-requirements.txt.
What i need to achieve is that i need to check the versions of different packages against those in requirements.txt and display which are upto date and which are not.
I need to write a python script for the task. For eg: if requirements.txt has django==2.0.6, i have to check against the installed version of django in the test environment and display accordingly.
The steps that i thought are :
How to activate the environment inside a python script using "conda activate test" and run the command "conda list"?
Upvotes: 1
Views: 4067
Reputation: 20599
conda list
accepts the argument -n
to specify an environment like this:
conda list -n test
so no need to activate the conda env
Upvotes: 2