Migration Import error : cannot import name 'path'

Hi, I am new to Pythonanywhere and I am trying to deploy my sample work. So I pulled my repository from Git and now trying to run Migration . When I run it, I am getting Import Error: Cannot import name 'path' . Could anyone please help me out with this?

Hi there, do any of the tips here help?

In my djangonautic/ (which is my main project app) even after defining "from django.urls import path", the whole site page says cannot import name 'path'

I've double checked and I know the fact that django version 1.11 doesn't have "path" but I've used django version 2.0 on my local machine as well as on the pythonanywhere,

you can see it here

Your site appears to be running OK now -- did you work out what the problem was?

hi, i am also facing the same issue. you can see it here

hmm- seems like your site is working now? Perhaps it needed a reload?

Can someone guide me I'm also facing the same issue? When I checked my bash console has python version2.7.6 and in my system console, it has 3.7.0version. what and how should I do an update. plz check and review at thankq.

Which version of Django is your code written for? When I visit your site I get an error message from Django 1.11.14, but the error message is happening at a line where you have

from django.urls import path

...which I believe is what you should do in Django 2.0. If your code is for Django 2.0, then that's the version you need to install in your virtualenv.

@giles i tried to update but it seems like something gone wrong. when I ls my files stored in, in a domain). I'm unable to understand what my actual problem is? and also I defined name path. plz look below what my bash console looks like.

12:19 ~ $ pwd
12:54 ~ $ workon my-virtualenv
(my-virtualenv) 12:59 ~ $ pip install django
Looking in links: /usr/share/pip-wheels
Requirement already satisfied: django in ./.virtualenvs/my-virtualenv/lib/python3.6/site-packages (2.0.7)
Requirement already satisfied: pytz in ./.virtualenvs/my-virtualenv/lib/python3.6/site-packages (from django) (2018.5)
(my-virtualenv) 13:00 ~ $ ls
(my-virtualenv) 13:08 ~ $ cd
(my-virtualenv) 13:09 ~/ (master)$ ls
blog  db.sqlite3  mytestsite  rahulbu  static
(my-virtualenv) 13:10 ~/ (master)$ pwd

Your website is using the virtualenv called, not the one called mysite. If you start a console in that virtualenv (either by running workon or by clicking the link on the "Web" page, just below where you specify the virtualenv) and then run

pip install Django>=2.0

...then that should upgrade you to a version that will work. Once you've done that, reload the website on the "Web" page.

nothing happening when i tried in virtualenv. it's waiting for another command.

( 10:16 ~/ (master)$ pip install Django>=2.0
( 13:40 ~/ (master)$ pip install Django>=2.0
( 14:01 ~ $ pip install Django>=2.0
( 14:02 ~ $

hey@giles it finally worked but by using this command

pip install --upgrade django==2.7.0

> is a redirect operator in bash. If you don't quote that, then it's not doing what you think it is. You probably have a file called =2.0 in your home directory that contains the output for pip install Django which the the command you actually ran.