为什么即使安装了Jupyter Notebook(Python 3.6),也无法在我的Jupyter Notebook中导入utils? [英] Why I can not import utils in my Jupyter Notebook (Python 3.6) although it is installed?

查看:252
本文介绍了为什么即使安装了Jupyter Notebook(Python 3.6),也无法在我的Jupyter Notebook中导入utils?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用conda安装了软件包utils,但是当我尝试将其导入Jupyter Notebook时,却出现了异常:

I have installed the package utils using conda but when I try to import it in my Jupyter Notebook I get an exception:

import utils
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-32411ba4e9a6> in <module>()
----> 1 import utils

ModuleNotFoundError: No module named 'utils'

如果这次我尝试使用pip再次安装,则会收到预期的消息:

If I try installing again using pip this time I get the expected message:

(base) C:\Users\Alienware\Documents>pip install python-utils
Requirement already satisfied: python-utils in c:\programdata\anaconda3\lib\site-packages (2.3.0)
Requirement already satisfied: six in c:\programdata\anaconda3\lib\site-packages (from python-utils) (1.10.0)

其他模块的导入没有问题(例如featuretools).

Other modules are imported without any problem (e.g. featuretools).

推荐答案

您已经安装了 python-utils ,但正在导入 utils .这是两个不同的程序包.如果要使用 utils 软件包,请使用 pip install utils 进行安装.否则,如果要使用该软件包,请使用 import python_utils .

You have installed python-utils but are importing utils. These are two different packages. If you want to use the utils package, install it with pip install utils. Otherwise, use import python_utils if you want to use that package.

这篇关于为什么即使安装了Jupyter Notebook(Python 3.6),也无法在我的Jupyter Notebook中导入utils?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