本文主要是介绍《python》安装poetry库-FileNotFoundError: [WinError 2] 系统找不到指定的文件。-问题解决以及安装,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题描述:
使用指令:
curl -sSL https://install.python-poetry.org | python3 -
安装 poetry的时候出现这个问题:
具体报错:
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\q\AppData\Roaming\Python\ScriptsYou can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.Installing Poetry (1.8.3): An error occurred. Removing partial environment.
Traceback (most recent call last):File "<stdin>", line 945, in <module>File "<stdin>", line 923, in mainFile "<stdin>", line 560, in runFile "<stdin>", line 581, in installFile "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\contextlib.py", line 117, in __enter__return next(self.gen)File "<stdin>", line 653, in make_envFile "<stdin>", line 639, in make_envFile "<stdin>", line 327, in makeFile "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\venv\__init__.py", line 75, in createself._setup_pip(context)File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\venv\__init__.py", line 298, in _setup_pipsubprocess.check_output(cmd, stderr=subprocess.STDOUT)File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\subprocess.py", line 424, in check_outputreturn run(*popenargs, stdout=PIPE, timeout=timeout, check=True,File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\subprocess.py", line 505, in runwith Popen(*popenargs, **kwargs) as process:File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\subprocess.py", line 951, in __init__self._execute_child(args, executable, preexec_fn, close_fds,File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\subprocess.py", line 1420, in _execute_childhp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
问题解决:
使用管理员下的powershell来安装。
安装代码为:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
下载的速度有点慢.....
这里就是安装好了!
使用指令检查安装版本:
poetry --version
使用我给发的那个命令会自动帮助我们设置环境变量的。
但是我在检验的时候出现了这样的报错:
这里就是没有正确的配置环境变量。
解决!环境变量的问题!
用框中路径(根据自己的安装成功输出的来):
使用高级系统设置
点击新建之后,给那个路径放到这个下面。
重新输入:(注意!!!可能需要重启一下电脑才可以)
poetry --version
完成安装!!!解决问题!!!
这篇关于《python》安装poetry库-FileNotFoundError: [WinError 2] 系统找不到指定的文件。-问题解决以及安装的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!