Python Forum
Interpreter does not consider PYTHONPATH environment variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interpreter does not consider PYTHONPATH environment variable
#1
Hello,

I have a problem executing scripts because the environment variable PYTHONPATH is not recognized.
I have downloaded the minimal python x64 embeddable zip and extracted it into a directory. This is the output of sys.path without set PYTHONPATH in the shell.
C:\Development\python-3.6.2-embed-amd64>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
>>> import sys
>>> print(sys.path)
['C:\\Development\\python-3.6.2-embed-amd64\\python36.zip', 'C:\\Development\\python-3.6.2-embed-amd64']
>>> sys.exit()
Then I set the variable PYTHONPATH
C:\Development\python-3.6.2-embed-amd64>SET PYTHONPATH=C:\Development\test

C:\Development\python-3.6.2-embed-amd64>echo %PYTHONPATH%
C:\Development\test
Now the output of sys.path should contain the directory C:\Development\test but...
C:\Development\python-3.6.2-embed-amd64>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
>>> import sys
>>> print(sys.path)
['C:\\Development\\python-3.6.2-embed-amd64\\python36.zip', 'C:\\Development\\python-3.6.2-embed-amd64']
Why PYTHONPATH is not recognized by the interpreter?

Thank you.
Reply


Messages In This Thread
Interpreter does not consider PYTHONPATH environment variable - by VegetaSSJ5 - Aug-03-2017, 02:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to set PYTHONPATH in Visual Studio Code? aupres 5 4,921 Aug-15-2023, 03:51 PM
Last Post: snippsat
  the exe file by generated by pyinstaller ,can't get the PYTHONPATH roger2020 11 7,270 Jan-14-2020, 11:07 AM
Last Post: roger2020
  TESSDATA_PREFIX environment variable is set to your "tessdata" directory. rajeev1729 1 4,141 Jun-10-2019, 04:47 PM
Last Post: Gribouillis
  setting pythonpath variable in environment variables saisankalpj 3 3,565 Dec-05-2018, 10:33 PM
Last Post: Gribouillis
  PythonPath file JohnRLaw 6 15,165 Oct-03-2016, 06:09 PM
Last Post: JohnRLaw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020