简体   繁体   English

为什么我已经安装了Jupyter Notebook(Python 3.6),但无法将utils导入到我的Jupyter Notebook中?

[英]Why I can not import utils in my Jupyter Notebook (Python 3.6) although it is installed?

I have installed the package utils using conda but when I try to import it in my Jupyter Notebook I get an exception: 我已经使用conda安装了软件包utils,但是当我尝试将其导入Jupyter Notebook时,出现异常:

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

ModuleNotFoundError: No module named 'utils'

If I try installing again using pip this time I get the expected message: 如果这次我尝试使用pip再次安装,则会收到预期的消息:

(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)

Other modules are imported without any problem (eg featuretools). 导入其他模块没有任何问题(例如Featuretools)。

You have installed python-utils but are importing utils . 您已经安装了python-utils但正在导入utils These are two different packages. 这是两个不同的程序包。 If you want to use the utils package, install it with pip install utils . 如果要使用utils软件包,请使用pip install utils进行pip install utils Otherwise, use import python_utils if you want to use that package. 否则,如果要使用该软件包,请使用import python_utils

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

相关问题 如何将内核安装到我的 Jupyter Notebook 以运行 Python 2.7(已通过 Anaconda3 安装了 Python 3.6) - How can I install a kernel to my Jupyter Notebook to run Python 2.7 (having installed Python 3.6 via Anaconda3) 无法在Jupyter Notebook(Python 3.6)中导入模块 - Cannot import module in Jupyter Notebook (Python 3.6) jupyter notebook 的 Python3 环境下无法导入已安装的包 - Can't import the installed package in Python3 environment of jupyter notebook 为什么我在python 3.6的jupyter笔记本中收到警告,我该如何解决? - Why do I get warnings in jupyter notebook for python 3.6 and how do I fix them? 如何让Jupyter Notebook导入python文件? - How can I get Jupyter Notebook to import a python file? Jupyter Notebook 找不到 python 3.6 的模块 - Jupyter Notebook can't find modules for python 3.6 我可以打开 jupyter 笔记本,但无法在 Mac 上运行带有 python 脚本的笔记本 - I can open a jupyter notebook, but I cannot run the notebook with python script in it on my Mac 安装GraphLab创建会使我的Jupyter Notebook从Python 3.6降级到Python 2.7 - Installing GraphLab creates makes my Jupyter Notebook degrade from Python 3.6 to Python 2.7 使用Jupyter Notebook在Python中进行相对导入 - Relative Import in python with Jupyter notebook 将 python 文件导入 jupyter notebook - import python file into jupyter notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM