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 Terminal is not finding conda env, even so interpreter is found #711

Closed
michaelaye opened this issue Feb 5, 2018 · 5 comments
Closed
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug

Comments

@michaelaye
Copy link

Environment data

VS Code version: 1.19.3
Python Extension version: 2018.1.0
Python Version: 3.6.4 (conda-forge, conda 4.4.8)
OS and version: macOS 10.12.6

Actual behavior

Command-Palette: Python: Create Terminal
Opens terminal, it is trying to activate conda env using "source activate stable", according to my activated Conda env, but it errors:

source activate stable

┌─( ~/D/s/planetpy λ:master | ✱ ◼ 3ebce8e )────────────────────────────────────────────────────────────────────( @MacL2938 )─┐
└─❱❱❱ source activate stable                                                                                   +7509 13:55 ❰─┘
source: no such file or directory: activate

Expected behavior

Terminal opens with activate conda environment

Steps to reproduce:

  • Manually choose Python interpreter to be a conda env, with conda 4.4.x

Logs

Output from Python output panel

no related output

Note, that pylint is being found, but maybe the package is directly going to the bin path without required path settings via the conda script to work?
Also note, that since conda 4.4.x the default command to activate an env has changed to conda activate <env_name>, even so the developers announced that the previous command should still work.

Output from Console window (Help->Developer Tools menu)
screenshot 2018-02-05 14 13 19

@DonJayamanne
Copy link

DonJayamanne commented Feb 5, 2018

  • What is the value of the setting python.pythonPath in your workspace settings file (.vscode/settings.json)?

Please type the following commands separately in your terminal widow (outside vscode) and let me know what you get:

  • conda info --json
  • conda env list

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster area-terminal labels Feb 6, 2018
@michaelaye
Copy link
Author

  • pythonPath:
(stable) └─❱❱❱ grep pythonPath settings.json                                           +9153 17:45 ❰─┘
    "python.pythonPath": "/Users/klay6683/miniconda3/envs/stable/bin/python",
  • conda info --json
{
  "GID": 2260,
  "UID": 273771,
  "active_prefix": "/Users/klay6683/miniconda3/envs/stable",
  "active_prefix_name": "stable",
  "channels": [
    "https://conda.anaconda.org/conda-canary/osx-64",
    "https://conda.anaconda.org/conda-canary/noarch",
    "https://conda.anaconda.org/conda-forge/osx-64",
    "https://conda.anaconda.org/conda-forge/noarch",
    "https://repo.continuum.io/pkgs/main/osx-64",
    "https://repo.continuum.io/pkgs/main/noarch",
    "https://repo.continuum.io/pkgs/free/osx-64",
    "https://repo.continuum.io/pkgs/free/noarch",
    "https://repo.continuum.io/pkgs/r/osx-64",
    "https://repo.continuum.io/pkgs/r/noarch",
    "https://repo.continuum.io/pkgs/pro/osx-64",
    "https://repo.continuum.io/pkgs/pro/noarch",
    "https://conda.anaconda.org/NSIDC/osx-64",
    "https://conda.anaconda.org/NSIDC/noarch"
  ],
  "conda_build_version": "not installed",
  "conda_env_version": "4.4.8",
  "conda_location": "/Users/klay6683/miniconda3/lib/python3.6/site-packages/conda",
  "conda_prefix": "/Users/klay6683/miniconda3",
  "conda_private": false,
  "conda_shlvl": 1,
  "conda_version": "4.4.8",
  "config_files": [
    "/Users/klay6683/miniconda3/.condarc",
    "/Users/klay6683/.condarc"
  ],
  "default_prefix": "/Users/klay6683/miniconda3/envs/stable",
  "env_vars": {
    "CIO_TEST": "<not set>",
    "CONDA_DEFAULT_ENV": "stable",
    "CONDA_PREFIX": "/Users/klay6683/miniconda3/envs/stable",
    "CONDA_PROMPT_MODIFIER": "(stable) ",
    "CONDA_PYTHON_EXE": "/Users/klay6683/miniconda3/bin/python",
    "CONDA_ROOT": "/Users/klay6683/miniconda3",
    "CONDA_SHLVL": "1",
    "PATH": "/Users/klay6683/miniconda3/envs/stable/bin:/Users/klay6683/.jenv/shims:/usr/local/bin:/usr/local/sbin:/Users/klay6683/bin:/Users/klay6683/Dropbox/src/SpiceyPy/cspice/exe:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin",
    "REQUESTS_CA_BUNDLE": "<not set>",
    "SSL_CERT_FILE": "<not set>",
    "SUDO_PS1": "\\[\\e[31;1;46m\\][\\u] \\w $\\[\\e[0m\\] "
  },
  "envs": [
    "/Users/klay6683/miniconda3",
    "/Users/klay6683/miniconda3/envs/geopandas",
    "/Users/klay6683/miniconda3/envs/py2",
    "/Users/klay6683/miniconda3/envs/stable"
  ],
  "envs_dirs": [
    "/Users/klay6683/miniconda3/envs",
    "/Users/klay6683/.conda/envs"
  ],
  "netrc_file": null,
  "offline": false,
  "pkgs_dirs": [
    "/Users/klay6683/miniconda3/pkgs",
    "/Users/klay6683/.conda/pkgs"
  ],
  "platform": "osx-64",
  "python_version": "3.6.3.final.0",
  "rc_path": "/Users/klay6683/.condarc",
  "requests_version": "2.18.4",
  "root_prefix": "/Users/klay6683/miniconda3",
  "root_writable": true,
  "site_dirs": [
    "~/.local/lib/python3.4",
    "~/.local/lib/python3.5"
  ],
  "sys.executable": "/Users/klay6683/miniconda3/bin/python",
  "sys.prefix": "/Users/klay6683/miniconda3",
  "sys.version": "3.6.3 |Anaconda, Inc.| (default, Dec  5 2017, 17:30:25) \n[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]",
  "sys_rc_path": "/Users/klay6683/miniconda3/.condarc",
  "user_agent": "conda/4.4.8 requests/2.18.4 CPython/3.6.3 Darwin/16.7.0 OSX/10.12.6",
  "user_rc_path": "/Users/klay6683/.condarc"
}
  • conda env list
(stable) └─❱❱❱ conda env list                                                          +9150 17:43 ❰─┘
# conda environments:
#
base                     /Users/klay6683/miniconda3
geopandas                /Users/klay6683/miniconda3/envs/geopandas
py2                      /Users/klay6683/miniconda3/envs/py2
stable                *  /Users/klay6683/miniconda3/envs/stable

@DonJayamanne
Copy link

DonJayamanne commented Feb 6, 2018

Please could you try the following:

  • Go into the command palette Python: Select Interpreter
  • Check whether the environment stable is listed in the above list of interpreters (please take a screen shot)
  • Delete all existing terminals, click the command Python: Create Terminal, let me know what you get in there.

@michaelaye
Copy link
Author

Hm, I was not sure how to delete all existing terminals, so I restarted VSCode. Now I cannot reproduce the problem anymore.
As expected, the used source activate stable does now activate the correct path for the terminal created via "Python: Create Terminal".
Sorry for the noise and thanks for the help!

@DonJayamanne DonJayamanne added closed-invalid and removed info-needed Issue requires more information from poster labels Feb 6, 2018
@DonJayamanne
Copy link

@michaelaye Thanks for getting back on this.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
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
Projects
None yet
Development

No branches or pull requests

2 participants