2

I'm learning Python, so I don't know too much about this right now. I just finished installing anaconda, but when I enter python word in the command prompt it give me this error:

This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment, please see https://conda.io/activation

When I write on cmd -condo activate base- and try to write Python again, the error disappears, but if I don't do that, it continues showing on cmd when writing the python word. Do I need to do something or is it all right?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • There is an overwhelming amount of duplicates for this particular problem. Start e.g. at *[Python is in a Conda environment, but it has not been activated in a Windows virtual environment](https://stackoverflow.com/questions/56679132/)* to locate the canonical. Can someone find it? Or at least provide some leads or candidates? And/or perhaps vote to close for the many, many duplicates? – Peter Mortensen Oct 26 '21 at 19:42
  • For a long list of a low-scored duplicates, see "Linked" and "Related" on the right-hand side for [this question](https://stackoverflow.com/questions/56623269/). – Peter Mortensen Oct 26 '21 at 19:48
  • I have listed some at [this question](https://stackoverflow.com/questions/69573283/warning-this-python-interpreter-is-in-a-conda-environment-but-the-environment?noredirect=1&lq=1). – Peter Mortensen Oct 26 '21 at 19:51
  • The first mentioned is a high-scored one (+12 and nine answers) - *[Python is in a Conda environment, but it has not been activated in a Windows virtual environment](https://stackoverflow.com/questions/56679132/)* (though it is not necessarily the correct duplicate target). – Peter Mortensen Oct 26 '21 at 19:55

1 Answers1

1

If the Python interpreter is a part of a Conda environment then you do need to activate the conda environment in order to use it and that is OK.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
bhristov
  • 3,137
  • 2
  • 10
  • 26
  • @AndresPelaez no, it won't affect you. Conda with the virtual environements is used in order to be able to support multiple versions of python at the same time. – bhristov Jun 20 '20 at 00:54
  • Thank you so much! I was scared because I think it can affect me in doing something in the future, but I guess it wouldn't! Thank you! –  Jun 20 '20 at 00:57
  • Just one more question, this is what Im doing when I type -conda activate base-? -If you receive this warning, you need to activate your environment. To do so on Windows, run: c:\Anaconda3\Scripts\activate base in Anaconda Prompt.- –  Jun 20 '20 at 00:59
  • @AndresPelaez no problem. If it ever does cause an issue just install the system python. If this answer was helpful to you please consider marking it as the answer to your question. I personally have never had an issue with using conda. – bhristov Jun 20 '20 at 01:00
  • @AndresPelaez I usually use linux, but that looks correct. – bhristov Jun 20 '20 at 01:01
  • It gives you the same error when typing python in the command prompt on your computer? –  Jun 20 '20 at 01:06
  • @AndresPelaez yes, because my python is part of a conda environment. Once I activate the environment everything works ok. – bhristov Jun 20 '20 at 01:09
  • 1
    Activating an environment lets you specify what version of python to us, as well as install packages only available in that environment. If you are a beginner, you're fine always using the same environment. Itll save you from headaches. Switching between environments is something you do when you start distributing or deploying your code and need to ensure all the necessary packages are included. – joelhoro Jun 20 '20 at 03:50