诗歌可以通过Pyenv找到Python 2.7

发布于 2025-01-27 10:16:51 字数 651 浏览 2 评论 0原文

使用诗歌版本:1.1.13尝试通过Pyenv使用Python 2.7.18时会出现以下错误...

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

当本地设置2.7.18时,会发生这种错误(pyenv local 2.7.18)和全球(pyenv Global 2.7.18)。在相关目录中运行Python会启动终端...

Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

但是当我安装Python 3.9.6并将其设置为本地Python版本时,诗歌正常工作!

有人看过吗?我想念什么吗?

With Poetry version: 1.1.13 I get the following error when trying to use Python 2.7.18 via Pyenv...

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

This occurs when 2.7.18 is set up locally (pyenv local 2.7.18) and globally (pyenv global 2.7.18). Running python within the directory in question launches the terminal...

Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

But when I install Python 3.9.6 and set it as the local Python version, Poetry works perfectly correctly!

Has anyone seen this before? Am I missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一抹微笑 2025-02-03 10:16:51

%userProfile%.poetry \ bin \ poetry.bat 正在调用python3找不到python2安装。安装诗歌时。 _ WHICH_PYTHON方法(行666)确定poetry.bat中的调用是python3python python 在安装过程中可以通过哪个版本找到python 。

如果您已经安装了诗歌,则只需将诗歌文件修改为python即可。对于使用Pyenv的将来的安装,请确保将2.7 Python版本设置为全局。

%USERPROFILE%.poetry\bin\poetry.bat was calling Python3 which can't find Python2 installs. When installing Poetry get-poetry.py is called. The _which_python method (line 666) determines if the call in poetry.bat is Python3 or Python by which version of Python it finds during the install.

If you have already installed Poetry simply modify the poetry.bat file to be python. For future installations with Pyenv ensure that a 2.7 Python version is set as global.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文