Python Forum
setting up the VS Code to work with Python - virtual environment-configuration
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setting up the VS Code to work with Python - virtual environment-configuration
#1
good day dear community, 


in my VSCode-project-folder I created the venv-folder with the following command: 
python -m venv venv
When I in VS Code run the command select python interpreter my venv folder does not show up.

Well - i think that have to go a level up - as it is suggested here in the tutorial: https://code.visualstudio.com/docs/pytho...n-tutorial

but VS Code doesn't see my virtual interpreter.

i need to get a closer idea of the setting up VSCode for the work with Python: - (again ) as it is shown here: https://code.visualstudio.com/docs/pytho...n-tutorial
Quote:Run Hello World
Select one or more lines, then press Shift+Enter or right-click and select Run Selection/Line in Python Terminal. ...
From the Command Palette (Ctrl+Shift+P), select the Python: Start REPL command to open a REPL terminal for the currently selected Python interpreter.
Get Started Tutorial for Python in Visual Studio Code

well i think that there is something wrong with the way to show virtual environments in vs code.

i guess that i have to do some corrections in the venv-settings (/set-up)

i have to check the data & seettings in venv through command prompt.

note: i work on Windows 

(at home i use linux - at the office i run VSCode on a win-box)

i guess that the settings virtual environments have to be corrected. 


any and all help for this task is greatly appreciated
Wordpress - super toolkits a. http://wpgear.org/ :: und b. https://github.com/miziomon/awesome-wordpress :: Awesome WordPress: A curated list of amazingly awesome WordPress resources and awesome python things https://github.com/vinta/awesome-python
Reply
#2
Shouldn’t it be “ python -m venv venv/“?
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#3
(Sep-28-2019, 04:38 PM)perfringo Wrote: i need to get a closer idea of the setting up VSCode for the work with Python:
VS Code from start
I always start for command line setting up virtual environment then code . to start VS Code.
Find automatically virtual environment and can use Code Runner eg Button.
So Code Runner always follow the selected interpreter down in left corner,as use setting "python": "$pythonPath $fullFileName",.

Quick tour.
# Make environment 
E:\div_code
λ python -m venv forum_env

# Cd in
E:\div_code
λ cd forum_env\

# Activate environment 
E:\div_code\forum_env
λ E:\div_code\forum_env\Scripts\activate

# Start VS Code
(forum_env) E:\div_code\forum_env
λ code .
[Image: gET0pZ.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding to python environment in pyenv virtual project Larz60+ 4 2,837 Jun-26-2022, 11:26 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020