mesa icon indicating copy to clipboard operation
mesa copied to clipboard

New user install flow evaluation

Open jackiekazil opened this issue 11 months ago • 12 comments

I was installing Mesa into a fresh environment & approaching it from a new users perspective...

pip install mesa 
<pick example> 
solara run app.py

solara gives me this error:

Could not import SolaraViz. If you need it, install with 'pip install --pre mesa[viz]'

so then I run:

pip install --pre mesa[viz]

which returns:

zsh: no matches found: mesa[viz]

How do we fix this / make it easier for users?

jackiekazil avatar Jan 13 '25 16:01 jackiekazil

First, that --pre remark should not be there because it will break the solara dependencies.

Second, debate whether the ui is part of the default stuff that should just work or not.

quaquel avatar Jan 13 '25 16:01 quaquel

viz is a defined extra, so that can’t be it. Claude sounds plausible:

The problem is actually related to how the shell (zsh in your case) interprets the square brackets.

When you try to run pip install --pre mesa[viz], the zsh shell tries to interpret [viz] as a pattern matching expression, which is why you get the "no matches found" error. This is a common issue with zsh and bash when dealing with package extras.

Here are two ways to fix this:

  1. Escape the brackets or quote the entire package name:
pip install --pre "mesa[viz]"
# OR
pip install --pre mesa\[viz\]
  1. Use the alternative syntax with quotes:
pip install --pre 'mesa[viz]'

For making this easier for users, I can suggest a few approaches:

  1. Update the documentation to explicitly show the quoted version:
pip install --pre "mesa[viz]"
  1. Add a note explaining that shell users may need to quote or escape the brackets.

  2. Consider providing a requirements.txt or similar that includes the visualization dependencies by default.

EwoutH avatar Jan 13 '25 18:01 EwoutH

Note that on the landing page on read the docs in the installation part, the zsh error is explicitly mentioned:

On a Mac, this command might cause an error stating zsh: no matches found: mesa[all]. In that case, change the command to pip install -U "mesa[rec]".

quaquel avatar Jan 13 '25 18:01 quaquel

I wonder if some of the issues with #141 are related to this. People haven't gone into detail on their bugs, so this is only conjecture.

jackiekazil avatar Jan 14 '25 06:01 jackiekazil

@jackiekazil I tried the above and ran into this error when importing mesa. Not sure if this is a problem only only end or not: partially initialized module 'pandas' has no attribute '_pandas_datetime_CAPI' (most likely due to a circular import) Note: this is on a fresh conda env

2guud4u avatar Jan 14 '25 06:01 2guud4u

@2guud4u can you file new issue for your problem? (The issue filing process will help us understand the complete issue you are having.) https://github.com/projectmesa/mesa/issues/new/choose

jackiekazil avatar Jan 14 '25 06:01 jackiekazil

Hi @jackiekazil, I’m starting on the install flow evaluation. I plan to test on Windows 11, Ubuntu 22.04, and macOS with Python 3.11 and 3.12. Should I prioritize specific platforms, Python versions, or other aspects? Thanks!

IDevSharma1 avatar Apr 13 '25 04:04 IDevSharma1

@jackiekazil I have fixed it, it was a firefox issue. Fixed after reinstalling!

2guud4u avatar Apr 13 '25 05:04 2guud4u

@IDevSharma1 That sounds good! Let's us know what you find!

jackiekazil avatar Apr 30 '25 22:04 jackiekazil

PyCon sprint contributors might have a fresh perspective on this.

EwoutH avatar May 09 '25 19:05 EwoutH

i have looked into the issue and am confident that i would be able to solve the issue , can you please assign this issue to me ?

unnati-jaiswal24 avatar Nov 12 '25 16:11 unnati-jaiswal24