简体   繁体   English

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

[英]python poetry installation failed on Windows 10 - no pyvenv.cfg file

I installed Python 3.9 using winget.我使用 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

I am trying to install poetry.我正在尝试安装诗歌。 Therefore, I downloaded the new installation script from https://install.python-poetry.org/ and run it within a Windows terminal.因此,我从https://install.python-poetry.org/下载了新的安装脚本,并在 Windows 终端中运行它。 Here's the output:这是 output:

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.

And finally the output of the respective log file:最后是相应日志文件的 output:

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(

Apparently, there's some issue with the place where Python has been installed, isn't it?显然,安装 Python 的地方有问题,不是吗? How can I solve that issue?我该如何解决这个问题?

This indeed is path issue with multiple versions of Python Installation, especially the version from Microsoft is not setting the path properly us the installer from https://www.python.org/downloads/ it fixes the error这确实是 Python 安装的多个版本的路径问题,尤其是 Microsoft 的版本没有正确设置路径,我们来自https://www.python.org/downloads的安装程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM