Python error “ImportError: No module named”

后端 未结 29 2960
野的像风
野的像风 2020-11-22 07:46

Python is installed in a local directory.

My directory tree looks like this:

(local directory)/site-packages/toolkit/interface.py

29条回答
  •  迷失自我
    2020-11-22 07:58

    This worked for me: Created __init__.py file inside parent folder (in your case, inside site-packages folder). And imported like this:

    from site-packages.toolkit.interface import interface
    

    Hope it will be useful for you as well !

提交回复
热议问题