Closed
Labels
bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster
Description
Issue Type: Bug
Related: #13071
install python extenstion
open a .ipynb file
set the conda env
on run:
Command failed: . activate myenv && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home//.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py /home//.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/printEnvVariables.py bash: activate: Datei oder Verzeichnis nicht gefunden
Extension version: 2020.9.111407
VS Code version: Code 1.49.2 (e5e9e69aed6e1984f7499b7af85b3d05f9a6883a, 2020-09-24T16:26:09.944Z)
OS version: Linux x64 5.8.11-arch1-1
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (4 x 2294) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off opengl: enabled_on protected_video_decode: unavailable_off rasterization: disabled_software skia_renderer: enabled_on video_decode: unavailable_off vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | 1, 1, 1 |
| Memory (System) | 7.48GB (2.81GB free) |
| Process Argv | --no-sandbox --unity-launch --crash-reporter-id 1b09f273-3ad9-4d17-b97b-06cad50c25cb |
| Screen Reader | no |
| VM | 0% |
| DESKTOP_SESSION | xfce |
| XDG_CURRENT_DESKTOP | XFCE |
| XDG_SESSION_DESKTOP | undefined |
| XDG_SESSION_TYPE | x11 |
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster
Activity
karthiknadig commentedon Sep 28, 2020
This occurs due to some limitation we have with the VS Code terminals and
conda. Here is a workaround for this:code .orcode project.code-workspaceto launch VS Code.This will give you an activated environment, and the extension will not have to try and activate every time a terminal is created.
KoSv commentedon Sep 28, 2020
thanks, but this doesn't work for me.
getting the same error.
karrtikr commentedon Sep 29, 2020
konstantin (@KoSv) Thanks for trying it out? Can you try running the command in the error in bash terminal and see if it works for you? I assume you're on Unix.
The error
Datei oder Verzeichnis nicht gefundenin German translates toFile or directory not found, I'm not sure which file this is referring to.KoSv commentedon Sep 29, 2020
Kartik Raj (@karrtikr) sure. here I've replace my username with
<USER>instead of "." I've added "conda". otherwise I got error
bash: activate: Datei oder Verzeichnis nicht gefundenorFile or directory not found{"SHELL": "/bin/bash", "SESSION_MANAGER": "local/Arch:@/tmp/.ICE-unix/813,unix/Arch:/tmp/.ICE-unix/813", "WINDOWID": "79692942", "COLORTERM": "truecolor", "XDG_CONFIG_DIRS": "/etc/xdg", "XDG_MENU_PREFIX": "xfce-", "CONDA_EXE": "/opt/miniconda3/bin/conda", "_CE_M": "", "rvm_prefix": "/home/<USER>", "SSH_AUTH_SOCK": "/tmp/ssh-t9rwvNxoaFwX/agent.962", "MY_RUBY_HOME": "/home/<USER>/.rvm/rubies/ruby-2.6.3", "DESKTOP_SESSION": "xfce", "SSH_AGENT_PID": "963", "DPAT_PASSWORD": "pass", "GTK_MODULES": "canberra-gtk-module:canberra-gtk-module", "XDG_SEAT": "seat0", "RUBY_VERSION": "ruby-2.6.3", "PWD": "/home/<USER>", "LOGNAME": "<USER>", "XDG_SESSION_TYPE": "x11", "CONDA_PREFIX": "/home/<USER>/.conda/envs/myenv", "rvm_version": "1.29.9 (latest)", "XAUTHORITY": "/home/<USER>/.Xauthority", "MOTD_SHOWN": "pam", "HOME": "/home/<USER>", "LANG": "de_DE.UTF-8", "XDG_CURRENT_DESKTOP": "XFCE", "DPAT_USER": "[email protected]", "VTE_VERSION": "6200", "CONDA_PROMPT_MODIFIER": "(myenv) ", "NVM_DIR": "/home/<USER>/.nvm", "rvm_bin_path": "/home/<USER>/.rvm/bin", "GEM_PATH": "/home/<USER>/.rvm/gems/ruby-2.6.3:/home/<USER>/.rvm/gems/ruby-2.6.3@global", "GEM_HOME": "/home/<USER>/.rvm/gems/ruby-2.6.3", "XDG_SESSION_CLASS": "user", "TERM": "xterm-256color", "_CE_CONDA": "", "USER": "<USER>", "CONDA_SHLVL": "1", "DISPLAY": ":0.0", "SHLVL": "1", "NVM_CD_FLAGS": "", "XDG_VTNR": "7", "XDG_SESSION_ID": "1", "CONDA_PYTHON_EXE": "/opt/miniconda3/bin/python", "MOZ_PLUGIN_PATH": "/usr/lib/mozilla/plugins", "XDG_RUNTIME_DIR": "/run/user/1000", "PS1": "(myenv) \\u@\\h \\W/$(parse_git_branch)$ ", "CONDA_DEFAULT_ENV": "myenv", "XDG_DATA_DIRS": "/usr/local/share:/usr/share", "PATH": "/home/<USER>/.conda/envs/myenv/bin:/home/<USER>/.nvm/versions/node/v10.16.3/bin:/opt/miniconda3/condabin:/home/<USER>/.rvm/gems/ruby-2.6.3/bin:/home/<USER>/.rvm/gems/ruby-2.6.3@global/bin:/home/<USER>/.rvm/rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/<USER>/.rvm/bin:/home/<USER>/.rvm/bin", "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus", "NVM_BIN": "/home/<USER>/.nvm/versions/node/v10.16.3/bin", "MAIL": "/var/mail/<USER>", "IRBRC": "/home/<USER>/.rvm/rubies/ruby-2.6.3/.irbrc", "rvm_path": "/home/<USER>/.rvm", "_": "/home/<USER>/.conda/envs/myenv/bin/python"}karrtikr commentedon Sep 30, 2020
Thanks that helps, looks like the activation command failed for you.
conda activateis the best way to do this on new versions of conda, butsource activateshould also work provided that it's done in the right directory - and. activateis a shorthand for that.I think it might be that you don't have the conda bin directory in PATH, and so bash can't find the activate script. Can you please run the following which prints environment variables before activation?
I'm particularly interested in
PATH, and if it hascondabindirectory onPATH.KoSv commentedon Sep 30, 2020
aha..
there it is:
"PATH": "/home/USER/.nvm/versions/node/v10.16.3/bin:/opt/miniconda3/condabin:/home/USER/.rvm/gems/ruby-2.6.3/bin:/home/USER/.rvm/gems/ruby-2.6.3@global/bin:/home/USER/.rvm/rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/USER/.rvm/bin:/home/USER/.rvm/bin"so it has condabin in there. but when I run
source activate myenvI get theFile or directory not founderror. So my conda is not properly installed? But withcondainsead otsourceI have no problems..karrtikr commentedon Sep 30, 2020
Yes, it should work with both,
sourceshould also be able to find the activation script given it's in PATH. So I would think you have a corrupt install.karrtikr commentedon Sep 30, 2020
Actually it's the
bindirectory that contains the activation script, notcondabin, so can you try adding/opt/miniconda3/bintoPATH(or wherever the bin directory is) and see if it works?KoSv commentedon Sep 30, 2020
OK it works now!
Thank you very much!
I've added the folowing line to my .bashrc file:
export PATH="/opt/miniconda3/bin:$PATH"After that:
..
But when I
source deactivateI get aDeprecationWarningthat I should usecondainstead of.So that you know ;)
Greetings!
karrtikr commentedon Sep 30, 2020
Awesome