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,490 points
2,972 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,580 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 14, 2020 65 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
189 views
0 votes
1 answer

Shortest path from source to and from a negative cycle using Bellman Ford in Python

class NegativeWeightFinder: def __init__(self, graph: nx.Graph): ...READ MORE

answered Nov 13, 2018 in Python by Nymeria
• 3,520 points
573 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,580 points
618 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,580 points
256 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,580 points
392 views