Skip to content

Troubleshooting

j-sawn edited this page Mar 19, 2025 · 5 revisions

feel free to update this with the errors you come across, whether you're the only one or the whole team is going through it (no judgement)

Docker-specific

  • "I forgot an attribute when I made my Docker container!"
    • No need to start over, just do the following:
      • Exit the docker container
      • Run docker commit [container name] [new image name]
      • Then run docker run -it --name [new container name] [insert the attributes you missed] [new image name]
    • NOTE: This is very common when running with attributes such as "-p 7860:7860" (which is needed for Docker to run files on a port)

Python-specific

  • "My terminal does not recognise py/python/python3 as a command!"
    • Have you tried the other possible aliases for this command (see the slashed terms)?
    • If you have tried the above and it doesn't work: Have you added python to your PATH?
      • wip
  • "My terminal thinks pip or python are external instructions so I can't run them!"
    • Are you in your Python environment? If not, run the following:
      • python3 -m venv ./app/venv (if you have not set it up yet)
      • source ./app/venv/bin/activate
  • "The terminal does not recognise a module I installed!"
    • This sometimes happens even if you installed the modules before, so do the following:
      • Ensure you are in the Python virtual environment (see above)
      • Run (or re-run) pip install [insert module name here] in your terminal
        • (be careful and make sure you run the right name!)
      • Retry running your Python file
  • "How can I make my files run in my Docker container?"
    • "I am able to access the /app directory!"
      • wip
    • "I cannot access the /app directory!"
      • Type vi ./app/[name of file]
      • Press i to insert code
      • Copy in the necessary code
      • Press Esc, type :wq, then Enter
    • "I have the file on my local device already!"
      • You can use docker cp "[INSERT LOCAL PATH TO YOUR FILE YOU WANT TO RUN]" [INSERT CONTAINER NAME]:[INSERT DIRECTORY OF CONTAINER YOU WANT TO SAVE THE FILE IN] to transfer your local device's files to Ubuntu's.

Gradio-specific

  • "I tried visiting the port and nothing is there!"
    • Are you in localhost or 0.0.0.0?
      • If it is the latter, use the former link instead.
  • "The terminal cannot find a module named "gr", but I installed Gradio already!"
    • Does the error trace back to external.py (e.g. "/app/venv/lib/python3.12/site-packages/gradio/external.py")?
      • If so, go to that file.
      • Change line 805 in accordance to the error:
        • From from gr.chat_interface import ChatInterface to from gradio.chat_interface import ChatInterface
    • (NOTE: This has so far only happened when using ChatInterface, so this could just be an error isolated to that)

Ollama-specific

  • "My Ollama model is returning a NewConnectionError!"
    • Do you have a running instance of Ollama? If not, do the following:
      • Run ollama serve
      • Open another terminal
      • Execute your Docker container again
        • You can do this by running docker exec [container name] bash
      • Run the Ollama file you tried to run earlier

If in case none of these helped:

  • Copying and pasting the error into Google might return a relevant solution (please share it here if you find it!)
  • ChatGPT might also give you a suitable solution, or at least a clue on what might be causing the problem.
    • However, it can say the wrong or possibly harmful things at time, so please be careful!
  • Ask a team member, we'll be happy to help!

Clone this wiki locally