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.
Asked
Active
Viewed 2,294 times
3

dorinand
- 1,397
- 1
- 24
- 49
-
Possible duplicate of [Use Virtualenv with Python with Visual Studio Code in Ubuntu](https://stackoverflow.com/questions/37642045/use-virtualenv-with-python-with-visual-studio-code-in-ubuntu) – phd May 30 '18 at 19:37
-
https://code.visualstudio.com/docs/python/environments – phd May 30 '18 at 19:37
-
Thank you for your reply. As I mentioned in my question, this works fine and does not solving my problem. Only way how it works for me is to activate virtualenv first in console and then start code myproject. – dorinand May 30 '18 at 20:24
1 Answers
1
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

Rein Fowler
- 27
- 6