Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.5.0中未加载名为/Parent的模块_Python_Python 3.x - Fatal编程技术网

Python 3.5.0中未加载名为/Parent的模块

Python 3.5.0中未加载名为/Parent的模块,python,python-3.x,Python,Python 3.x,我的包有以下结构: /code_trou __init__.py Main.py Menu.py /postprocessing /preprocessing Mesh.py Point.py /processing FDM.py /tools dllmrg.py errormrg.py /__pycache_ errormrg.cpyth

我的包有以下结构:

/code_trou
    __init__.py
    Main.py
    Menu.py
    /postprocessing
    /preprocessing
    Mesh.py
    Point.py
    /processing
        FDM.py
    /tools
        dllmrg.py
        errormrg.py
        /__pycache_
           errormrg.cpython-35.pyc
当我使用以下命令执行我的
Main.py
时:

from tools.errormrg import *
from tools.dllmrg import *
我有以下错误:
“没有名为‘工具’的模块”

当我使用以下命令执行
Point.py
时也是如此:

from tools.errormrg import *
from tools.dllmrg import *
对于
Point.py
我尝试了,但似乎不起作用:我在执行
Point.py
时遇到错误
“父模块“”未加载,无法执行相对导入”
,改为:

from ..tools.dllmrg import *

使目录成为Python包的原因是存在一个
\uuuu init\uuuuu.py
文件。您的
工具
处理
目录中没有此类文件,因此Python不会将它们识别为包


您需要在
/tools
中使用
\uuuu init\uuuuuuuuuuupy
,以使该模块也成为一个模块(其他子模块也是如此)。