无法使用 python 3.9 env 运行 Jupyter Notebook

Dan*_*iel 6 python anaconda jupyter-notebook

我是使用 python 和 conda(以及 linux)的新手,我在通过 python 3.9 环境运行 Jupyter 笔记本时遇到了一些问题。我注意到基础 3.8.5 环境有效(并允许我打开 Jupyter 6.1.4),但我不确定为什么。我已经通过更新蟒蛇和畅达conda update condaconda update anaconda并获得相同

# All requested packages already installed.
Run Code Online (Sandbox Code Playgroud)

在 anaconda-navigator GUI 中,当我尝试使用 py39 环境并单击 Jupyter 上的安装时,我注意到它尝试安装 Jupyter 6.0.3 版,但我也收到此错误。

我还尝试将 pykernel 安装到我的环境中(不确定它是否会帮助我解决问题),我得到:

$conda install ipykernel
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                      

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

`Specifications:

  - ipykernel -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']

Your python: python=3.9


     Found conflicts! Looking for incompatible packages.
    This can take several minutes.  Press CTRL-C to abort.
    failed                                                                                                                                    
    
    UnsatisfiableError: The following specifications were found
    to be incompatible with the existing python installation in your environment:
    
    Specifications:
    
      - ipykernel -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']
    
    Your python: python=3.9
Run Code Online (Sandbox Code Playgroud)

我假设这就是 Jupyter 无法安装笔记本的原因。我对这些东西真的很陌生,所以如果需要我提供更多细节,请告诉我。我真的不明白这个问题,也找不到类似的东西。

小智 2

您可以按照以下步骤操作:

  1. conda create -n py39 python=3.9
  2. pip3 install --upgrade pip
  3. pip3 install jupyter
  4. 转到 anaconda 提示符
  5. 激活py39
  6. 运行 jupyter-notebook
  7. 根据您的机器更改路径后运行:python C:\ProgramData\Anaconda3\envs\py39\Scripts\pywin32_postinstall.py -install
  8. 从 anaconda 提示符运行:jupyter-notebook
  9. 检查 Jupyter Notebook 上的 Python 版本。