【发布时间】:2021-07-10 13:19:24
【问题描述】:
但我仍然无法解决此问题。可能是因为其他问题太技术性了。
我做了以下
a) 我启动了 jupyter notebook(将文件保存在桌面)
b) 导入常规包,如 Pandas、Numpy、Scipy 等。
c) 后来我尝试导入 Utils 和 Generators 包,但它抛出了错误。
pip install Utils #success
pip install Generators #success
pip list-v #returned the below location
utils 1.0.1 c:\users\test\appdata\local\continuum\anaconda3\lib\site-packages pip
generators 2020.4.27 c:\users\test\appdata\local\continuum\anaconda3\lib\site-packages pip
When I tried importing `Utils` and `Generators` package, I get the same error as well
import psycopg2
import pandas as pd
import numpy as np
import Utils
import Generators
ModuleNotFoundError: No module named 'Utils'
ModuleNotFoundError: No module named 'Generators'
导入Utils 包是否需要任何其他文件?
为什么人们经常谈论成功导入utils的项目目录?我只是想像Pandas 一样导入它;不关心项目目录。我刚刚启动了一个 jupyter notebook 并尝试安装 Utils 包
如何成功导入这些包?这些包不能像pandas这样的常规包一样导入吗?因为这些包我都是全新安装的,而且都导入成功了
我还通过输入import python_utils 尝试了此post 中的建议,但没有帮助
任何关于如何解决这个问题的教程或步骤对我来说真的很有帮助。
【问题讨论】:
标签: python python-3.x module pip importerror