#πŸ”’ Mesa installed but getting ModuleNotFoundError

34 messages Β· Page 1 of 1 (latest)

rancid tinsel
#

I have installed mesa using uv but i get ModuleNotFoundError whenever i try to run the code or check it, as seen in the screenshot. Expected output from running uv run mesa check should be All checks passed!

karmic rivetBOT
#

@rancid tinsel

Python help channel opened

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.

rancid tinsel
#

sorry if i have asked in the wrong place

worn crown
#

no it's the right place

rancid tinsel
#

thanks

worn crown
#

did you run uv sync?

rancid tinsel
#

i have yes

#

no change

worn crown
#

where did you get that mesa command from? is it a local package?

#

(I installed the same packages, and have no "mesa check" command)

rancid tinsel
#

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'

worn crown
#

"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?

rancid tinsel
wheat wagon
rancid tinsel
wheat wagon
#

did you use mesa startproject? if so, according to that comment it seems to be outdated and generates some invalid code

rancid tinsel
worn crown
#

okay, I seem to have been on the newest version, which did not have the "mesa" command

wheat wagon
#

so if you want this code to run you need an older version, I believe

rancid tinsel
#

oh thank you. that helps a lot

wheat wagon
#

mesa==3.1.3 would work, I think

rancid tinsel
#

it doesn't. trying to find what version i need

worn crown
#

that commit seems to be there since v3.0.0a0

wheat wagon
#

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

worn crown
#

either that or figure out how to use whatever replaced it thing you're trying to use. benjyvr_shrug

rancid tinsel
#

okay my issue seems to be fixed now. thank you for the help

#

closing this now

#

!close

karmic rivetBOT
#
Python help channel closed with !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.