I am absolutely confused due to the number of different ways and the abundance of articles explaining how to create a virtual environment in Anaconda. You could use conda or virtualenvironment to create one. Also depending on how you create it, you need to use either conda or pip to install additional libraries. I tried to read but it only confused me more!

Up until now I haven't created one and install additional packages using pip into the base folder. (I am using Anaconda and Spyder). Can someone please help me with the best practice to create a virtual environment and how to install additional libraries? I use Spyder as my primary IDE.

PS: if you think this is a duplicate question, kindly post a link to the question rather than downvoting, and I'll close or delete this question myself.

  • $\begingroup$ Just for the joke. Do not use Anaconda :D. It is bloated. You can do almost anything with a standard python installation. $\endgroup$ Nov 7 '21 at 20:02
  • $\begingroup$ I know it now but it's too late:P $\endgroup$
    – spectre
    Nov 8 '21 at 11:47

Whenever working in a collaborative environment it's always best to create env using environment.yml.

  • Easily set up additional channels(if required)for downloading relevant packages.
  • Can add all the dependencies which can be downloaded through these channels and also pip dependencies in same file.

Though it takes additional work at start but it helps in debugging later :)


  1. Create an environment file
  2. Creating an environment from an environment.yml file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.