1

I tried to open a python script with VS code. The library that requires with the script is in a virtualenv.

I am not sure how to integrate this with VS Code. I could not find my virtualenv in the intepreter.

For your information, the virtualenv I created is called "vc-web" and the scripts is in the folder called "web_scraper" inside the "vc-web" folder.

2 Answers 2

2

If your project is in folder e.g. proj, and you have a virtual environment at proj/vs-web and it's the only virtual environment in that directory, then it should be listed by the Python: Select Interpreter command where you can select it.

Sign up to request clarification or add additional context in comments.

Comments

0

All you need to do is just specify the "python.pythonPath" as follows. The values for "python.autoComplete.extraPaths" will be determine during runtime, however you are still free to specify custom paths in there.

Please remember to re-start VS Code once the necessary changes have been made.

{
    "editor.rulers": [80,100],
    "python.pythonPath":"~/path/to/venvs/proj/bin/python"
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.