Python error: ImportError: cannot import name Akismet

前端 未结 6 1063
时光说笑
时光说笑 2021-02-13 20:40

I\'ve seen many similar errors, but I can\'t see a solution that applies to my particular problem.

I\'m trying to use the Akismet module which is on my PYTHONPATH, then

6条回答
  •  一生所求
    2021-02-13 21:28

    You should have the directory containing the 'akismet' directory in your path. I guess, you have added the 'akismet' directory itself to $PYTHONPATH.

    When you write:

    from akismet import Akismet
    

    Python tries to open file akismet/Akismet.py somewhere in its search path.

    All this assuming Akismet is a file and akismet is a directory. If there is an akismet.py file, then the directory containing this file should be listed in $PYTHONPATH.

提交回复
热议问题