atom-python-run icon indicating copy to clipboard operation
atom-python-run copied to clipboard

Support Virtual Enviroments

Open nanu-c opened this issue 7 years ago • 3 comments

Could be difficult but maybe not

nanu-c avatar Jan 20 '18 13:01 nanu-c

nanu-c

This is cool and I like it. It would be handy to execute within a virtual environment.

Any code, abstractions, or ideas on how you plan to do this?

Does it not work with virtual environments now (I'm assuming it does not for obvious reasons)?

What's your game plan?

Edit: From what I can see, there are already a couple of packages that handle this for you; atom-python-virtualenv and virtualenv. Although, I am curious to see how they work with atom-python-run in mind. I'd assume configure virtualenv through another plugin and then you can just execute it from there; ideally.

ghost avatar Jan 21 '18 03:01 ghost

I didn't saw this other packages I will have a look

nanu-c avatar Jan 21 '18 12:01 nanu-c

Since there was no update on this topic I just tried "atom-python-virtualenv" - "virtualenv" is deprecated so this is the most popular way to go right now. If you have an virtualenv (e.g. "venv") directly in your project directory, you need to add the specific path in the settings of "atom-python-virtualenv" at the bottom in "Additional virtualenvs". For me this was something like "$HOME/uni/project1/venv".

After adapting the settings you need to select the virtualenv (Ctrl+Alt+V) and run python with this plugin. Took me 10 minutes to make this work - Atom somehow struggled to keep the terminal open which should tell me what error occured in my code but a restart fixed it for me :)

Thanks for this project 👍

Chaoste avatar Nov 30 '18 14:11 Chaoste