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

0 votes

Tried 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??

Aug 5 in Python by kartik
• 27,780 points
110 views

1 answer to this question.

0 votes

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 # 2.0.2

Hope it helps!!

Thank You!!

answered Aug 5 by Niroj
• 59,780 points

Related Questions In Python

0 votes
1 answer

ImportError Traceback (most recent call last) ImportError: numpy.core.umath failed to import

Hi@akhtar, You need to upgrade your Numpy library. Your ...READ MORE

answered Jun 22 in Python by MD
• 57,800 points
180 views
0 votes
1 answer

How to resolve ImportError: cannot import name 'add' in python ?

There's no module called "add" in random. ...READ MORE

answered Feb 12, 2019 in Python by Mark
2,151 views
0 votes
1 answer

ImportError: cannot import name 'main' in pip

Hi@akhtar, To avoid this error, you should upgrade ...READ MORE

answered Apr 15 in Python by MD
• 57,800 points
854 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 in Python by Niroj
• 59,780 points
192 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 in Python by Niroj
• 59,780 points
83 views
0 votes
1 answer

Error:after upgrading pip: cannot import name 'main'

Hello @kartik, You must have inadvertently upgraded your ...READ MORE

answered Jun 5 in Python by Niroj
• 59,780 points
242 views