Virtual environment Python3 beginner Windows 10

Guys are there anyone who got stuck with the establishment of a virtual environment on Windows. Here it is:

c:\>python -m venv c:\path\to\myenv

What I ended up with was this:

  1. File “”, line 1 in Visual Studio
    or
    2.‘c:’ is not recognized as an internal or external command,
    operable program or batch file. in command line
    & D:/python.exe c:/Users/Admin/Desktop/kurro.py
    ^
    SyntaxError: invalid syntax

Hi. I am IT Support L2 and newbie FCC student. Give me a screenshot so I can help you with precise instructions.
I found this official documentation in case of you missed it.
https://docs.python.org/3/library/venv.html

1 Like

[quote=“NewbiePythonCoder, post:1, topic:378825”]
c:>python -m venv c:\path\to\myenv
[/quote] Hi!Here is is from visual studio

which python version are you using? coz this is the offcial documentation invoke command

  • c:>c:\Python35\python -m venv c:\path\to\myenv

  • also you should replace the word “path” with your file path, example:
    C:\Users\Admin\Desktop\python\mycalc.py

1 Like

the latest 3.8.2, although my notebook is 64 bit, I use 32 bit python, cause there is no new version for 64 bit notebook and python is installed into D: not C: disk in the notebook(( Maybe that is the reason dunno
–The same mistake, it did not help((

I am using VS Code and python 3.8 as well, probably you noticed when installing python you were asked to install it in AppData folder which is located in C drive. I suppose you have a small issue with the path to your file.

1 Like

maybe,it is not the fist problem with the code I have, I couldn`t also open the file which I created on Notebook app in Visual studio, although I saved the file in py and in the same desk where my Python 3.8 is( Need to check it , thanks! I will reinstall Python, I suppose didn"t have such problems before((

I insist that you set wrong path. Anyway, this is the official vs code venv tutorial and docu. https://code.visualstudio.com/docs/python/environments
Be patient and redo everything following the official tuto.
In case you encounter an issue again, repost new request…
Best Regards

2 Likes

Ok!Gonna try to reinstall in to the C disk/Thank you!!! :slightly_smiling_face:

Otherwise, Jupiter notebook is a super and easy Python environment. Its very easy to use and to install. I am using it besides vs code.https://jupyter.org/install

1 Like

Ddin`t help ((how to set the right path otherwise?I thought it would have worked :persevere:
Copypasts the wrong problem,so I would better send the screenpic

And to be honest I never set venv but I am gonna do it for you, meanwhile, reinstall python in C drive, probably you will be asked to install it in App Data folder, follow those instructions. See you later. Happy to help :partying_face:

1 Like

you have to execute the command with powershell or shell, so change the execution environment from python to powershell. like this

Almost sure this is the main issue, you are executing powershell or shell command with python extension, that’s why you got that error. I successfully reproduced the same error you got. Change execution environments from python to powershell. You tell me if its ok.

1 Like

I change it into shell and as I tap run it simultaneously changes into Python automatically( :persevere:
If I enter the command in the terminal itself it does this mistake^

c:\>python : The term 'c:\>python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
 that the path is correct and try again.
At line:1 char:1
+ c:\>python -m venv c:\path\to\myenv
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (c:\>python:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException```

it works to execute the code with the powershell only through the terminal dunno why(((

because its python file with py extension. execute it on cmd like this:
python -m venv c:\path\

  • replace “path” by yours , example: c:\myenv or c:\Desktop\myenv
1 Like

Allright, this tuto should be enough, follow it.
https://programwithus.com/learn-to-code/Pip-and-virtualenv-on-Windows/

A simple command “pip install virtualenv” will do the job :smile:

Hopefully your issue will be solved.

1 Like

Look to my previous answer, simply open CMD command and type “pip install virtualenv” , on vs code is a bit complicated. Also do you have a folder named “to” ? coz i see it in your path. As i said, simply run the command i told you. Namaste.

1 Like