dorinand
dorinand

Reputation: 1727

How execute python command within virtualenv with Visual Studio Code

I have created virtual environment named virualenv. I have scrapy project and I am using there some programs installed in my virtualenv. When I run it from terminal in VSC I can see errors even when I set up my virtual environment via Ctrl+Shift+P -> Python: Select Interpreter -> Python 3.5.2(virtualenv). Interpreter works in some way, I can import libs without errors etc, but I am not possible to start my scrapy project from terminal. I have to activate my virtual environment first via /{path_to_virtualenv}/bin/activate. Is there a way, how to automatically activate it? Now I am using PyCharm and it is possible there, but VSC looks much better according to me.

Upvotes: 3

Views: 2437

Answers (1)

Rein Fowler
Rein Fowler

Reputation: 25

One way I know how,

Start cmd Start you virtual env (helloworld) \path\etc> code .

It will start studio code in this environment. Hope it helps

Upvotes: 1

Related Questions