#π Mesa installed but getting ModuleNotFoundError
34 messages Β· Page 1 of 1 (latest)
@rancid tinsel
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
sorry if i have asked in the wrong place
no it's the right place
thanks
did you run uv sync?
where did you get that mesa command from? is it a local package?
(I installed the same packages, and have no "mesa check" command)
uv run X check should check if a package is properly installed. i originally had issue when i tried to run my project which imports mesa and i got the error ModuleNotFoundError: No module named 'mesa.visualization.ModularVisualization'
"uv run" should run an installed command... I never heard about this check command. Especially as "uv run mesa check" basically means, that the command you're running is "mesa check" ... meaning you run "mesa" with argument "check" ... which I'm pretty sure has no longer anything to do with uv
do you have any other files locally?
i see. my bad then. i still have the error where if i run my project then it doesn't run and gives me the error described here
I found this issue: https://github.com/projectmesa/mesa/issues/2331#issuecomment-2588080316
did you use mesa startproject? if so, according to that comment it seems to be outdated and generates some invalid code
i did not. i created my project using uv init
okay, I seem to have been on the newest version, which did not have the "mesa" command
mesa.visualization.ModularVisualization was removed: https://github.com/projectmesa/mesa/commit/63d02a60ce3d642d248286d50cc0d73599e69056#diff-3fe59c3958dd474dec498ff19129425118d6a7fb89badd7e06730ab21436e65b
so if you want this code to run you need an older version, I believe
oh thank you. that helps a lot
mesa==3.1.3 would work, I think
it doesn't. trying to find what version i need
that commit seems to be there since v3.0.0a0
oh, you're right, I misread this
so probably mesa<3, then
for some time they supported the old API as mesa.visualisation_old, but nowadays ModularVisualization doesn't exist at all. not sure what it was replaced by
either that or figure out how to use whatever replaced it thing you're trying to use. 
okay my issue seems to be fixed now. thank you for the help
closing this now
!close
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.