Error Unable to import path from django urls

+1 vote

I"m trying to run command:

from django.urls import path

Getting error:

Traceback (most recent call last): File "< stdin >", line 1, in ImportError: cannot import name 'path'

Any help?

Jul 2, 2020 in Python by kartik
• 37,520 points
11,453 views

1 answer to this question.

+1 vote

Hello @kartik,

You need Django version 2

pip install --upgrade django
pip3 install --upgrade django

python -m django --version # 2.0.2
python3 -m django --version # >3

Hope it works!!

Thank You!!

answered Jul 2, 2020 by Niroj
• 82,840 points
Should we use all this codes
I have a small doubt . So I just asked

Hello,

No, it depend on python version you are using

Related Questions In Python

0 votes
1 answer
0 votes
2 answers

How to Import a module from a relative path?

If i understand your question correct then ...READ MORE

answered Dec 14, 2020 in Python by Tanja84DK

edited Dec 15, 2020 1,653 views
0 votes
1 answer

Unable to take input from user in Python

num = input("enter number") print(num) READ MORE

answered May 1, 2018 in Python by aayushi
• 750 points
798 views
0 votes
1 answer

How to temporarily disable a foreign key constraint in MySQL?

Hello @kartik, To turn off foreign key constraint ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
2,510 views
0 votes
1 answer

How do I use Django templates without the rest of Django?

Hello @kartik, Let's say you have this important ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
1,587 views
0 votes
1 answer

How to redirect to named url pattern directly from urls.py in django?

Hello @kartik, You can try this: from django.views.generic import ...READ MORE

answered Aug 12, 2020 in Python by Niroj
• 82,840 points
2,620 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP