Python error “ImportError: No module named”

后端 未结 29 2688
野的像风
野的像风 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条回答
  •  -上瘾入骨i
    2020-11-22 07:57

    On *nix, also make sure that PYTHONPATH is configured correctly, especially that it has this format:

     .:/usr/local/lib/python
    

    (Mind the .: at the beginning, so that it can search on the current directory, too.)

    It may also be in other locations, depending on the version:

     .:/usr/lib/python
     .:/usr/lib/python2.6
     .:/usr/lib/python2.7 and etc.
    

提交回复
热议问题