Cannot run manage.py with remote interpreter

I use a docker-compose based remote interpreter for a Django project. I completely reinstalled Docker and PyCharm when my previous setup failed to restart containers and often failed to connect to the `web` container.

Now things are better, but using `Run manage.py Task` (Alt+R) results in:

Failed to get real commands on module "my_app": python process died with code 1: 
Traceback (most recent call last):
  File "/opt/.pycharm_helpers/pycharm/_jb_manage_tasks_provider.py", line 25, in <module>
    django.setup()
  File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 19, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 82, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.9/site-packages/django/conf/__init__.py", line 63, in _setup
    raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Under "Languages & Frameworks | Django", "Settings" points to the appropriate `settings.py`, "Manage Script" point to `manage.py`. I have no environment variables set.

The "Python Interpreter" of my remote interpreter is set to the correct path inside the container. No environment variables are set their either.

I activates Docker-Compose v2 in Docker Desktop and under "Preferences | Build, Execution, Deployment | Docker | Tools".

6 comments
Comment actions Permalink

Hello,

there is a confirmed regression https://youtrack.jetbrains.com/issue/PY-56330/Tools-Run-managepy-Task-fails-with-javalangIllegalArgumentException-with-Docker-Compose-Interpreter please vote for it in order to be updated on resolution. 

 

For now, you can install the previous version 2022.1.4 https://www.jetbrains.com/pycharm/download/other.html

 

I apologize for the inconvenience.   

0
Comment actions Permalink

Thanks for your reply. Are you sure that's the same problem? The issue has a Java error attached while mine is a Python error? Where would I have to find the Java error message?

0
Comment actions Permalink

In  ***Help | Collect logs and Diagnostic Data***, there is an idea.log you may upload it to  the FTP

https://uploads.jetbrains.com/ and please let me know the filename. 

0
Comment actions Permalink

Thank you. I uploaded the file as 

Upload id: 2022_09_28_NoBpo3YFmQRDYNJKYWneZx (file: pycharm-logs-20220928-17183210380189593920817460.zip)

0
Comment actions Permalink

Antonina Belianskaya Alexander J Ulmer

 

I'm getting the same error:

Failed to get real commands on module "djangodocker-master": python process died with code 1: 
Traceback (most recent call last):
  File "/opt/.pycharm_helpers/pycharm/_jb_manage_tasks_provider.py", line 25, in <module>
    django.setup()
  File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 22, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python3.6/site-packages/django/conf/__init__.py", line 39, in _setup
    % (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Is there a resolution to this?

0
Comment actions Permalink

Please report it to https://youtrack.jetbrains.com/issues/PY and provide the following information:

1) Is it reproducible in a new project?

2) Is it reproducible with a local interpreter?

3) Do you have Django enabled in Settings/Preferences | Languages & Frameworks | Django?

0

Please sign in to leave a comment.