ImportError when testing installation of nc_py_api

Nextcloud version (eg, 20.0.5): 29.0.0
Operating system and version (eg, Ubuntu 20.04): windows 11 (WSL Ubuntu 20.4)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.52
PHP version (eg, 7.4): 8.1.2

The issue you are facing:
I want to developp an app that can execute Python functions imported from a Python project.
After following this tutorial (Setting up dev environment — NcPyApi 0.11.0 documentation) to install nc_py_api, I cannot validate the installation.
At step 12, I execute:

python3 -m pytest

And I obtain:

ImportError while loading conftest '/home/valentin/nextcloud-docker-dev/workspace/server/apps/nc_py_api/tests/conftest.py'.
tests/conftest.py:26: in <module>
    if "app_api" not in NC_APP.capabilities:
nc_py_api/nextcloud.py:88: in capabilities
    return self._session.capabilities
nc_py_api/_session.py:229: in capabilities
    self.update_server_info()
nc_py_api/_session.py:224: in update_server_info
    self._capabilities = self.ocs("GET", "/ocs/v1.php/cloud/capabilities")
nc_py_api/_session.py:198: in ocs
    response = self.adapter.request(method, path, content=content, json=json, params=params, **kwargs)
env/lib/python3.10/site-packages/httpx/_client.py:827: in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
env/lib/python3.10/site-packages/httpx/_client.py:914: in send
    response = self._send_handling_auth(
env/lib/python3.10/site-packages/httpx/_client.py:942: in _send_handling_auth
    response = self._send_handling_redirects(
env/lib/python3.10/site-packages/httpx/_client.py:979: in _send_handling_redirects
    response = self._send_single_request(request)
env/lib/python3.10/site-packages/httpx/_client.py:1015: in _send_single_request
    response = transport.handle_request(request)
env/lib/python3.10/site-packages/httpx/_transports/default.py:232: in handle_request
    with map_httpcore_exceptions():
/usr/lib/python3.10/contextlib.py:153: in __exit__
    self.gen.throw(typ, value, traceback)
env/lib/python3.10/site-packages/httpx/_transports/default.py:86: in map_httpcore_exceptions
    raise mapped_exc(message) from exc
E   httpx.ConnectError: [Errno -2] Name or service not known

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install nextcloud-docker-dev (GitHub - juliushaertl/nextcloud-docker-dev: Nextcloud development environment using docker-compose)
  2. Install app_api dev env (Setting up dev environment — AppAPI latest documentation)
  3. Configure the deploy deamon (Creation of Deploy Daemon — AppAPI latest documentation)
  4. Follow the guide to install nc_py_api dev env (Setting up dev environment — NcPyApi 0.11.0 documentation)

The output of your Nextcloud log in Admin > Logging:

Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 16:17:01"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 16:17:01"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:55:10"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:55:10"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:45:20"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:45:20"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:45:16"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:45:16"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:44:09"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:44:09"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:43:59"	
Avertissement	appstoreFetcher	
Could not connect to appstore: cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to apps.nextcloud.com:443 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json
"15 mars 2024, 15:43:59"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:43:59"	
Avertissement	appstoreFetcher	
Could not connect to appstore: cURL error 35: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to apps.nextcloud.com:443 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json
"15 mars 2024, 15:43:59"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:42:30"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:42:30"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:39:35"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:39:35"	
Erreur	jsresourceloader	
Could not find resource profiler/js/profiler-toolbar.js to load
"15 mars 2024, 15:39:27"

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "system": {
        "debug": true,
        "profiler": true,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-extra",
                "url": "\/apps-extra",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-shared",
                "url": "\/apps-shared",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-writable",
                "url": "\/apps-writable",
                "writable": true
            }
        ],
        "allow_local_remote_servers": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "1025",
        "skeletondirectory": "\/skeleton",
        "setup_create_db_user": false,
        "loglevel": "2",
        "log_query": false,
        "query_log_file": "\/shared\/log\/querylog-nextcloud.log",
        "query_log_file_requestid": "yes",
        "diagnostics.logging": false,
        "diagnostics.logging.threshold": 0,
        "log.condition": {
            "apps": [
                "diagnostics",
                "admin_audit"
            ]
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nextcloud",
            "nextcloud.local",
            "192.168.21.6",
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.0.8",
        "overwrite.cli.url": "http:\/\/nextcloud.local",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "git",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "lookup_server": "",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "maintenance": false,
        "app_install_overwrite": [
            "logreader",
            "app_api"
        ],
        "logfile": "\/home\/valentin\/nextcloud-docker-dev\/",
        "log_type": "file"
    },
    "apps": {
        "admin_audit": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "logging"
        },
        "app_api": {
            "default_daemon_config": "custom",
            "enabled": "yes",
            "installed_version": "2.3.0",
            "types": ""
        },
        "backgroundjob": {
            "lastjob": "52"
        },
        "circles": {
            "enabled": "yes",
            "installed_version": "29.0.0-dev",
            "loopback_tmp_scheme": "http",
            "maintenance_run": "0",
            "maintenance_update": "{\"3\":1710514202,\"2\":1710515701,\"1\":1710516001}",
            "types": "filesystem,dav"
        },
        "cloud_federation_api": {
            "enabled": "yes",
            "installed_version": "1.12.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "logging"
        },
        "contactsinteraction": {
            "enabled": "yes",
            "installed_version": "1.10.0",
            "types": "dav"
        },
        "core": {
            "backgroundjobs_mode": "cron",
            "files_metadata_installed": "1",
            "installedat": "1710250472.6835",
            "lastcron": "1710516001",
            "lastupdateResult": "[]",
            "lastupdatedat": "1710515320",
            "moveavatarsdone": "yes",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "vendor": "nextcloud"
        },
        "dashboard": {
            "enabled": "yes",
            "installed_version": "7.9.0",
            "types": ""
        },
        "dav": {
            "enabled": "yes",
            "installed_version": "1.30.0",
            "needs_system_address_book_sync": "no",
            "types": "filesystem"
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "authentication"
        },
        "files": {
            "enabled": "yes",
            "installed_version": "2.1.0",
            "types": "filesystem"
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "2.10.0",
            "types": ""
        },
        "files_reminders": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.21.0",
            "types": "filesystem"
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "filesystem,dav"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.22.0",
            "types": "filesystem,dav"
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "2.14.0",
            "types": "logging"
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "authentication"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.17.0",
            "types": "authentication"
        },
        "profiler": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "logging"
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "prevent_group_restriction"
        },
        "recommendations": {
            "enabled": "yes",
            "installed_version": "2.1.0",
            "types": ""
        },
        "settings": {
            "appstore-fetcher-lastFailure": "1710513839",
            "enabled": "yes",
            "installed_version": "1.12.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "filesystem"
        },
        "systemtags": {
            "enabled": "yes",
            "installed_version": "1.19.0",
            "types": "logging"
        },
        "theming": {
            "enabled": "yes",
            "installed_version": "2.4.0",
            "types": "logging"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.18.0",
            "types": ""
        },
        "ui_example": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": ""
        },
        "updatenotification": {
            "enabled": "yes",
            "installed_version": "1.19.1",
            "types": ""
        },
        "user_oidc": {
            "enabled": "yes",
            "installed_version": "5.0.1",
            "provider-1-jwksCache": "",
            "provider-1-jwksCacheTimestamp": "",
            "types": "authentication"
        },
        "user_status": {
            "enabled": "yes",
            "installed_version": "1.9.0",
            "types": ""
        },
        "viewer": {
            "enabled": "yes",
            "installed_version": "2.3.0",
            "types": ""
        },
        "weather_status": {
            "enabled": "yes",
            "installed_version": "1.9.0",
            "types": ""
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "2.11.0",
            "types": "filesystem"
        }
    }
}

The output of your Apache/nginx/system log in /var/log/____:
My nextcloud is a docker container based on nextcloud-docker-dev, I have found /var/log/apache2/error.log on it but it seems to be empty, or I can’t open it.

I tried to install an example app with a GUI, but it doesn’t work (I can add it in the apps menu but I cannot see any sign of this app anywhere in my nextcloud interface)

If anybody have any idea of why I obtain this error, it would be a great help