question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: No module named 'phonenumbers'

See original GitHub issue

Hi!

I’m trying to start a project from the beginning with 1.6rc1 version with python 3.5.0

virtualenv venv 
source venv/bin/activate
pip install django-oscar==1.6rc1
django-admin.py startproject mycommerce .

… Edit settings with https://django-oscar.readthedocs.io/en/latest/internals/getting_started.html

Everything is the same for django 2.0 except for the urls:

from django.contrib import admin
from django.urls import path, include
from oscar.app import application

urlpatterns = [
    path('i18n/', include('django.conf.urls.i18n')),

    # The Django admin is not officially supported; expect breakage.
    # Nonetheless, it's often useful for debugging.
    path('admin/', include(admin.site.urls)),

    path('', include(application.urls)),
]

But when i execute python manage.py showmigrations i get the error ImportError: No module named 'phonenumbers'.

This is the complete traceback:

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/Users/andres/mycommerce/venv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/oscar/apps/address/models.py", line 1, in <module>
    from oscar.apps.address.abstract_models import (
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/oscar/apps/address/abstract_models.py", line 11, in <module>
    from phonenumber_field.modelfields import PhoneNumberField
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/phonenumber_field/modelfields.py", line 8, in <module>
    from phonenumber_field import formfields
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/phonenumber_field/formfields.py", line 9, in <module>
    from phonenumber_field.phonenumber import to_python
  File "/Users/andres/mycommerce/venv/lib/python3.5/site-packages/phonenumber_field/phonenumber.py", line 5, in <module>
    import phonenumbers
ImportError: No module named 'phonenumbers'

Thanks in advance 😃.

Andrés.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
craigloftuscommented, Apr 23, 2018

@Andruten Thanks for reporting the issue.

Whilst pip install phonenumbers will fix the immediate symptom, there is a problem and we’re seeing it on one of our projects as well.

2reactions
solarissmokecommented, Apr 25, 2018

See this comment from the maintainer of django-phonenumber-field. I think we just need to add phonenumbers as a dependency of Oscar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: No module named phonenumbers
Hi, i'm new with opencrm and i have this error, someone know what can i do? 2014-03-20 06:02:19898 4864 INFO ? openerp: OpenERP...
Read more >
why doesis showing, ModuleNotFoundError: No module ...
why doesis showing, ModuleNotFoundError: No module named 'phonenumbers' ... I am trying on pycharm , about the tracking the phone no.
Read more >
ImportError: No module named phonenumbers
I am using Odoo 8 in Windows 8, I installed phonenumbers using pip. But odoo says "Unable to install module "base_phone" because an...
Read more >
2021 How to Fix "No Module Named..." Error in Python
2021 How to Fix ImportError " No Module Named pkg_name" in Python! First, download the package using a terminal outside of python.
Read more >
module not found error in django project
Django Import Error: No module named apps - Stack Overflow ... If you use this command to start an app: django-admin startapp appexample...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found