如何将jupyternotebook指向基于anaconda的python3,而不是早期安装的python2.7(不基于anaconda)

2024-04-24 23:02:14 发布

您现在位置:Python中文网/ 问答频道 /正文

jupyter笔记本安装了anaconda,但我的windows机器上有python2.7。 **jupyter kernelspec list命令显示以下结果

Available kernels:
  python3    D:\anaconda3\share\jupyter\kernels\python3**

但当我使用 导入熊猫作为pd命令我得到以下错误

ImportError                               Traceback (most recent call last)
<ipython-input-1-7dd3504c366f> in <module>
----> 1 import pandas as pd
c:\python27\lib\site-packages\pandas\__init__.py in <module>
     17 if missing_dependencies:
     18     raise ImportError(
---> 19         "Missing required dependencies {0}".format(missing_dependencies))
     20 del hard_dependencies, dependency, missing_dependencies
     21 
ImportError: Missing required dependencies ['numpy']

我的问题是为什么jupyter笔记本指向python2.7而不是基于Python的python3。如何将其改为指向python3?你知道吗


Tags: in命令pandasrequireddependencies笔记本jupyterpython3