python诗在Windows 10上安装失败 - 没有pyvenv.cfg文件

问题描述 投票:0回答:1

我使用 winget 安装了 Python 3.9。

PS C:\Users\andre> winget list PythonSoftware
Name       ID                                                Version
-----------------------------------------------------------------------
Python 3.9 PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0 3.9.2544.0

我正在尝试安装诗歌。因此,我从 https://install.python-poetry.org/ 下载了新的安装脚本,并在 Windows 终端中运行它。这是输出:

PS C:\Users\andre\Downloads> python .\install-poetry.py
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

C:\Users\andre\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Scripts

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

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

最后是相应日志文件的输出:

No pyvenv.cfg file


Traceback:

  File "C:\Users\andre\Downloads\install-poetry.py", line 872, in main
    return installer.run()
  File "C:\Users\andre\Downloads\install-poetry.py", line 503, in run
    self.install(version)
  File "C:\Users\andre\Downloads\install-poetry.py", line 524, in install
    with self.make_env(version) as env:
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "C:\Users\andre\Downloads\install-poetry.py", line 596, in make_env
    raise e
  File "C:\Users\andre\Downloads\install-poetry.py", line 582, in make_env
    yield VirtualEnvironment.make(env_path)
  File "C:\Users\andre\Downloads\install-poetry.py", line 317, in make
    env.pip("install", "--disable-pip-version-check", "--upgrade", "pip")
  File "C:\Users\andre\Downloads\install-poetry.py", line 340, in pip
    return self.python("-m", "pip", "--isolated", *args, **kwargs)
  File "C:\Users\andre\Downloads\install-poetry.py", line 337, in python
    return self.run(self._python, *args, **kwargs)
  File "C:\Users\andre\Downloads\install-poetry.py", line 330, in run
    raise PoetryInstallationError(

显然是Python安装的地方有问题,不是吗?我该如何解决这个问题?

python python-poetry
1个回答
0
投票

这确实是多个版本的Python安装的路径问题,特别是来自Microsoft的版本没有使用来自https://www.python.org/downloads/的安装程序正确设置路径它修复了错误

© www.soinside.com 2019 - 2024. All rights reserved.