《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\Scripts

You 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 main
  File "<stdin>", line 560, in run
  File "<stdin>", line 581, in install
  File "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_env
  File "<stdin>", line 639, in make_env
  File "<stdin>", line 327, in make
  File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\venv\__init__.py", line 75, in create
    self._setup_pip(context)
  File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\venv\__init__.py", line 298, in _setup_pip
    subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  File "D:\python-dev\pyenv\pyenv-win\versions\3.9.5\lib\subprocess.py", line 424, in check_output
    return 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 run
    with 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_child
    hp, 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

 

完成安装!!!解决问题!!! 

卸载!

curl -SSL https://install.python-poetry.org | python3 - --uninstall

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值