Import Error: No module named django

后端 未结 7 1577
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 07:34

I am using centos linux.

I had python 2.6 with django and now i upgraded to python 2.7.
Python 2.6 is located in /usr/lib/python2.6.
Python 2.7 is located i

7条回答
  •  眼角桃花
    2020-11-30 08:16

    Try printing sys.path to see what's in your path. Django need to be in one of the dirs listed. Example on Windows:

    >>> import sys
    >>> for p in sys.path: print p
    
    C:\Python27\Lib\idlelib
    C:\Windows\system32\python27.zip
    C:\Python27\DLLs
    C:\Python27\lib
    C:\Python27\lib\plat-win
    C:\Python27\lib\lib-tk
    C:\Python27
    C:\Python27\lib\site-packages
    >>> 
    

提交回复
热议问题