poetry: Unable to create Virtual Environment with MS Store Python

OS: Windows 11 Python version: 3.10.3 Initial poetry install via Powershell command: (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -

Had some problems with initial install, so ran uninstall with no problems. However, on attempting to reinstall, got the following message:

Installing Poetry (1.1.13)
Installing Poetry (1.1.13): Creating environment
Actual environment location may have moved due to redirects, links or junctions.
  Requested location: "C:\Users\321gp\AppData\Roaming\pypoetry\venv\Scripts\python.exe"
  Actual location:    "C:\Users\321gp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\Roaming\pypoetry\venv\Scripts\python.exe"
Actual environment location may have moved due to redirects, links or junctions.
  Requested location: "C:\Users\321gp\AppData\Roaming\pypoetry\venv\Scripts\python.exe"
  Actual location:    "C:\Users\321gp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\Roaming\pypoetry\venv\Scripts\python.exe"
Installing Poetry (1.1.13): An error occurred. Removing partial environment.
Poetry installation failed.
See C:\Users\321gp\poetry-installer-error-2yr835li.log for error logs.

Error log contains the following:

No pyvenv.cfg file

Traceback:

  File "<stdin>", line 879, in main
  File "<stdin>", line 515, in run
  File "<stdin>", line 536, in install
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1008.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "<stdin>", line 608, in make_env
  File "<stdin>", line 594, in make_env
  File "<stdin>", line 326, in make
  File "<stdin>", line 349, in pip
  File "<stdin>", line 346, in python
  File "<stdin>", line 339, in run

Checking the links listed, C:\Users\... \Roaming\pypoetry\venv\ does not exist.

Suggestions on how to correct this?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 15 (3 by maintainers)

Most upvoted comments

I was having this issue too, and found not so much a fix, but a workaround:

try setting the POETRY_HOME environment variable before running the install script to a directory you created. (i.e $env:POETRY_HOME="$env:userprofile\pypoetry") after that, run the install script again