ImportError: No module named urls #255

Closed
opened 2025-12-29 16:20:10 +01:00 by adam · 9 comments
Owner

Originally created by @jean-christophe-manciot on GitHub (Jul 20, 2016).

On ubuntu 16.04
Netbox commit 46da986
All python requirements satisfied

./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 353, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute
    self.check()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
    for pattern in resolver.url_patterns:
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/actionmystique/Program-Files/Ubuntu/NetBox/git-netbox/netbox/netbox/urls.py", line 32, in <module>
    url(r'^api/docs/', include('rest_framework_swagger.urls')),
  File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named urls
Originally created by @jean-christophe-manciot on GitHub (Jul 20, 2016). On ubuntu 16.04 Netbox commit 46da986 All python requirements satisfied ``` ./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 353, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 398, in execute self.check() File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 426, in check include_deployment_checks=include_deployment_checks, File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 75, in run_checks new_errors = check(app_configs=app_configs) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 23, in check_resolver for pattern in resolver.url_patterns: File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 417, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 33, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 410, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/home/actionmystique/Program-Files/Ubuntu/NetBox/git-netbox/netbox/netbox/urls.py", line 32, in <module> url(r'^api/docs/', include('rest_framework_swagger.urls')), File "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line 52, in include urlconf_module = import_module(urlconf_module) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named urls ```
adam closed this issue 2025-12-29 16:20:11 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 20, 2016):

Looks like something went wrong during installation. Please try re-installing NetBox following the documentation.

