Closed davidtingsu closed 4 months ago
phonenumberslite
provides the phonenumbers package.
/tmp/tmp.8mztCz8Hch % python -m venv venv
/tmp/tmp.8mztCz8Hch % . venv/bin/activate
(venv) /tmp/tmp.8mztCz8Hch % pip install 'django-phonenumber-field[phonenumberslite]'
Collecting django-phonenumber-field[phonenumberslite]
Downloading django_phonenumber_field-7.3.0-py3-none-any.whl.metadata (3.1 kB)
Collecting Django>=3.2 (from django-phonenumber-field[phonenumberslite])
Using cached Django-5.0.6-py3-none-any.whl.metadata (4.1 kB)
Collecting phonenumberslite>=7.0.2 (from django-phonenumber-field[phonenumberslite])
Using cached phonenumberslite-8.13.39-py2.py3-none-any.whl.metadata (11 kB)
Collecting asgiref<4,>=3.7.0 (from Django>=3.2->django-phonenumber-field[phonenumberslite])
Using cached asgiref-3.8.1-py3-none-any.whl.metadata (9.3 kB)
Collecting sqlparse>=0.3.1 (from Django>=3.2->django-phonenumber-field[phonenumberslite])
Using cached sqlparse-0.5.0-py3-none-any.whl.metadata (3.9 kB)
Using cached Django-5.0.6-py3-none-any.whl (8.2 MB)
Using cached phonenumberslite-8.13.39-py2.py3-none-any.whl (470 kB)
Downloading django_phonenumber_field-7.3.0-py3-none-any.whl (66 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.5/66.5 kB 2.7 MB/s eta 0:00:00
Using cached asgiref-3.8.1-py3-none-any.whl (23 kB)
Using cached sqlparse-0.5.0-py3-none-any.whl (43 kB)
Installing collected packages: phonenumberslite, sqlparse, asgiref, Django, django-phonenumber-field
Successfully installed Django-5.0.6 asgiref-3.8.1 django-phonenumber-field-7.3.0 phonenumberslite-8.13.39 sqlparse-0.5.0
[notice] A new release of pip is available: 24.0 -> 24.1
[notice] To update, run: pip install --upgrade pip
(venv) /tmp/tmp.8mztCz8Hch % python
Python 3.12.4 (main, Jun 7 2024, 06:33:07) [GCC 14.1.1 20240522] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import phonenumbers
>>>
I think your issue is that phonenumberlite
was not installed in the environment running the migrations (or the venv not activated).
I installed django-phonenumber-field with phonenumberslite and when I ran the migration I got No module named phonenumbers. My work around was just to install
phonenumbers
Reproduction steps: