Ich habe diesen Post zuvor in Stackoverflow gefragt, aber es war vor 4 Jahren (How to fix the python path), also bin ich mir nicht sicher, ob dies die richtige Lösung ist, weil ich eine neuere Version von Python (3.5.2). Dies ist, was ich in einem Python-Shell zu sehen:KeyError: 'PYTHONPATH', wie kann ich PYTHONPATH reparieren? (Python 3.5.2)
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import os
>>> os.environ['PYTHONPATH'].split(os.pathsep)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
os.environ['PYTHONPATH'].split(os.pathsep)
File "C:\Users\John\AppData\Local\Programs\Python\Python35\lib\os.py", line 725, in __getitem__
raise KeyError(key) from None
KeyError: 'PYTHONPATH'
Ich mag die pythonpath.So finden, wie kann ich diesen Fehler beheben?
Nun, ist diese Variable in Ihrer Systemumgebung? –
http://StackOverflow.com/a/4855685/1005215 –