Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mito does not support Python 3.12 #1000

Open
aarondr77 opened this issue Oct 31, 2023 · 10 comments
Open

Mito does not support Python 3.12 #1000

aarondr77 opened this issue Oct 31, 2023 · 10 comments

Comments

@aarondr77
Copy link
Member

aarondr77 commented Oct 31, 2023

Two users I worked with today ran into errors installing Mito because we don't support Python 3.12

Trying to install Mito with Python 3.12 causes this error: ERROR: Failed building wheel for pyzmq

From pyzmq's release notes we can see that, Python 3.12 support was only added in 25.1.1

We do not have a direct dependency on pyzmq, so we should: Figure out which of our dependencies relies on it and alert them.

@naterush
Copy link
Contributor

There's at least one:

  1. JupyterLab needs jupyterlab_server: https://github.com/jupyterlab/jupyterlab/blob/main/pyproject.toml
  2. jupyterlab needs pyzmq: https://github.com/jupyter-server/jupyter_server/blob/main/pyproject.toml

But the requirement is >=24, so I'm not sure why it's not resolving to 25. My guess is that there is some other dependency that has more explicit requirements on pyzmq.

@naterush
Copy link
Contributor

Here's our full dependency tree:

out.txt

JupyterLab requires notebook < 7, which requires pyzmq < 25. I tracked it to this specific issue: jupyter/notebook#6749

Notably, this was a temporary fix / workaround, and should be removed in upcoming versions of notebook. If you just pip install "notebook<7" -- you get the pyzmq error here.

@naterush
Copy link
Contributor

While this is getting fixed, we should just add a conditional dependency: if Python >= 3.12, then pyzmq >=25.

@naterush
Copy link
Contributor

This doesn't work. For some reason, it still tries to resolve both >=25 as well as version <25... it doesn't look it's actually the notebook<7 dependency like I thought, but rather jupyter_server? Still digging in.

@naterush
Copy link
Contributor

naterush commented Oct 31, 2023

Yeah, so jupyterlab<4 doesn't work on Python 3.12. Opened an issue here: jupyterlab/jupyterlab#15332

@naterush
Copy link
Contributor

Notably:

  1. You can install JupyterLab > 4.0 on Python 3.12
  2. Even if you pip install pyzmq manually, and then try and install jupyterlab<4, it still errors.

Solutions wise, we have a few options:

Option 1: Wait until JupyterLab fixes this

This might happen, it might not -- 3.x version of JLab appears to be actively maintained (with a release in the past month) -- but it's not clear if/when this bug would be fixed. You can see the issue here.

Option 2: Move to JupyterLab 4.0 support

Since JupyterLab 4.0 works, we could just move to support it. But we have many folks on 3.x, we probably want to maintain support for this still.

I don't know how to do this, though. I'm not sure if 3.x support and 4.x support are possible in the same package... it's maybe possible but feels like it needs some investigation on the order of days.

Option 3: Remove JupyterLab as a default dependency of Mito

Move to install instructions that are closer to that of Streamlit and Dash. This would have the benefit of unblocking Python 3.12 users who are attempting to use streamlit or dash -- which may be a fair portion at this point.

@aarondr77
Copy link
Member Author

I vote we go with option 1 until we hear back from the JupyterLab team about timelines of adding support and in the meantime, we add a message in the docs + a common error issue in the docs that explains the workaround of using a different version of Python with a conda virtual environment like: conda create -n mitoenv python=3.10

In addition, let's prioritize JupyterLab 4 support soon?

@naterush
Copy link
Contributor

Both of these are added to the docs. +1 on JupyterLab 4 support. Hopefully it's possible to support 3.x and 4.x in the same repo (but maybe won't be, given how data_files kinda work statically...)

@AdeelK93
Copy link

Though pip is unable to install mitosheet on 3.12, poetry is able to do it just fine

@DarkCTO
Copy link

DarkCTO commented Jul 21, 2024

Seemingly fixed, but due to no module named disutils had to install setuptools
maybe add to required packages since disutils removed in 3.12 @naterush @aarondr77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants