[issue26086] Bug in standardmodule os

Hana Larsen report at bugs.python.org
Tue Jan 12 03:57:38 EST 2016


Hana Larsen added the comment:

I thank you much for thisse answer!
I Python is in "C:\Python35\" in the root of C-Drive (OS)
=-O
Den 11-01-2016 kl. 23:57 skrev Eryk Sun:
> Eryk Sun added the comment:
>
> The "yield from" syntax was added in Python 3.3, so somehow you're using the 3.5 standard library with either an old 3.x or 2.x version. The older version shouldn't use 3.5's standard library, unless you have either PYTHONHOME or PYTHONPATH defined. Generally neither of these variables should be defined, especially not PYTHONHOME. In the command prompt run "set PYTHON" to list all environment variables that start with "PYTHON".
>
> You also appear to be running with the 3.5 site-packages as the working directory. Even without the other problems, I recommend against this since the current directory has precedence in sys.path. You're moving site-packages to the head of the list, in front of the standard library. For example:
>
>      C:\Program Files\Python35\Lib\site-packages>type subprocess.py
>      print("This isn't the subprocess you're looking for.")
>
>      C:\Program Files\Python35\Lib\site-packages>py -3 -c "import subprocess"
>      This isn't the subprocess you're looking for.
>
> Save your scripts in the top-level Scripts directory or a directory in your user profile. Generally leave everything under Lib alone, to be managed by pip and other installers.
>
> ----------
> nosy: +eryksun
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue26086>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26086>
_______________________________________


More information about the Python-bugs-list mailing list