Skip to content
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

Python: integrated terminal is unable to recognise anaconda python interpreter specified #10857

Closed
qy-yang opened this issue Mar 30, 2020 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@qy-yang
Copy link

qy-yang commented Mar 30, 2020

Environment data

VS Code version: Version: 1.43.2
Extension version (available under the Extensions sidebar): 2020.3.69010
OS and version: macOS 10.15.3
Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.4 :: Anaconda (64-bit)
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda

Expected behaviour

The vscode integrated terminal is able to run conda environment's python and packages

Actual behaviour

The conda environment shows to have been activated in the terminal. But when type
`python
to enter python shell, it shows the system python instead of anaconda's python. And it shows 'ModuleNotFoundError: No module named 'pandas' when I tried to import pandas.

In addition, when check the python location using
`which python
it points to system python.

The python interpreter at vscode bottom, the configuration in .vscode/settings.json is pointed to conda though.

The anaconda behaves normally in mac's terminal. I was unable to fix this by uninstall vscode as mention in issue #4597.

@qy-yang qy-yang added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Mar 30, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Mar 31, 2020
@karrtikr
Copy link

karrtikr commented Apr 1, 2020

This might be that when run in VS Code it is not running in a activated environment. Can you try this?

  1. Anaconda prompt and cd to your workspace.
  2. Activate the environment using conda activate
  3. Start VS Code using code .

related #10626

If that doesn't work, this issue looks like a dup of #6343. Quoting the workaround,

As a temporary solution please change the setting terminal.integrated.inheritEnv to false as outlined in https://code.visualstudio.com/updates/v1_36#_launch-terminals-with-clean-environments.

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Apr 1, 2020
@karrtikr
Copy link

Closing as no further info was provided.

@ghost ghost removed the triage label Apr 25, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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

3 participants