Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python is in a Conda environment, but it has not been activated in a Windows virtual environment

I created a Windows (10) Python virtual environment (env3.7.3). When I open a cmd window activated in the virtual environment, I get the following warning message when starting Python in the virtual environment:

(env3.7.3) C:\Users\redex\OneDrive\Documents\Education\Machine Learning-Ng Python\Exercise7>python
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
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

This warning has been posted before in a different context, but it did not address my question. This warning appears only in the Python virtual environment, not the base Conda environment. This seems like a Windows or Anaconda environment variable issue, but I don't know enough to know! Anaconda was recently upgraded and it seemed fine before, so there may be a bug or setting issue.

like image 590
Bill Avatar asked Jun 20 '19 04:06

Bill


People also ask

How do I know if my virtual environment is activated conda?

When a conda environment is activated, it will export following related environment variables: $CONDA_DEFAULT_ENV , name of current activated env. $CONDA_PREFIX , path to the current activate env.


1 Answers

Where myenv is "your env name",

Try this:

conda activate myenv

conda install pip

This should solve the issue.

like image 157
Rakesh Bhugra Avatar answered Oct 28 '22 06:10

Rakesh Bhugra