Cannot run manage.py runserver command after upgrade to latest version #663

Closed
opened 2025-12-29 16:24:31 +01:00 by adam · 4 comments
Owner

Originally created by @jbro209070 on GitHub (Jan 24, 2017).

I upgraded to the latest version from version 1.8.2 from version 1.7.2 r1. I used the method of cloning the git repository. Once I upgraded I tried to use the run manage.py runserver command that is saved in the command history on my VM and now I am getting an import error.

ImportError: No module named packaging.version

netbox import error

how do i fix this problem?

Thanks

Originally created by @jbro209070 on GitHub (Jan 24, 2017). I upgraded to the latest version from version 1.8.2 from version 1.7.2 r1. I used the method of cloning the git repository. Once I upgraded I tried to use the run manage.py runserver command that is saved in the command history on my VM and now I am getting an import error. ImportError: No module named packaging.version ![netbox import error](https://cloud.githubusercontent.com/assets/20539182/22266238/d24c0bbc-e244-11e6-91f1-7ddf54160cfe.PNG) how do i fix this problem? Thanks
adam closed this issue 2025-12-29 16:24:32 +01:00
Author
Owner

@dietervanhoutte commented on GitHub (Jan 24, 2017):

./manage.py migrate
Traceback (most recent call last):
  File "./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 "/opt/netbox/netbox/dcim/models.py", line 14, in <module>
    from extras.rpc import RPC_CLIENTS
  File "/opt/netbox/netbox/extras/rpc.py", line 1, in <module>
    from ncclient import manager
  File "/usr/local/lib/python2.7/dist-packages/ncclient/manager.py", line 22, in <module>
    from ncclient import operations
  File "/usr/local/lib/python2.7/dist-packages/ncclient/operations/__init__.py", line 16, in <module>
    from ncclient.operations.rpc import RPC, RPCReply, RPCError, RaiseMode
  File "/usr/local/lib/python2.7/dist-packages/ncclient/operations/rpc.py", line 20, in <module>
    from ncclient.transport import SessionListener
  File "/usr/local/lib/python2.7/dist-packages/ncclient/transport/__init__.py", line 18, in <module>
    from ncclient.transport.ssh import SSHSession
  File "/usr/local/lib/python2.7/dist-packages/ncclient/transport/ssh.py", line 26, in <module>
    import paramiko
  File "/usr/local/lib/python2.7/dist-packages/paramiko/__init__.py", line 30, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 33, in <module>
    from cryptography.hazmat.backends import default_backend
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
    import pkg_resources
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named packaging.version

Having the same issue here while installing the latest GIT version.

@dietervanhoutte commented on GitHub (Jan 24, 2017): ``` ./manage.py migrate Traceback (most recent call last): File "./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 "/opt/netbox/netbox/dcim/models.py", line 14, in <module> from extras.rpc import RPC_CLIENTS File "/opt/netbox/netbox/extras/rpc.py", line 1, in <module> from ncclient import manager File "/usr/local/lib/python2.7/dist-packages/ncclient/manager.py", line 22, in <module> from ncclient import operations File "/usr/local/lib/python2.7/dist-packages/ncclient/operations/__init__.py", line 16, in <module> from ncclient.operations.rpc import RPC, RPCReply, RPCError, RaiseMode File "/usr/local/lib/python2.7/dist-packages/ncclient/operations/rpc.py", line 20, in <module> from ncclient.transport import SessionListener File "/usr/local/lib/python2.7/dist-packages/ncclient/transport/__init__.py", line 18, in <module> from ncclient.transport.ssh import SSHSession File "/usr/local/lib/python2.7/dist-packages/ncclient/transport/ssh.py", line 26, in <module> import paramiko File "/usr/local/lib/python2.7/dist-packages/paramiko/__init__.py", line 30, in <module> from paramiko.transport import SecurityOptions, Transport File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 33, in <module> from cryptography.hazmat.backends import default_backend File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module> import pkg_resources File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 70, in <module> import packaging.version ImportError: No module named packaging.version ``` Having the same issue here while installing the latest GIT version.
Author
Owner

@jeremystretch commented on GitHub (Jan 24, 2017):

This does not appear to be a NetBox bug. If you'd like assistance with upgrading, please post to the mailing list.

@jeremystretch commented on GitHub (Jan 24, 2017): This does not appear to be a NetBox bug. If you'd like assistance with upgrading, please post to the [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss).
Author
Owner

@jbro209070 commented on GitHub (Jan 25, 2017):

This is for dietervanhoutte, since we were so quickly shut down without even a comment as to why it may not be working.

Uninstall pip:
sudo apt-get purge python pip

Re-install pip:
curl https://bootstrap.pypa.io/get-pip.py | sudo python

When you try to run your web server it will tell you to run this command:

python manage.py migrate

After this netbox will start working as intended.

@jbro209070 commented on GitHub (Jan 25, 2017): This is for dietervanhoutte, since we were so quickly shut down without even a comment as to why it may not be working. Uninstall pip: sudo apt-get purge python pip Re-install pip: curl https://bootstrap.pypa.io/get-pip.py | sudo python When you try to run your web server it will tell you to run this command: python manage.py migrate After this netbox will start working as intended.
Author
Owner

@dietervanhoutte commented on GitHub (Jan 25, 2017):

Hi @jbro209070,

At the end I've managed to fix it already by your actions mentioned yesterday evening.

Thanks to add it to this topic as it might help other people as well.

D

@dietervanhoutte commented on GitHub (Jan 25, 2017): Hi @jbro209070, At the end I've managed to fix it already by your actions mentioned yesterday evening. Thanks to add it to this topic as it might help other people as well. D
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#663