Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error importing module: 'No module named 'example_project'' #875

Open
brylie opened this issue Jul 3, 2017 · 4 comments
Open

Error importing module: 'No module named 'example_project'' #875

brylie opened this issue Jul 3, 2017 · 4 comments
Assignees

Comments

@brylie
Copy link

brylie commented Jul 3, 2017

During the installation process, the user is instructed to run commands such as manage.py syncdb. In a Python 3.6 environment, the Django commands cannot import the example_project module.

How can I set up the example project in a Python 3.6 environment?

Steps to reproduce

  1. clone this repository
  2. cd into the example_project directory
  3. follow pip and npm instructions
  4. copy the settings.py.example file to settings.py
  5. run manage.py syncdb

Expected results

The database would be configured properly and the application would run.

syncdb traceback

$ python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'example_project'

runserver traceback

$ python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
July 03, 2017 - 06:17:24
Django version 1.8.18, using settings 'settings.local'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f9f1af97e18>
Traceback (most recent call last):
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 50, in get_internal_wsgi_application
    return import_string(app_path)
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/site-packages/django/utils/module_loading.py", line 26, in import_string
    module = import_module(module_path)
  File "/home/brylie/anaconda3/envs/django-timepiece/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'example_project'
@surfer190
Copy link

See #869

@luckygogreen
Copy link

i have the same problem!
ubuntu18.04 python 3.8 django3.0

@ttitov
Copy link

ttitov commented Jul 13, 2020

I have the same problem:

Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
  Active: failed (Result: exit-code) since Mon 2020-07-13 10:51:00 UTC; 31min ago
 Process: 2548 ExecStart=/home/project_name/project/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock project_name.wsgi:application (code=exited, status=3)
Main PID: 2548 (code=exited, status=3)

Jul 13 10:50:59 134-0-119-29.xen.vps.regruhosting.ru gunicorn[2548]:   File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
Jul 13 10:50:59 134-0-119-29.xen.vps.regruhosting.ru gunicorn[2548]: ModuleNotFoundError: No module named 'project_name'
Jul 13 10:50:59 134-0-119-29.xen.vps.regruhosting.ru gunicorn[2548]: [2020-07-13 10:50:59 +0000] [2553] [INFO] Worker exiting (pid: 2553)
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru gunicorn[2548]: [2020-07-13 10:51:00 +0000] [2548] [INFO] Shutting down: Master
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru gunicorn[2548]: [2020-07-13 10:51:00 +0000] [2548] [INFO] Reason: Worker failed to boot.
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru systemd[1]: gunicorn.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru systemd[1]: gunicorn.service: Start request repeated too quickly.
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jul 13 10:51:00 134-0-119-29.xen.vps.regruhosting.ru systemd[1]: Failed to start gunicorn daemon.

@panatale1
Copy link
Collaborator

i have the same problem! ubuntu18.04 python 3.8 django3.0

That's because Python 3.8 and Django 3.0 are not supported. In the next couple weeks, though, look for a package called django-timepiece3 that will support Python 3.8+ and Django 4.2+

@panatale1 panatale1 self-assigned this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants