问答 / 0 / 1 / 创建于 2年前
![]
当python检测到一个目录下存在__init__.py文件时,python就会把它当成一个模块(module)。
__init__.py可以是一个空文件,也可以有非常丰富的内容。
d:\>pip install utils Collecting utils Downloading utils-1.0.1-py2.py3-none-any.whl (21 kB) Installing collected packages: utils Successfully installed utils-1.0.1 d:\>python Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from utils import get_ACC_NMI Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'get_ACC_NMI' from 'utils' (C:\Software\Python\lib\site-packages\utils\__init__.py)
There's no `get_ACC_NMI` defined in library `utils`.
from utils import get_ACC_NMI
get_ACC_NMI
我要举报该,理由是:
当python检测到一个目录下存在__init__.py文件时,python就会把它当成一个模块(module)。
__init__.py可以是一个空文件,也可以有非常丰富的内容。
There's no `get_ACC_NMI` defined in library `utils`.
from utils import get_ACC_NMI, orget_ACC_NMI