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

Status bar displays wrong conda environment name #3044

Closed
janosh opened this issue Oct 28, 2018 · 11 comments
Closed

Status bar displays wrong conda environment name #3044

janosh opened this issue Oct 28, 2018 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@janosh
Copy link

janosh commented Oct 28, 2018

VS Code displays wrong environment name in the status bar (see below screenshots). Shows base even though te is currently active.

Probably unrelated but perhaps worth mentioning: pylint marks all local imports as E0401:Unable to import.

Environment data

  • VS Code version: 1.28.2
  • Extension version (available under the Extensions sidebar): 2018.9.1
  • OS and version: macOS 10.14
  • Python version (& distribution if applicable, e.g. Anaconda): python 3.3.6 (64 bit)
  • Type of virtual environment used: (mini-)conda 4.5.11

Actual behavior

screenshot 2018-10-28 at 18 59 50

screenshot 2018-10-28 at 18 59 32

Expected behavior

Status bar shows Python 3.6.6 64-bit ('te': conda).

Steps to reproduce:

Unknown

Logs

Python output

Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.42.0
Initializing for /usr/local/miniconda3/envs/te/bin/python
##########Linting Output - pylint##########
************* Module src.aleatoric_mse
8,0,error,E0401:Unable to import 'meta'
9,0,error,E0401:Unable to import 'nn.layers.mcdropout'
10,0,error,E0611:No name 'generator' in module 'utils'
10,0,error,E0401:Unable to import 'utils.generator'

Output from Console under the Developer Tools panel

Nothing unusual

@DonJayamanne
Copy link

DonJayamanne commented Oct 30, 2018

Please type the following command in your terminal and let me know what you get:
conda info --json

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster feature-interpreter labels Oct 30, 2018
@janosh
Copy link
Author

janosh commented Oct 30, 2018

@DonJayamanne Here you go:

{
  "GID": 20,
  "UID": 501,
  "active_prefix": "/usr/local/miniconda3/envs/te",
  "active_prefix_name": "te",
  "channels": [
    "https://conda.anaconda.org/conda-forge/osx-64",
    "https://conda.anaconda.org/conda-forge/noarch",
    "https://repo.anaconda.com/pkgs/main/osx-64",
    "https://repo.anaconda.com/pkgs/main/noarch",
    "https://repo.anaconda.com/pkgs/free/osx-64",
    "https://repo.anaconda.com/pkgs/free/noarch",
    "https://repo.anaconda.com/pkgs/r/osx-64",
    "https://repo.anaconda.com/pkgs/r/noarch",
    "https://repo.anaconda.com/pkgs/pro/osx-64",
    "https://repo.anaconda.com/pkgs/pro/noarch"
  ],
  "conda_build_version": "not installed",
  "conda_env_version": "4.5.11",
  "conda_location": "/usr/local/miniconda3/lib/python3.6/site-packages/conda",
  "conda_prefix": "/usr/local/miniconda3",
  "conda_private": false,
  "conda_shlvl": 1,
  "conda_version": "4.5.11",
  "config_files": [
    "/Users/Janosh/.condarc"
  ],
  "default_prefix": "/usr/local/miniconda3/envs/te",
  "env_vars": {
    "CIO_TEST": "<not set>",
    "CONDA_DEFAULT_ENV": "te",
    "CONDA_EXE": "/usr/local/miniconda3/bin/conda",
    "CONDA_PREFIX": "/usr/local/miniconda3/envs/te",
    "CONDA_PROMPT_MODIFIER": "(te) ",
    "CONDA_PYTHON_EXE": "/usr/local/miniconda3/bin/python",
    "CONDA_ROOT": "/usr/local/miniconda3",
    "CONDA_SHLVL": "1",
    "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/miniconda3/envs/te/bin:/Users/Janosh/.nvm/versions/node/v10.11.0/bin",
    "REQUESTS_CA_BUNDLE": "<not set>",
    "SSL_CERT_FILE": "<not set>"
  },
  "envs": [
    "/usr/local/miniconda3",
    "/usr/local/miniconda3/envs/te"
  ],
  "envs_dirs": [
    "/usr/local/miniconda3/envs",
    "/Users/Janosh/.conda/envs"
  ],
  "netrc_file": null,
  "offline": false,
  "pkgs_dirs": [
    "/usr/local/miniconda3/pkgs",
    "/Users/Janosh/.conda/pkgs"
  ],
  "platform": "osx-64",
  "python_version": "3.6.6.final.0",
  "rc_path": "/Users/Janosh/.condarc",
  "requests_version": "2.20.0",
  "root_prefix": "/usr/local/miniconda3",
  "root_writable": true,
  "site_dirs": [],
  "sys.executable": "/usr/local/miniconda3/bin/python",
  "sys.prefix": "/usr/local/miniconda3",
  "sys.version": "3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:55:02) \n[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]",
  "sys_rc_path": "/usr/local/miniconda3/.condarc",
  "user_agent": "conda/4.5.11 requests/2.20.0 CPython/3.6.6 Darwin/18.0.0 OSX/10.14",
  "user_rc_path": "/Users/Janosh/.condarc"
}

@DonJayamanne
Copy link

DonJayamanne commented Oct 30, 2018

Thanks, this could be a flaw in the way we detect the base environment.

  • How did you manage to set te as your default Environment?
    "default_prefix": "/usr/local/miniconda3/envs/te",

  • Please could you type the following into the command window and let me know what you get:
    conda env list

@janosh
Copy link
Author

janosh commented Oct 30, 2018

Regarding your first question, I added conda activate te to my .zshrc.

conda env list outputs

# conda environments:
base                 /usr/local/miniconda3
te                 * /usr/local/miniconda3/envs/te

@DonJayamanne DonJayamanne added needs verification and removed info-needed Issue requires more information from poster labels Oct 30, 2018
@DonJayamanne
Copy link

DonJayamanne commented Oct 30, 2018

  • Please could you place your cursor over the Python interpreter info on the status bar and let me know what the tooltip reads?
    Thanks

  • Are you using a multi-root workspacec?

  • Please could you send me a screenshot of your VS code (entire VS Code screen) along with the explorer view. (no files need to be opened), just ensure the Explorer view is opened.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels Oct 30, 2018
@janosh
Copy link
Author

janosh commented Oct 30, 2018

The tooltip says /usr/local/miniconda3/envs/te/bin/python.

Nope, single-root workspace.

screenshot 2018-10-30 at 22 11 53

@DonJayamanne
Copy link

@janosh
Please could you install the latest version of the extension and confirm this is still and issue.
Thanks

@janosh
Copy link
Author

janosh commented Nov 13, 2018

@DonJayamanne I'm running v1.29.0 and the status bar still displays 'base': conda as active environment which in my case should read 'te': conda (the active env according to terminal).

@DonJayamanne
Copy link

Unfortunately I'm still unable to replicate this at my end, hopefully this will get fixed with #3406

@janosh
Copy link
Author

janosh commented Dec 11, 2018

Interestingly, I just once again tried selecting another env and going back to the original one and now it's displaying correctly. No idea why it behaved differently this time around but it appears as though the problem is fixed.

@DonJayamanne
Copy link

Closing in favor of #3406

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2019
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