错误:无法安装 ipykernel 和 jupyter-client,因为这些包版本具有冲突的依赖关系

问题描述 投票:0回答:0

我带着一个非常具体的错误来找你,我已经解决了几个小时了。 我正在尝试在运行 python 3.9.6 的 VSCode 中运行一个 jupyter notebook .ipynb 文件。当然我需要相应的扩展,所以我按照 VSCode 的提示安装推荐的扩展。安装 jupyter NB 似乎可以,但 ipykernel 安装失败。它给了我以下请求:

Request

当然,我将其复制到 CMD 中并让它运行一下。

"c:/Program Files/Msys/mingw64/bin/python.exe" -m pip install ipykernel -U --user --force-reinstall
It fails to install: 
ERROR: Cannot install ipykernel and jupyter-client because these package versions have conflicting dependencies.
...
To fix this you could try to:
loosen the range of package versions you've specified
remove package versions to allow pip attempt to solve the dependency conflict
 
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Image of full error.

从 VSCode 重复 ipykernal 安装并阅读通知提示显示相同的行为。 我已经尝试清除 python 缓存以防万一,同样的问题。

我已经尝试按照推荐阅读冲突解决页面,但我不明白如何访问 requirements.txt 文件或 setup.py,我只是不知道我在这里做什么,不想结束旋转我的轮子几个小时。

我已经尝试单独安装 pywin32,因为它似乎需要它的更新版本。

pip install pywin32 
"pip install pywin32
ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none)
ERROR: No matching distribution found for pywin32" 
A [different stack overflow thread ](https://stackoverflow.com/questions/40981120/python-pip-cannot-find-pywin32-on-windows) said to try pypiwin32
pip install pypiwin32
Which gives the following error: 
File "C:\Users\andre\AppData\Local\Temp\pip-install-vhqvsbur\pypiwin32_d3dd60d8846243c3be165c2c90439a4b\setup.py", line 121
print "Building pywin32", pywin32_version
                ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
[enter image description here](https://i.stack.imgur.com/lVez4.png)
Which googling shows may be a python2 vs python3 syntax change or something, but that's a rabbit hole I don't know how to go down. 

机器人俱乐部的其他人没有这个问题,我只是被诅咒了XD

python jupyter-notebook pywin32
© www.soinside.com 2019 - 2024. All rights reserved.