First, I will start by describing how the process was carried out:
- I've added a folder to Workspace and I've received this when I want to execute code:
PS C:\Users\mikol\Desktop> cd "c:/Users/mikol/Desktop/Skonczone_rzeczy/Python_Bill_Lubanovic/Rozdzia 05"
cd : Cannot find path 'C:\Users\mikol\Desktop\Skonczone_rzeczy\Python_Bill_Lubanovic\Rozdzia 05' because it does not exist.
At line:1 char:1
+ cd "c:/Users/mikol/Desktop/Skonczone_rzeczy/Python_Bill_Lubanovic/Roz ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\mikol\...ovic\Rozdzia 05:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
PS C:\Users\mikol\Desktop> & c:/Users/mikol/Desktop/Skonczone_rzeczy/venv/Scripts/python.exe "c:/Users/mikol/Desktop/Skonczone_rzeczy/Python_Bill_Lubanovic/Rozdzia 05/quiz.py"
C:\Users\mikol\AppData\Local\Programs\Python\Python310\python.exe: can't open file 'c:\\Users\\mikol\\Desktop\\Skonczone_rzeczy\\Python_Bill_Lubanovic\\Rozdzia 05\\quiz.py': [Errno 2] No such file or directory
1.1. In that case I've executed this code:
pytania = [
"Jaki kraj ma najwięcej jezior na świecie?",
"Jaki kraj wytwarza najwięcej tlenu?",
"Jaki kraj produkuje najwięcej energii elektrycznej ze źródeł odnawialnych?"]
odpowiedzi = [
"Rosja", "Kanada", "Norwegia"
]
p_o = ( (0, 1), (1,2), (2, 0) )
for p, o in p_o:
print("Pyt.:", pytania[p])
print("Odp.:", odpowiedzi[o])
print()
- Then I wanted to check where the error was and created a regular Python file on the desktop and executed it in VSC and that working correctly!
PS C:\Users\mikol\Desktop\Skonczone_rzeczy> cd c:/Users/mikol/Desktop
PS C:\Users\mikol\Desktop> & c:/Users/mikol/Desktop/Skonczone_rzeczy/venv/Scripts/python.exe c:/Users/mikol/Desktop/test1.py
tell me sth: hello
hello
PS C:\Users\mikol\Desktop>
2.1. In this case I've used this code:
tell_me = input("tell me sth: ")
print(tell_me)
My VSC Workspace structure: The structure of this folder
I've set up Python Path and created a virtual environment, also I've tried change those settings:
"python.terminal.activateEnvironment": false,
"python.terminal.executeInFileDir": true
Moreover I've try change that:
This folder consists of a lot of subfolders and every Python code cannot be executed because an error appears like the one above.
And now I have no idea what I've could miss.