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

ModuleNotFoundError: No module named 'resource' #584

Closed
DanielHGimenez opened this issue Apr 6, 2023 · 2 comments
Closed

ModuleNotFoundError: No module named 'resource' #584

DanielHGimenez opened this issue Apr 6, 2023 · 2 comments

Comments

@DanielHGimenez
Copy link

I installed django-rq in my project and I did the setup, but when I run my project with the command python manage.py runserver I receive the following error:

Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Python311\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Python311\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Python311\Lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
    autoreload.raise_last_exception()
  File "C:\Python311\Lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "C:\Python311\Lib\site-packages\django\core\management\__init__.py", line 394, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Python311\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Python311\Lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Python311\Lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\django\apps\config.py", line 193, in create
    import_module(entry)
  File "C:\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Python311\Lib\site-packages\django_rq\__init__.py", line 3, in <module>
    from .decorators import job
  File "C:\Python311\Lib\site-packages\django_rq\decorators.py", line 1, in <module>
    from rq.decorators import job as _rq_job
  File "C:\Python311\Lib\site-packages\rq\__init__.py", line 7, in <module>
    from .worker import SimpleWorker, Worker
  File "C:\Python311\Lib\site-packages\rq\worker.py", line 6, in <module>
    import resource
ModuleNotFoundError: No module named 'resource'

I'm working on Windows 10 with Python 3.10.11

@some1ataplace
Copy link

One possible solution is to install the psutil package, which provides cross-platform access to many system functionalities, including the resource module. You can install it by running the following command in your terminal or command prompt:

pip install psutil

@gmjosack
Copy link

This is actually an issue with the rq package, not django-rq but found this while searching for the issue. It looks like it was fixed in rq/rq#948 so hopefully they'll cut a new release soon. For now I'm just using rq 1.12 until i can test on windows again.

@selwin selwin closed this as completed May 5, 2023
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

4 participants