@jeremystretch commented on GitHub (Jul 20, 2016): Looks like something went wrong during installation. Please try re-installing NetBox following [the documentation](http://netbox.readthedocs.io/en/latest/).
Author
Owner

@jean-christophe-manciot commented on GitHub (Jul 20, 2016):

I did follow the original documentation at git-netbox/docs//getting-started.md instead of your online getting started which is not ready yet.

@jean-christophe-manciot commented on GitHub (Jul 20, 2016): I did follow the original documentation at git-netbox/docs//getting-started.md instead of your online [getting started](http://netbox.readthedocs.io/en/latest/getting-started.md) which is not ready yet.
Author
Owner

@jeremystretch commented on GitHub (Jul 20, 2016):

The original "getting started" guide was replaced with the current documentation a while ago. Please pull down the most recent stable release and re-install it using the current docs.

@jeremystretch commented on GitHub (Jul 20, 2016): The original "getting started" guide was replaced with the current documentation a while ago. Please pull down the most recent stable release and re-install it using the current docs.
Author
Owner

@jean-christophe-manciot commented on GitHub (Jul 20, 2016):

By original, I mean the latest from git commit 46da9866e3, 07/15/2016 "Added group to VLAN view"

@jean-christophe-manciot commented on GitHub (Jul 20, 2016): By original, I mean the latest from git commit 46da9866e37867b5506c6b8450e938976c378e1f, 07/15/2016 "Added group to VLAN view"
Author
Owner

@jeremystretch commented on GitHub (Jul 20, 2016):

The getting started doc was removed long before that commit, so I'm not sure what you were following. At any rate, this doesn't look like a bug. Please join us on IRC if you'd like assistance with reinstalling NetBox.

@jeremystretch commented on GitHub (Jul 20, 2016): The getting started doc was removed long before that commit, so I'm not sure what you were following. At any rate, this doesn't look like a bug. Please join us on IRC if you'd like assistance with reinstalling NetBox.
Author
Owner

@jean-christophe-manciot commented on GitHub (Jul 28, 2016):

Same issue with 1.3.2 (master/af5dba2e0da027da00e43ad1e8585c77ef7bd953 to be exact), following new documentation, which is the same as retired getting-started.md up to "./manage.py migrate".

@jean-christophe-manciot commented on GitHub (Jul 28, 2016): **Same issue with 1.3.2** (master/af5dba2e0da027da00e43ad1e8585c77ef7bd953 to be exact), following [new documentation](http://netbox.readthedocs.io/en/latest/installation/netbox/), which is the same as retired getting-started.md up to "./manage.py migrate".
Author
Owner

@jean-christophe-manciot commented on GitHub (Jul 28, 2016):

This issue is sourced from an incompatibility with latest django-rest-swagger:

pip show django-rest-swagger
---
Metadata-Version: 2.0
Name: django-rest-swagger
Version: 2.0.1
...
pip uninstall django-rest-swagger
...
Successfully uninstalled django-rest-swagger-2.0.1
pip install django-rest-swagger==0.3.7
...
Successfully installed django-rest-swagger-0.3.7
git-netbox/netbox# ./manage.py migrate
Operations to perform:
  Apply all migrations: dcim, sessions, admin, ipam, auth, circuits, contenttypes, extras, secrets
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying dcim.0001_initial... OK
  Applying circuits.0001_initial... OK
  Applying circuits.0002_auto_20160622_1821... OK
  Applying circuits.0003_provider_32bit_asn_support... OK
  Applying ipam.0001_initial... OK
  Applying dcim.0002_auto_20160622_1821... OK
  Applying dcim.0003_auto_20160628_1721... OK
  Applying dcim.0004_auto_20160701_2049... OK
  Applying dcim.0005_auto_20160706_1722... OK
  Applying dcim.0006_add_device_primary_ip4_ip6... OK
  Applying dcim.0007_device_copy_primary_ip... OK
  Applying dcim.0008_device_remove_primary_ip... OK
  Applying dcim.0009_site_32bit_asn_support... OK
  Applying dcim.0010_devicebay_installed_device_set_null... OK
  Applying dcim.0011_devicetype_part_number... OK
  Applying extras.0001_initial... OK
  Applying ipam.0002_vrf_add_enforce_unique... OK
  Applying ipam.0003_ipam_add_vlangroups... OK
  Applying ipam.0004_ipam_vlangroup_uniqueness... OK
  Applying ipam.0005_auto_20160725_1842... OK
  Applying secrets.0001_initial... OK
  Applying sessions.0001_initial... OK
@jean-christophe-manciot commented on GitHub (Jul 28, 2016): This issue is sourced from an incompatibility with latest django-rest-swagger: ``` pip show django-rest-swagger --- Metadata-Version: 2.0 Name: django-rest-swagger Version: 2.0.1 ... pip uninstall django-rest-swagger ... Successfully uninstalled django-rest-swagger-2.0.1 pip install django-rest-swagger==0.3.7 ... Successfully installed django-rest-swagger-0.3.7 git-netbox/netbox# ./manage.py migrate Operations to perform: Apply all migrations: dcim, sessions, admin, ipam, auth, circuits, contenttypes, extras, secrets Running migrations: Rendering model states... DONE Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying dcim.0001_initial... OK Applying circuits.0001_initial... OK Applying circuits.0002_auto_20160622_1821... OK Applying circuits.0003_provider_32bit_asn_support... OK Applying ipam.0001_initial... OK Applying dcim.0002_auto_20160622_1821... OK Applying dcim.0003_auto_20160628_1721... OK Applying dcim.0004_auto_20160701_2049... OK Applying dcim.0005_auto_20160706_1722... OK Applying dcim.0006_add_device_primary_ip4_ip6... OK Applying dcim.0007_device_copy_primary_ip... OK Applying dcim.0008_device_remove_primary_ip... OK Applying dcim.0009_site_32bit_asn_support... OK Applying dcim.0010_devicebay_installed_device_set_null... OK Applying dcim.0011_devicetype_part_number... OK Applying extras.0001_initial... OK Applying ipam.0002_vrf_add_enforce_unique... OK Applying ipam.0003_ipam_add_vlangroups... OK Applying ipam.0004_ipam_vlangroup_uniqueness... OK Applying ipam.0005_auto_20160725_1842... OK Applying secrets.0001_initial... OK Applying sessions.0001_initial... OK ```
Author
Owner

@jean-christophe-manciot commented on GitHub (Jul 28, 2016):

This happened because other softwares on my system need fresher releases than the ones described in requirements.ttx;
I probably should have used a virtualenv for netbox.

@jean-christophe-manciot commented on GitHub (Jul 28, 2016): This happened because other softwares on my system need fresher releases than the ones described in requirements.ttx; I probably should have used a virtualenv for netbox.
Author
Owner

@LatetoGitHub commented on GitHub (Oct 5, 2016):

I ran into the same issue, but I had to use version 0.3.10 to get it working, 0.3.7 didn't work for me:
pip install django-rest-swagger==0.3.10

@LatetoGitHub commented on GitHub (Oct 5, 2016): I ran into the same issue, but I had to use version 0.3.10 to get it working, 0.3.7 didn't work for me: pip install django-rest-swagger==0.3.10
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#255