urls error

36 views
Skip to first unread message

Ioannis Mavroudis

unread,
Jun 16, 2020, 4:30:43 PM6/16/20
to OHC-OPAL
Congratulations on your excellent work. I try to install plugins, but I am always getting the same error.

 from django.conf.urls import patterns, url
ImportError: cannot import name 'patterns' from 'django.conf.urls' (C:\Users\ioann\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\urls\__init__.py)

Can you please help?
I tried solutions found online, but with no luck.
Thank you

David Miller

unread,
Jun 17, 2020, 7:55:24 AM6/17/20
to Ioannis Mavroudis, OHC-OPAL
The literal cause of this error can be understood by looking at the contents of the file C:\Users\ioann\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\urls\__init__.py you will likely discover that there is no variable or function called patterns in that file.

More generally, Django changed the naming and location of it's url code in a previous version.
It is highly likely that the code  

from django.conf.urls import patterns, url 

is incompatible with the version of Django you have installed.

Best

--
You received this message because you are subscribed to the Google Groups "OHC-OPAL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ohc-opal+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ohc-opal/681f2e2d-d1bc-4882-810a-309ae7b649cao%40googlegroups.com.


--
David Miller
Open Health Care

Ioannis Mavroudis

unread,
Jun 17, 2020, 9:03:09 AM6/17/20
to OHC-OPAL
Thank you very much. I have tried with different versions, which one should I have installed?

Thanks again


Τη Τετάρτη, 17 Ιουνίου 2020 - 12:55:24 μ.μ. UTC+1, ο χρήστης David Miller έγραψε:
The literal cause of this error can be understood by looking at the contents of the file C:\Users\ioann\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\urls\__init__.py you will likely discover that there is no variable or function called patterns in that file.

More generally, Django changed the naming and location of it's url code in a previous version.
It is highly likely that the code  

from django.conf.urls import patterns, url 

is incompatible with the version of Django you have installed.

Best

On Tue, 16 Jun 2020 at 21:30, Ioannis Mavroudis <ioannis....@gmail.com> wrote:
Congratulations on your excellent work. I try to install plugins, but I am always getting the same error.

 from django.conf.urls import patterns, url
ImportError: cannot import name 'patterns' from 'django.conf.urls' (C:\Users\ioann\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\urls\__init__.py)

Can you please help?
I tried solutions found online, but with no luck.
Thank you

--
You received this message because you are subscribed to the Google Groups "OHC-OPAL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ohc-...@googlegroups.com.

David Miller

unread,
Jun 17, 2020, 11:03:35 AM6/17/20
to Ioannis Mavroudis, OHC-OPAL
The version of Django that installs when you install Opal will work with that version of Opal.
A clean install as per the documentation will get you sensible versions.

It is possible that other code you try to run is incompatible with the latest version of either Django/Opal/ anything else. 

Without knowing where the code you pasted comes from, it's impossible to say what versions of things it expects.

Best 

To unsubscribe from this group and stop receiving emails from it, send an email to ohc-opal+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ohc-opal/1e4df6a4-80c9-4456-a02f-97d94d0f09d5o%40googlegroups.com.

Ioannis Mavroudis

unread,
Jun 18, 2020, 4:22:13 AM6/18/20
to OHC-OPAL
Dear David,

Thank you very much for your help. I tried in a new venv but when I try to install a plugin, e.g. ons I am getting the same error.
I tried to change the url patterns to a list but then it says apps dont start yet.

David Miller

unread,
Jun 18, 2020, 4:27:01 AM6/18/20
to Ioannis Mavroudis, OHC-OPAL
Morning, 

What literal plugin are you attempting to install? Do you have a link to it?
Is the code you're working on that is causing the error online somewhere?

--
You received this message because you are subscribed to the Google Groups "OHC-OPAL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ohc-opal+u...@googlegroups.com.

Ioannis Mavroudis

unread,
Jun 18, 2020, 4:45:32 AM6/18/20
to OHC-OPAL
I tried with the opal-observations and the opal-dashboard. I installed them with pip, I added them on installed apps, but when I try to migrate I am getting these errors.
I tried to install the django booking plugin and I didn't have any problems.

Thank you again

David Miller

unread,
Jun 18, 2020, 5:42:13 AM6/18/20
to Ioannis Mavroudis, OHC-OPAL
It's generally better to try and do one thing at a time if it's going wrong.
I would try only installing the observations plugin. 
For instance, I would try installing it in a clean opal application created by startproject to check that the issue is not something in the application you're working on.

--
You received this message because you are subscribed to the Google Groups "OHC-OPAL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ohc-opal+u...@googlegroups.com.

Ioannis Mavroudis

unread,
Jun 18, 2020, 10:38:47 AM6/18/20
to OHC-OPAL
Thanks,
I tried to install obs on a fresh opal installation, but unfortunately I am getting the same error. I also tried in Linux and windows and the same error again.
Thank you


Τη Πέμπτη, 18 Ιουνίου 2020 - 10:42:13 π.μ. UTC+1, ο χρήστης David Miller έγραψε:
It's generally better to try and do one thing at a time if it's going wrong.
I would try only installing the observations plugin. 
For instance, I would try installing it in a clean opal application created by startproject to check that the issue is not something in the application you're working on.

On Thu, 18 Jun 2020 at 09:45, Ioannis Mavroudis <ioannis....@gmail.com> wrote:
I tried with the opal-observations and the opal-dashboard. I installed them with pip, I added them on installed apps, but when I try to migrate I am getting these errors.
I tried to install the django booking plugin and I didn't have any problems.

Thank you again

--
You received this message because you are subscribed to the Google Groups "OHC-OPAL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ohc-...@googlegroups.com.

Fred Kingham

unread,
Jun 18, 2020, 4:06:45 PM6/18/20
to Ioannis Mavroudis, OHC-OPAL
Hi Ioannis,
 I think it could be because some of the pypi repos for the plugins are out of date.

 If you install with 
pip install -e git+https://github.com/openhealthcare/opal-obser...@v0.5.0#egg=opal_observations

Do you still have the same issue? 

I'm going to review the pypi modules tomorrow. Those that do not support django 2.0 should declare it more explicitly.

 Thanks,

 Fred

To unsubscribe from this group and stop receiving emails from it, send an email to ohc-opal+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/ohc-opal/02e16a7e-3e8c-450b-9ee8-1a3c9b615b55o%40googlegroups.com.


--
Fred Kingham
Open Health Care

Ioannis Mavroudis

unread,
Jun 19, 2020, 5:35:56 AM6/19/20
to OHC-OPAL
Dear Fred,

Thank you very much. It finally worked.
Best,
Ioannis


Τη Πέμπτη, 18 Ιουνίου 2020 - 9:06:45 μ.μ. UTC+1, ο χρήστης Fred Kingham έγραψε:
Hi Ioannis,
 I think it could be because some of the pypi repos for the plugins are out of date.

 If you install with 
Reply all
Reply to author
Forward
0 new messages