dockerubuntuwindows-subsystem-for-linux

GeoNode Installation - ModuleNotFoundError: No module named 'geonode'


I tried to set up GeoNode (versions 4.2.2 and 4.4.1) using the basic installation guide for Docker. I set up GeoNode locally on my Ubuntu 22.04 on WSL2 (Windows 10). After completing the installation guide I am able to access the GeoNode website via localhost. But if I try to modify the UI like in this guide (e.g. by adding code to site_base.css) and restart the server using python manage.py collectstatic within ~/my_geonode/src-folder with my venv my_geonode active, I receive ModuleNotFoundError: No module named 'geonode'. I then tried to add geonode to the project using pip install -e . while being in ~/my_geonode/src-folder like mentioned in this answer. But ModuleNotFoundError: No module named 'geonode' is still occuring.

Am I using the right installation guide or is there a way to solve the error?

Also when using docker compose up -d the first time it raises dependency failed to start: container django4my_geonode is unhealthy, but after running docker compose up -d a second time everythig is healthy. Could this be a hint?


Solution

  • Problem was a beginner mistake - but it also was not properly stated in the docs...

    If you install GeoNode using Docker, you need to enter the respective Docker container in order to execute commands affecting GeoNode:

    python manage.py collectstatic
    

    becomes for example:

    docker exec -t django4[geonode project name] python manage.py collectstatic
    

    this executes the command inside the Django Docker container