neuron-team / vscode-ipe

Interactive programming experience for data scientists: Visual Studio Code extension
MIT License
353 stars 27 forks source link

Integration with Conda environments #162

Open GPhilo opened 6 years ago

GPhilo commented 6 years ago

I use a conda environment for development which already has Jupyter (and all the dependencies I need) installed. If I try to open the output pane, the extension asks me to install Jupyter and then attempts to install it in my system python installation, so it seems it's not checking which python interpreter I selected via Python: Select Interpreter and always defaults to /usr/bin/python. Is it be possible to have the extension use the environment I selected?

LukeyQ1 commented 6 years ago

This is being looked into and would also be useful for #161

GPhilo commented 6 years ago

From what I could see in the codebase, at least for this issue it would boil down to have the commands currently run via execSync inside the chosen conda environment. So far, from what I could research, it seems execSync spawns a new shell, which would require to always "conda activate" the current environment. I don't know how to make that work both in a conda environment and in the root environment, though.

iraquitan commented 6 years ago

I believe my question is related to this issue. I'd like to know how can I select a specific kernel to run my code? Because as @GPhilo stated, it seems that it always tries to install things in my system python interpreter.

benlindsay commented 6 years ago

This issue is pretty important to me too. I don't even have /usr/bin/pip installed, and have no interest in doing so, and it doesn't seem to work without that. Once I can use this with my conda environments, this tool will be a game changer for me.

Thanks for all the work you've all done on this so far!

ghost commented 6 years ago

Any update on this? Is this extension still maintained/developed or abandoned in the same way as Jupyter extension by @DonJayamanne ? Seems as the next release is stuck and this particular issue affects a lot of people.

Would really appreciate a response! It is hard to find any functional jupyter extension in VS Code...

LukeyQ1 commented 6 years ago

I would love to work on this feature however it has been hard to find the time to work on the extension recently :( If anyone has a solution to this issue and would like to contribute please let me now. If there are any further developments I will update you

benlindsay commented 6 years ago

This is unfortunate but I totally understand. I wish you could get financial support for this from Microsoft or something. I think this is such a great concept that addresses most of the concerns about notebooks recently brought up in the talk by Joel Grus. I wish I had the expertise or time required to contribute to this too

MarcSkovMadsen commented 6 years ago

Also need this feature

Really, really impressed by this extension. But the use of the default python extension is a blocker for me. I always use a virtual environment and select it in VS Code. If somebody has the time to implement this it could be a game changer for this extension I believe.

I would need one either

  1. That the extension by default uses the active python environment in VS Code

or

  1. That i could manually select a jupyter server (URL + Token) and a kernel (The one corresponding to the active python environment in VS Code).
pavanagrawal123 commented 6 years ago

Hi, @MarcSkovMadsen, @benlindsay, @ghost, @GPhilo

I'm planning on fixing this for a fork: https://github.com/pavanagrawal123/VSNotebooks for version 1.5. I'd be happy to upstream the patch as soon as work here is resumed, but for now my fork is diverging from the code base here. It would be awesome if one of y'all could open an issue there so we can track the issue there specifically.

pavanagrawal123 commented 6 years ago

Fixed this here: https://github.com/pavanagrawal123/VSNotebooks/pull/10

Please try it out and let me know if you run into any issues.

yraaj commented 4 years ago

I can't seem to get the fix to work. Everytime i click the show output pane, I get the error:

image

I already selected my Python version correctly.

I tried your code Pavan, but it gives me this error:

image

I installed the Jupyter module and I get this error now:

image

I checked and i definitely have jupyter in my path. is there a way that i can get your program to read my .bashrc file?