0

I'm struggeling to create a python virtual environment.

This is what I tried:

PS O:\Workspaces\VSCPython\venvTest> dir


    Verzeichnis: O:\Workspaces\VSCPython\venvTest


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        28.03.2023     09:48             66 venv.py


PS O:\Workspaces\VSCPython\venvTest> python -m venv testVENV
['O:\\Workspaces\\VSCPython\\venvTest', 'C:\\Users\\ysteiner\\AppData\\Local\\Programs\\Python\\Python311\\python311.zip', 'C:\\Users\\ysteiner\\AppData\\Local\\Programs\\Python\\Python311\\DLLs', 'C:\\Users\\ysteiner\\AppData\\Local\\Programs\\Python\\Python311\\Lib', 'C:\\Users\\ysteiner\\AppData\\Local\\Programs\\Python\\Python311', 'C:\\Users\\ysteiner\\AppData\\Roaming\\Python\\Python311\\site-packages', 'C:\\Users\\ysteiner\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages']
PS O:\Workspaces\VSCPython\venvTest> dir


    Verzeichnis: O:\Workspaces\VSCPython\venvTest


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        28.03.2023     10:42                __pycache__
-a----        28.03.2023     09:48             66 venv.py

Strangely this works:

PS C:\Users\ysteiner\AppData\Local\Programs\Python\Python311> .\python.exe -m venv C:\temp\venv2

My path variables are:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Users\ysteiner\AppData\Local\Programs\Python\Python311;C:\Users\ysteiner\AppData\Local\Programs\Python\Python311\Scripts\;C:\cygwin64\bin;C:\Program Files\Git\cmd;C:\Program Files\Git LFS;C:\Program Files\dotnet\;C:\Program Files (x86)\Plantronics\Spokes3G\;C:\Program Files (x86)\Subversion\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\nodejs\;C:\msys64\mingw64\bin;C:\msys64\usr\bin;C:\Program Files\TortoiseGit\bin;C:\Users\ysteiner\.cargo\bin;C:\Users\ysteiner\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\ysteiner\AppData\Local\Programs\Python\Python311\;C:\Users\ysteiner\AppData\Local\Microsoft\WindowsApps;C:\Users\ysteiner\.dotnet\tools;C:\Users\ysteiner\AppData\Roaming\npm;C:\Users\ysteiner\AppData\Local\Programs\Microsoft VS Code\bin

What is going wrong here? Also creating a venv with VSCode does the same as the first example.

yannick818
  • 125
  • 7
  • 1
    What is `venv.py`? Seems like you are running it instead of the python venv module. – ivvija Mar 28 '23 at 09:08
  • damn that looks like the missing puzzle piece. I renamed venv.py and it workes now! – yannick818 Mar 28 '23 at 09:13
  • The duplicate is superficially different but having a file shadow a library file with the same name is a common enough beginner error that I hope this duplicate marking is acceptable. – tripleee Mar 28 '23 at 09:55

0 Answers0