movieweb_python icon indicating copy to clipboard operation
movieweb_python copied to clipboard

没有urls模块

Open kkdetong opened this issue 7 years ago • 9 comments
trafficstars

ImportError at / No module named urls Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.8.13 Exception Type: ImportError Exception Value: No module named urls Exception Location: /home/python/.virtualenvs/py2/local/lib/python2.7/site-packages/rest_framework/compat.py in , line 26 Python Executable: /home/python/.virtualenvs/py2/bin/python Python Version: 2.7.11 Python Path: ['/home/python/movieweb_python/movieweb', '/home/python/movieweb_python/movieweb', '/home/python/movieweb_python/movieweb/videoplay', '/home/python/movieweb_python/movieweb/movieweb', '/home/python/movieweb_python', '/home/python/.virtualenvs/py2/lib/python2.7', '/home/python/.virtualenvs/py2/lib/python2.7/plat-x86_64-linux-gnu', '/home/python/.virtualenvs/py2/lib/python2.7/lib-tk', '/home/python/.virtualenvs/py2/lib/python2.7/lib-old', '/home/python/.virtualenvs/py2/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/home/python/.virtualenvs/py2/local/lib/python2.7/site-packages', '/home/python/.virtualenvs/py2/lib/python2.7/site-packages'] Server time: 星期三, 31 一月 2018 08:22:52 +0000

kkdetong avatar Jan 31 '18 08:01 kkdetong

image

eli95 avatar Jan 31 '18 08:01 eli95

@kkdetong @ELI95 解决了说下。 可以试下修改 urls.py 文件: 1。 default

改为:

default

2。 default

改为:

default

hanyucd avatar Jan 31 '18 10:01 hanyucd

image

eli95 avatar Feb 01 '18 01:02 eli95

@ELI95 按照作者的修改还是报错吗?

kkdetong avatar Feb 05 '18 11:02 kkdetong

@hanyucd 还是报错同样的错误

kkdetong avatar Feb 05 '18 12:02 kkdetong

确实报错,按照作者修改了 也不行 是不是django的版本问题?

dl942702882 avatar Mar 06 '18 08:03 dl942702882

@dl942702882 也有可能是 Django 版本问题,我安装的 django Version 是 1.8.13,python Version 是 2.7 你试着换下我这版本看看。

hanyucd avatar Mar 07 '18 07:03 hanyucd

django Version 1.8.13, python Version 2.7 同样报错

File "/Users/wuchungang/Library/Python/2.7/lib/python/site-packages/rest_framework/viewsets.py", line 25, in <module>
    from django.urls import NoReverseMatch
ImportError: No module named urls

chadspring avatar Mar 16 '19 09:03 chadspring

pip2 install djangorestframework==3.5.4

owiofwm2i avatar Jul 10 '19 08:07 owiofwm2i