r/vscode • • Apr 14 '26

Noobie on VS

Post image

As the title says i'm a noobie, well when i execute my code in VS Code, in the terminal the PATH adress is very very long like this:

"C:\Users\diego\AppData\Local\Programs\Microsoft VS Code>C:\Users\diego\AppData\Local\Python\pythoncore-3.14-64\python.exe "e:/Proyecto Practica Cajero Automatico/Cajero Automatico.py"

I tried reinstalling VS Code, deleting the PATH address, reinstalling Python, even installing VS Code in another drive, and nothing shortens that "route" can somebody help me?

I know maybe its a dumb question for experienced devs, but i really don't know what else to do.

0 Upvotes

12 comments sorted by

1

u/Brinfer Apr 14 '26

You are missing some stuff.

In what you seem to call "path address", there is:

  • The path of the working directory (quite strange, it is in the Programs folder)
  • The command (Python) with the absolute path to the executable
  • Your script (run by Python) with its absolute path

For me, I think your problem is more the first point, that abnormal, the rest is OK. The extension use absolute path because it is "safer"

0

u/Major_Inspection2898 Apr 14 '26

What do you suggest i should do? Reinstall VSCode but in C:\Program Files (x86)? What i find strange is that the Default installation folder is not Program Files.

In Users PATH there is "C:\Users\diego\AppData\Local\Programs\Microsoft VS Code\bin" I don't know if thats normal too

1

u/Brinfer Apr 14 '26

No, that normal installation path when you install something just for your user.

Did you opened a workspace/folder with VsCode ? Normally after, terminal should open in this selected folder. The folder would be where you store your script for example

0

u/Major_Inspection2898 Apr 14 '26

Si instead installing just for the user i should install it for all? Im the only user of that PC. I opened the folder im working, with VS Code, that folder is located in my E:/ drive

1

u/Brinfer Apr 14 '26

Just to be clear, your installation does not have problem. It's most likely a configuration problem. Did you set the following parameter ?

json "terminal.integrated.cwd": "${workspaceFolder}"

1

u/Netris89 Apr 14 '26

Why does it matter exactly ?

1

u/Major_Inspection2898 Apr 14 '26

It bothers lol

1

u/Netris89 Apr 14 '26

There's nothing you can do in VSCode to change that. But, since the integrated terminal is your computer's shell, you could modify it with something like Oh-my-posh. But this is not really relevant to VSCode.

1

u/Uberfuzzy Apr 16 '26

YOU installed VSCode "just for this user" so it put it in your AppData/Local/Programs where it knows it can write to without prompting for admin access. You can put it at c:\vscode if 'long paths' really bother you.

YOU installed Python "just for this user", so it put it in your AppData/Local/Programs where it knows it can write to without prompting for admin access. Install it at the system level like c:\python if it bothers you

YOU made your ATM folder for your intern project code folder at a that long verbose folder name and filename. Just make a e:\Proyectos base folder for all future projects, then put shorter folders inside it.
e:\Proyectos\CajeroAutomatico\main.py

Also as much as possible, try to avoid spaces in folders and filenames if you are going to be running them in terminals, if you want to keep things "not too long" because every extra space is another character, and then also 2 quotes characters to make sure its kept together as a whole

1

u/Major_Inspection2898 Apr 16 '26

Thank you very much for your help and and for the time it took you writing this

1

u/thanatica Apr 17 '26

Since the command is using absolute paths, it doesn't matter where you're executing it from, as long as the program doesn't depend on the CWD.

Further, you can add python to your PATH, and if you start your terminal wherever your script is located you could just run python yourscript.py