Installing Packages with Poetry: ERROR: Can not combine '–user' and '–prefix' as they imply different installation locations

huangapple go评论74阅读模式
英文:

Installing Packages with Poetry: ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

问题

如果我尝试运行 poetry install,我会得到以下错误:

  • 安装 six (1.16.0)

  CalledProcessError

  命令 'C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --isolated --no-input --prefix C:\Users\lazlo\AppData\Local\pypoetry\Cache\virtualenvs\XXXX-MaFxIpG_-py3.9 --no-deps C:\Users\lazlo\AppData\Local\pypoetry\Cache\artifacts\fb\dd\b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50\pycparser-2.21-py2.py3-none-any.whl' 返回非零退出状态 1。


尝试处理此错误时出现以下错误:

  EnvCommandError

  命令 C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --isolated --no-input --prefix C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9 --no-deps C:\Users\lazlo\AppData\Local\pypoetry\Cache\artifacts\fb
  • 安装 six (1.16.0)

  CalledProcessError

  命令 'C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --isolated --no-input --prefix C:\Users\lazlo\AppData\Local\pypoetry\Cache\virtualenvs\XXXX-MaFxIpG_-py3.9 --no-deps C:\Users\lazlo\AppData\Local\pypoetry\Cache\artifacts\fb\06\dd\b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50\pycparser-2.21-py2.py3-none-any.whl' 返回非零退出状态 1。


尝试处理此错误时出现以下错误:

  EnvCommandError

  命令 C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --isolated --no-input --prefix C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9 --no-deps C:\Users\lazlo\AppData\Local\pypoetry\Cache\artifacts\fb\06\dd\b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50\pycparser-2.21-py2.py3-none-any.whl 返回以下返回代码 1,并输出:
  ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

尝试处理此错误时出现以下错误:

PoetryException

  无法安装 C:/Users/XXX/AppData/Local/pypoetry/Cache/artifacts/fb/06/dd/b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50/six-1.16.0-py2.py3-none-any.whl
6\dd\b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50\pycparser-2.21-py2.py3-none-any.whl 返回以下返回代码 1,并输出:
ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations 尝试处理此错误时出现以下错误: PoetryException 无法安装 C:/Users/XXX/AppData/Local/pypoetry/Cache/artifacts/fb/06/dd/b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50/six-1.16.0-py2.py3-none-any.whl

但当我查看此路径时,我可以找到文件。

我的 pyproject.toml 如下所示:

[tool.poetry]
name = "lf_privat"
version = "1.0.0"
description = ""
authors = [
    "Lazloo <lazloo@xxxx.com>",
]
license = "Proprietary"

[[tool.poetry.source]]
name = "XXXX_nexus"
url = "https://nexus.infrastructure.XXX.net/repository/pypi-all/simple/"

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
pandas = "^1.4.4"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
testpaths = ["tests"]

尽管包本身似乎不是问题所在。如果我尝试安装其他包,我会收到相同的错误消息。

我能做些什么来解决这个问题吗?

英文:

If I try to run poetry install I get the error

  • Installing six (1.16.0)

  CalledProcessError

  Command &#39;C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --isolated --no-input --prefix C:\Users\lazlo\AppData\Local\pypoetry\Cache\virtualenvs\XXXX-MaFxIpG_-py3.9 --no-deps C:\Users\lazlo\AppData\Local\pypoetry\Cache\artifacts\fb\dd\b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50\pycparser-2.21-py2.py3-none-any.whl&#39; returned non-zero exit status 1.


The following error occurred when trying to handle this error:


  EnvCommandError

  Command C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9\Scripts\python.exe -m pip install --disable-pip-version-check --isolated --no-input --prefix C:\Users\XXX\AppData\Local\pypoetry\Cache\virtualenvs\XXX-MaFxIpG_-py3.9 --no-deps C:\Users\lazlo\AppData\Local\pypoetry\Cache\artifacts\fb\dd\b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50\pycparser-2.21-py2.py3-none-any.whl errored with the following return code 1, and output:
  ERROR: Can not combine &#39;--user&#39; and &#39;--prefix&#39; as they imply different installation locations

The following error occurred when trying to handle this error:

PoetryException

  Failed to install C:/Users/XXX/AppData/Local/pypoetry/Cache/artifacts/fb/06/dd/b5671b47dd0597663bc05d60d324bb315a8cef56f3179b8f9067f88e50/six-1.16.0-py2.py3-none-any.whl


But when I look at this path, I can find the file.

My pyproject.toml looks like

[tool.poetry]
name = &quot;lf_privat&quot;
version = &quot;1.0.0&quot;
description = &quot;&quot;
authors = [
    &quot;Lazloo &lt;lazloo@xxxx.com&gt;&quot;,
]
license = &quot;Proprietary&quot;

[[tool.poetry.source]]
name = &quot;XXXX_nexus&quot;
url = &quot;https://nexus.infrastructure.XXX.net/repository/pypi-all/simple/&quot;


[tool.poetry.dependencies]
python = &quot;&gt;=3.8,&lt;4.0&quot;
pandas = &quot;^1.4.4&quot;

[build-system]
requires = [&quot;poetry-core&gt;=1.0.0&quot;]
build-backend = &quot;poetry.core.masonry.api&quot;

[tool.pytest.ini_options]
testpaths = [&quot;tests&quot;]

While the package itself seems not to be the issue. If I try to install other packages I get the same error message.

Can I do something about this?

答案1

得分: 0

我没有找到问题的根本原因,但在重新按照官方网站的步骤安装 poetry 后,问题不再出现。

英文:

I did not find the root of the issue but after reinstalling poetry using the steps of the official website poetry installation the issue does not occur anymore

huangapple
  • 本文由 发表于 2023年6月6日 15:48:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76412456.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定