Import Error: No module named django

后端 未结 7 1571
爱一瞬间的悲伤
爱一瞬间的悲伤 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条回答
  •  -上瘾入骨i
    2020-11-30 08:07

    To check your path, you can use the following code:

    import sys     
    print(sys.path)
    

    If you already know where django is installed, it should be easy to test if the desired directory is in your path with directory in sys.path.

    Regarding where your PYTHONPATH is defined, note that it's an environment variable, so you can check its value (if defined) with: echo $PYTHONPATH

提交回复
热议问题