Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing with Microsoft Store Python is confusing #135

Open
crazytan opened this issue Sep 29, 2023 · 4 comments
Open

Installing with Microsoft Store Python is confusing #135

crazytan opened this issue Sep 29, 2023 · 4 comments

Comments

@crazytan
Copy link

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
Copy link

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

This comment was marked as off-topic.

@abn
Copy link
Member

abn commented Nov 22, 2024

Adding some additional context links.

python/cpython#84557 (comment)
beeware/briefcase#922

@abn
Copy link
Member

abn commented Nov 22, 2024

@crazytan @temeddix can you workaround this issue using something like this?

poetry config cache-dir C:\Users\username\pypoetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants