I have Python 2.7 and Python 3.6 installed via OSGeo4W64 on a Windows 10 x64 machine. I don't have a standalone installation of Python, but I did previously, which may have something to do with the errors I'm getting.
When I try to use python in a CMD window (in Administrator Mode) to run a .py script (in this case a TensorFlow 'getting started' example), I get the following error:
AttributeError: '_NamespacePath' object has no attribute 'sort'
If I try "where python", this is what I get:
If I run
C:\OSGeo4W64\apps\Python36\python.exe, Python 3.6.4 starts up normally. However if I run
C:\OSGeo4W64\bin\python.exe, I get the following error:
ImportError: No module named site
I've checked the environment variables, and the only paths relating to Python are the following (all within System Variables->Path):
C:\OSGeo4W64\apps\Python36\ C:\OSGeo4W64\apps\Python36\Scripts C:\OSGeo4W64\bin\
On a possibly related note, I'm also having trouble with pip - every time I try to use it I get the following:
Fatal error in launcher: Unable to create process using '"'
I know this error has been covered in other questions, but the answers posted have not worked for me, so I'm thinking the pip error is probably a symptom of something else, rather than a problem with pip by itself.