Mr.Robot
Mr.Robot

Reputation: 349

Create virtual environment with all packages shown in `conda list`

Problem

I am trying to create a virtual environment for my deep learning project. However, after I created and activated the environment called venv using the following commands

conda create -n venv anaconda
conda activate venv

I found that many of the deep learning packages were not shipped with this virtual environment (the left panel is conda list outside the virtual env while the right panel is the one inside).

I noticed that packages not imported has "channel" property called conda-forge or pytorch

Therefore, I am wondering how could I create an virtual environment that copies all packages rather than that only have native packages. Thank you in advance! enter image description here

Upvotes: 0

Views: 1178

Answers (1)

Derek Eden
Derek Eden

Reputation: 4638

why dont you export the results of conda list into a text file, then make a new venv using this text file:

conda list --export > requirements.txt
conda create -n new --file requirements.txt

I think you can also do this, but haven't tested:

conda create -n new --clone base

Upvotes: 2

Related Questions