Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PYTHON How to SET pythonpath in window 10

I’m trying to set pythonpath but when I follow in some example in other stackoverflow, I just get a red message or nothing happened.

enter image description here

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

In my picture, u can see, no my folder D:\DemoPython

Does anyone have exactly how to set it?, please give me some examples or the exact answer would be better. Thank so much.

>Solution :

The syntax for setting environment variables you found is for cmd.exe (the DOS-like prompt that has shipped with Windows for ages). You’re running in PowerShell, which is newer, and has significantly different syntax.

On PowerShell (which you’re using), you want:

$env:PYTHONPATH = "D:\DemoPath;${env:PYTHONPATH}"

or

$env:PYTHONPATH = "${env:PYTHONPATH};D:\DemoPath"

depending on whether you want to take precedence over existing entries or not, respectively.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading