Can't upgrade "ImportError: No module named util"

2,238 views
Skip to first unread message

Aguay

unread,
Mar 6, 2017, 7:53:33 AM3/6/17
to NetBox
Hi,

I tried to upgrade my netbox instance using "upgrade.sh" but i was not able to finish the upgrade.

Traceback (most recent call last):
 
File "./netbox/manage.py", line 10, in <module>
    execute_from_command_line
(sys.argv)
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility
.execute()
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 341, in execute
    django
.setup()
 
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps
.populate(settings.INSTALLED_APPS)
 
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
    app_config
.import_models(all_models)
 
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 199, in import_models
   
self.models_module = import_module(models_module_name)
 
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__
(name)
 
File "/usr/lib/python2.7/dist-packages/mptt/models.py", line 14, in <module>
   
from mptt.fields import TreeForeignKey, TreeOneToOneField, TreeManyToManyField
 
File "/usr/lib/python2.7/dist-packages/mptt/fields.py", line 9, in <module>
   
from mptt.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
 
File "/usr/lib/python2.7/dist-packages/mptt/forms.py", line 7, in <module>
   
from django.forms.util import ErrorList
ImportError: No module named util
Traceback (most recent call last):
 
File "./netbox/manage.py", line 10, in <module>
    execute_from_command_line
(sys.argv)
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility
.execute()
 
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 341, in execute
    django
.setup()
 
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps
.populate(settings.INSTALLED_APPS)
 
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
    app_config
.import_models(all_models)
 
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 199, in import_models
   
self.models_module = import_module(models_module_name)
 
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__
(name)
 
File "/usr/lib/python2.7/dist-packages/mptt/models.py", line 14, in <module>
   
from mptt.fields import TreeForeignKey, TreeOneToOneField, TreeManyToManyField
 
File "/usr/lib/python2.7/dist-packages/mptt/fields.py", line 9, in <module>
   
from mptt.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
 
File "/usr/lib/python2.7/dist-packages/mptt/forms.py", line 7, in <module>
   
from django.forms.util import ErrorList
ImportError: No module named util


The pip requirements installation not failed.

Any Help ?

Jeremy Stretch

unread,
Mar 6, 2017, 9:25:58 AM3/6/17
to Aguay, NetBox
Looks like an incompatibility between your Django and mptt libraries. Could you post the output of `pip freeze` please?

Jeremy

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/18782957-49f8-4772-8587-936173e1af42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aguay

unread,
Mar 6, 2017, 10:31:57 AM3/6/17
to NetBox
 ~ pip freeze
appdirs
==1.4.2
cffi
==1.9.1
chardet
==2.3.0
colorama
==0.3.7
coreapi
==2.2.4
coreschema
==0.0.4
cryptography
==1.7.2
Django==1.10.6
django
-debug-toolbar==1.7
django
-filter==1.0.1
django
-mptt==0.8.7
django
-rest-swagger==0.3.10
django
-tables2==1.4.1
djangorestframework
==3.5.4
graphviz
==0.5.2
html5lib
==0.999999999
idna
==2.4
itypes
==1.1.0
Jinja2==2.9.5
lxml
==3.7.3
Markdown==2.6.8
MarkupSafe==0.23
natsort
==5.0.2
ncclient
==0.5.2
netaddr
==0.7.18
openapi
-codec==1.3.1
packaging
==16.8
paramiko
==2.1.2
psycopg2
==2.7
py
-gfm==0.1.3
pyasn1
==0.2.3
pycparser
==2.17
pycrypto
==2.6.1
pyparsing
==2.2.0
PyYAML==3.12
simplejson
==3.10.0
six
==1.10.0
sqlparse
==0.2.3
uritemplate
==3.0.0
urllib3
==1.20
webencodings
==0.5
xmltodict
==0.10.2

Here the pip freeze output.

Aguay
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.

Jeremy Stretch

unread,
Mar 6, 2017, 5:34:07 PM3/6/17
to Aguay, NetBox
That's very strange. I have it running without issue on Django 1.10.6 and django-mptt 0.8.7. The error you posted indicates:

from django.forms.util import ErrorList

But I'm pretty sure that should be "django.forms.utils" (with an s). You might be running an outdated version of django-mptt. Can you try re-installing it?

pip install --force-reinstall django-mptt

To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/46f5ba20-1d0d-4649-9e54-cea2606660fd%40googlegroups.com.

Aguay

unread,
Mar 7, 2017, 3:09:44 AM3/7/17
to NetBox
Yes that's   what i saw when i tried to find why i was not able to upgrade.

I realized that i tried to install django-mptt with debian packages. Which are, of course, outdated. 
Then i removed debian package and re-launch force install

Finally i was able to upgrade successfully. 

Thanks for the help
Reply all
Reply to author
Forward
0 new messages