且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从父文件夹导入模块

更新时间:2022-12-08 13:32:58

问题似乎与该模块位于父目录或类似内容无关.

It seems that the problem is not related to the module being in a parent directory or anything like that.

您需要将包含ptdraft的目录添加到PYTHONPATH

You need to add the directory that contains ptdraft to PYTHONPATH

您说import nib与您一起工作,这可能意味着您已将ptdraft本身(而不是其父项)添加到PYTHONPATH中.

You said that import nib worked with you, that probably means that you added ptdraft itself (not its parent) to PYTHONPATH.