genai-impact / ecologits

🌱 EcoLogits tracks the energy consumption and environmental footprint of using generative AI models through APIs.
https://ecologits.ai/
Mozilla Public License 2.0
36 stars 3 forks source link

Recurrent `ModuleNotFoundError` #29

Closed adrienbanse closed 2 months ago

adrienbanse commented 3 months ago

It's probably very basic but any idea why I have to run poetry install --all-extras --with dev,docs everytime I make a change in the code to be able to run my __main__.py script? Otherwise I very often get ModuleNotFoundError: No module named 'genai_impact'.

LucBERTON commented 2 months ago

Do you get the error once you run your main script or is it a message displayed by your IDE ?

The other day I had a problem with VS Code that could be similar. To solve it in VS Code I did : Ctrl + Shift + P, searched for Python: Select Interpreter and selected the python interpreter from my venv file.

If it's not solved, please share your script, I'll see If I have the same issue

samuelrince commented 2 months ago

If you want to make sure a script runs with the right virtualenv you can do poetry shell and python ... or simply poetry run ...

adrienbanse commented 2 months ago

It's solved thanks 🙏