python-poetry / install.python-poetry.org

The official Poetry installation script
https://install.python-poetry.org
196 stars 51 forks source link

Installing with Microsoft Store Python is confusing #135

Open crazytan opened 10 months ago

crazytan commented 10 months ago

I have Python 3 installed from Microsoft Store and I installed poetry with (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -. However, I am unable to find the poetry installation at %APPDATA%\pypoetry. I tried running the same command again but it said poetry already installed. I even tried debugging the installation script and everything including data_dir looks normal, but I just can't find the installation.

I suspect this is an issue caused by MS Store Python with some file system rewrite shenanigans, as everything went normal after I uninstalled this version and installed one from python.org. If possible we should warn the user or fail the installation when Microsoft Store Python is detected.

temeddix commented 9 months ago

I encountered this problem as well.

On Windows, Microsoft store apps is 'sandboxed' and are not installed in C:\Program Files like normal programs with installers do. Instead, they are installed in C:\Users\username\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe. This applies to Python from Microsoft store as well.

The fact is that whenever apps from Microsoft store tries to access C:\Users\username\AppData, they are silently 'guided' to a different folder, somewhere like C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache. That's where this error arises from.

image

Now pipx is the recommended way to install Poetry, but pipx itself doesn't support Microsoft store's sandboxed environment. I also hope this problem could be solved.

xusanboyman2008 commented 3 months ago

d