UBC-MDS / hexdropper

A Python package designed for graphic designers, developers, and color enthusiasts. It simplifies the process of obtaining hex color codes from images.
MIT License
0 stars 0 forks source link

ModuleNotFoundError on ReadtheDoc #45

Closed joeywwwu closed 8 months ago

joeywwwu commented 8 months ago

Hey team, I found that there is a ModuleNotFoundError on Hexdropper Tutorial after I built the latest version. Does anyone know what's wrong with this file and how to fix it? Thanks a lot!

monazhu commented 8 months ago

I'm not sure what you've tried so far but here's a few things I could think of off the top of my head:

  1. The code seems to run, but the lack of module might be the way the importing is happening - i imagine you might need to call from hexdropper.read_image import read_image for read_image() to get loaded, because it can't find read_image() inside hexdropper (the folder itself doesn't contain any functions directly)
  2. Have you already changed the namespace inside init.py or not yet? What happens when you try to change the namespace and make it more consistent with what Tiffany had in her notes?

image

joeywwwu commented 8 months ago

Thanks a million, Mona! I was struggling so much on spotting the cause of errors as it works well on local repo. I will revise the example and init file to make sure it works on ReadtheDoc as well! Thanks again!

monazhu commented 8 months ago

I managed to figure out what the issue was. sphinx and napoleon had been added as dependencies rather than developer dependencies, which is what cause the run to fail. I'll document the exact steps I took to solve the issue on my end.

  1. switched to conda environment for the hexdropper project, then ran poetry install
  2. removed sphinx and napoleon from dependencies, then ran poetry update to update the lock file.
  3. ran the following in terminal:
    • poetry add --group dev jupyter
    • poetry add --group dev myst-nb --python "^3.9"
    • poetry add --group dev sphinx-autoapi sphinx-rtd-theme
    • poetry add --dev sphinxcontrib-napoleon
  4. ran poetry install again to make sure everything is updated
  5. navigate to docs/ directory, then ran poetry run make html to check that readthedocs was compiling everything properly in the local environment

Hope that helps!