-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Jupyter doesn't work with anaconda #5539
Comments
This is not datascience specific. I think the error is we're using '. ' instead of source, although from this It looks like it was on purpose. |
@DonJayamanne @rchiodo @xhochy Building the latest extension version from github master, activation errors still persist with conda. Basically, before a recent PR (#5516, #4402), I think it was trying to do something like this, which is wrong: $ <ENV>/activate
Error: activate must be sourced. Run 'source activate envname'
instead of 'activate envname'. Now it's trying to do something like this (but it's also still wrong!): $ source <ENV>/bin/activate
Error: no environment provided. It should be either this: $ source <ENV>/bin/activate <ENV> Or, as a matter of fact, conda guys officially suggest using |
The only way I can make it work (and this is on conda/macOS) is replacing the export $PATH=<ENV>/bin:$PATH Then the Jupyter stuff launches fine (just to verify). |
This is weird. The latest nightly is working for me with conda 4.6. What conda version do you have installed? |
@xhochy conda is 4.6.14, the extension I've just built from the latest master, with a clean install. Again, seeing what the extension is trying to do - e.g., even jupyter aside, if you select some code and shift-enter, it tries to fire a python console, and prior to that attempts to activate the environment like this: |
@xhochy If you simply 'run file in the terminal', does it paste |
@xhochy I did a bit more debugging. Turns out I do indeed have conda 4.6, but that particular environment was created long time ago with an older version of conda (probably 4.5 or, less likely, 4.4 - it's hard to tell). With freshly-created environments the problem doesn't happen. But this is all very implicit and obscure. IMO either the extension should support a wider range of conda environments, or it should fire an explicit warning saying "please recreate it with a latest conda" (which is not so nice...). One thing to note: newer conda environments do not even have the With this in mind, if the extension didn't try to source the activate in older conda environments, it would then work for all conda versions? (as in, for all environment versions) I'm still not sure why it's trying to do that, and it sounds more like a bug than a feature. |
Also experiencing this issue with conda 4.6.14 on Ubuntu 18.04. I believe that |
I changed the .bashrc file from: # >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/miniconda3/etc/profile.d/conda.sh" ]; then
. "/opt/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<< to
And everything works as expected. |
The plugin tries to find a |
Maybe this is related: Activating a local conda environment (in
I have conda 4.6.14 and VS Code Python Extension 2019.6.24221. On the other hand, using a local virtual environment created using |
What have helped me is to install VS Code from the Anaconda Navigator and starting the application from there. Not sure if it will help you though. (macOS) |
https://github.com/microsoft/vscode-python/issues/8928 Might resolve this |
@luabud may I take this up? |
Should be addressed with #15818 |
Environment data
Expected behaviour
Jupyter loads correctly
Actual behaviour
it fails to load with anaconda
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)The text was updated successfully, but these errors were encountered: