繁体   English   中英

无法使用 python 3.9 env 运行 Jupyter Notebook

[英]Can't run Jupyter Notebook with python 3.9 env

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

# All requested packages already installed.

在 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

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

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

  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 笔记本上检查 Python 的版本。

我尝试过的,基于 Pushpendra Singh Nathavat 的回应是:

conda create -n py39 python=3.9 -y 
conda activate py39
pip install jupyter
jupyter notebook

您可以使用以下命令检查笔记本中的 Python 版本:

import sys
sys.version

您必须在终端中编写三个代码。

  1. 畅达创建-n py39 python=3.9
  2. pip3 install --upgrade pip
  3. pip3 安装 jupyter

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM