Skip to content

Conda - the environment has not been activated messages #5759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paschott opened this issue May 24, 2019 · 7 comments
Closed

Conda - the environment has not been activated messages #5759

paschott opened this issue May 24, 2019 · 7 comments
Assignees
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@paschott
Copy link

Environment data

  • VS Code version: 1.34.0 (system setup)
  • Extension version (available under the Extensions sidebar): 2019.4.12954
  • OS and version: Windows 10.0.17763 64 bit
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: all

Expected behaviour

Conda environment activates properly when I start a python terminal

Actual behaviour

Starting a Python terminal or running lines of code w/ shift+enter gives me:
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.

Steps to reproduce:

  1. Start a Python terminal

If I exit() that python environment and run "conda activate myenv", it activates as expected. I can then run "python" and all is well.

Python works, but for some reason my environment is not activating as expected. I'd tried by pointing the Python Path to the base python.exe for anaconda as well, but got the same behavior. I followed a suggestion to point directly to this environment, but that didn't seem to change anything.

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.2.86.nupkg... ##########Linting Output - pylint##########
##########Linting Output - pylint##########

--------------------------------------------------------------------

Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)



complete
Unpacking archive... done
[Info  - 8:54:35 AM] GetCurrentSearchPaths D:\Continuum\anaconda3\envs\udemy\python.exe 
[Info  - 8:54:35 AM] Python search paths:
[Info  - 8:54:35 AM]     d:\continuum\anaconda3\envs\udemy\dlls
[Info  - 8:54:35 AM]     d:\continuum\anaconda3\envs\udemy\lib
[Info  - 8:54:35 AM]     d:\continuum\anaconda3\envs\udemy
[Info  - 8:54:35 AM]     d:\continuum\anaconda3\envs\udemy\lib\site-packages
[Info  - 8:54:35 AM] Configuration search paths:
[Info  - 8:54:36 AM] Microsoft Python Language Server version 0.2.86.0
[Info  - 8:54:36 AM] Initializing for D:\Continuum\anaconda3\envs\udemy\python.exe

Console Log

PythonConsole.log

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 24, 2019
@DonJayamanne
Copy link

Duplicate of #5764

@DonJayamanne DonJayamanne marked this as a duplicate of #5764 May 24, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 24, 2019
@paschott
Copy link
Author

This doesn't seem to be a duplicate of the other issue. This gives me a message saying that the environment wasn't activated.

@DonJayamanne
Copy link

Apologies,

@DonJayamanne DonJayamanne reopened this May 24, 2019
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label May 24, 2019
@DonJayamanne
Copy link

Please could you provide screenshots of the commands sent to the terminal along with the errors displayed in the terminal.
Also please note, we don't have great support for older versions of Conda.

@DonJayamanne DonJayamanne self-assigned this May 24, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 24, 2019
@DonJayamanne DonJayamanne added triage-needed Needs assignment to the proper sub-team area-terminal bug Issue identified by VS Code Team member as probable bug labels May 24, 2019
@ghost ghost removed triage-needed Needs assignment to the proper sub-team labels May 24, 2019
@paschott
Copy link
Author

paschott commented May 24, 2019

Here's a screenshot. Python seems to work overall in the terminal, but the warning is odd. And as noted if I "exit()" then do an "activate environment udemy" (my playground for a Udemy course), it seems to work.
Starting REPL or Python debugging:
VSCode Conda Environment

Exit(), Activate:
VS Code Conda Activated

Edit: I could have sworn I had this working without the warning in the prior VSCode release, but am not sure. I'm definitely on the latest Conda - just did an update to all of my bits.

Also verified that "which python" works if I "conda activate base" - the folder changes to my base folder as expected. I get the warning about the environment not being activated.

@DonJayamanne
Copy link

What version of conda are you using?

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label May 29, 2019
@DonJayamanne
Copy link

Closing this issue as its been over 4 weeks, since the information was requested.
We'll be happy to reopen the issue when the requested information has been provided.

@ghost ghost removed the triage label Jun 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants