英文:
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 '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' 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 '--user' and '--prefix' 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 = "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"]
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论