Closed mdegans closed 3 years ago
Solution for me was just to install python for windows from Python.org
Not really a windows guy, so not sure why this is.
python
as well aspython3
are in path but they weren't detected.
I'm a bit confused here: do you have Python installed and exposed via PATH
before installing python for windows from Python.org?
Solution for me was just to install python for windows from Python.org Not really a windows guy, so not sure why this is.
python
as well aspython3
are in path but they weren't detected.I'm a bit confused here: do you have Python installed and exposed via
PATH
before installing python for windows from Python.org?
Sorry for not being clear, @antiagainst . Yes, Python was in path, installed from Windows store, but wasn't detected somehow. Immediately after the error, I double checked the command python
worked. I've updated the log above. Seems cmd_finder.rs
does not work in this case. After installing Python from Python.org, it's detected. Perhaps the extension is not .exe
and that's why? Seems Microsoft Store is .appx
I also ran into this issue just now. Microsoft apps are installed to %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
, and this is automatically added to the user env path by the Microsoft Store. I've manually checked, and python.exe does exist in this directory, however it is not detected by cmd_finder.rs
. I've also tried running from an elevated powershell console, so I don't think this is related to permissions.
I received the exact error as in the original post.
The script does read from PATH
. Not an expert on Windows PATH
; is there a difference between the user and system PATH
? Does Microsoft Store do anything special there?
The script does read from
PATH
. Not an expert on WindowsPATH
; is there a difference between the user and systemPATH
? Does Microsoft Store do anything special there?
Don't think so. It appears to be in $PATH
for the cmd
shell.
C:\Users\username>where python
C:\Users\username\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\username>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
C:\Users\username>where where
C:\Windows\System32\where.exe
Powershell is a different story.
PS C:\Users\username> where python
PS C:\Users\username> python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.which('python')
'C:\\Users\\username\\AppData\\Local\\Microsoft\\WindowsApps\\python.EXE'
In what universe that makes sense, IDK. where notepad
doesn't even work but typing notepad
and hitting enter indeed launches notepad. Possibly somebody who knows more about Windows can enlighten?
Seems python uses PATH
for shutil.which() The logic isn't the exactly the same, but looking at your cmd_finder.rs
I can't see what's wrong.
Because the build script uses std::path::PathBuf::exists to track if dependencies are present. In the rust-lang reference
If you cannot access the metadata of the file, e.g. because of a permission error or broken symbolic links, this will return false.
Python installed by Microsoft App Store is pointing to a path which is unable to be accessed by user. A patch is submitted to fix this.
@oxkenshin: ah, thanks for the explanation!
Build scripts do not find Python installed through the windows store:
Solution for me was just to install python for windows from Python.org
Not really a windows guy, so not sure why this is.
python
as well aspython3
are in path but they weren't detected.