Skip to content

Conversation

@psteinb
Copy link
Contributor

@psteinb psteinb commented Aug 31, 2023

as lie_learn currently cannot be installed with python 3.11 and above

@psteinb psteinb marked this pull request as ready for review August 31, 2023 15:08
@psteinb
Copy link
Contributor Author

psteinb commented Aug 31, 2023

see also AMLab-Amsterdam/lie_learn#26

as lie_learn currently cannot be installed with python 3.11 and above

Signed-off-by: Peter Steinbach <p.steinbach@hzdr.de>
- added classifiers (not sure what they invoke on PyPI etc)
- added python version limiter for lie_learn (needs to be tested)

Signed-off-by: Peter Steinbach <p.steinbach@hzdr.de>
Signed-off-by: Peter Steinbach <p.steinbach@hzdr.de>
@psteinb
Copy link
Contributor Author

psteinb commented Aug 31, 2023

Note, I checked the installation of the package with py 3.7 and 3.11. The former works as expected, the latter bails out as python 3.11 is not supported currently.

According to the docs, this change once pushed to PyPI should also affect people running pip install escnn from python 3.11.

@kalekundert
Copy link
Contributor

I just noticed this PR, and I haven't looked at it too closely, but I don't think it makes sense for escnn to require python<3.11 (assuming that escnn works with python>=3.11 as long as lie_learn is installed). It's not like it's impossible to install lie_learn for python>=3.11, it just requires an arcane set of pip commands. And installing lie_learn for python 3.9-3.10 with an up-to-date version of pip also doesn't work out-of-the-box, so it's not like the problem with lie_learn is confined to python>=3.11.

If anything, it might be possible for escnn to specify its dependencies in such a way that installing lie_learn just works. Specifically, this would mean (i) requiring wheel, (ii) requiring cython<3.0, and (iii) requiring the github version of lie_learn rather than the PyPI version. I'm not totally sure that this would work, though, because the first two have to be installed before lie_learn, and I don't think setuptools makes any guarantees about the order in which it installs dependencies. I don't think this would be worth the trouble, though, because the whole problem should go away once AMLab-Amsterdam/lie_learn#26 is merged. It's probably about time to ping the maintainer about that, though.

@psteinb
Copy link
Contributor Author

psteinb commented Sep 21, 2023

Good discussion! While being a bit blunt, I suggest this PR to prevent headaches for people lacking the capabilities to deal with the deficiencies of lie_learn. That is the core motivation.

@kalekundert
Copy link
Contributor

I agree with that motivation, but I worry that this approach will just shift the headaches to people who want to use up-to-date python. Especially since, if the goal is to avoid lie_learn headaches, then the requirement would have to be python<=3.8 rather than 3.10, since that's the last version that can install lie_learn with up-to-date pip.

I'd prefer to either (i) do nothing and wait for lie_learn to be fixed or (ii) have setup.py print out an error message explaining the problem with lie_learn and the commands needed to install it. In fact, now that I think about it, maybe the best thing would be to change the lie_learn dependency to point to my fork, e.g.:

# setup.py
install_requires = [
    ...
    "lie_learn @ git+https://github.com/kalekundert/lie_learn@8f89f11",
    ...
]

Not totally sure that that's the right syntax, but in principle that would immediately solve the problem, and it'd be easy to switch back to the real lie_learn whenever it's fixed.

@psteinb
Copy link
Contributor Author

psteinb commented Sep 22, 2023

I just checked, @kalekundert suggestion works like a charm for a local pip install . As I don't want to take the credit, I suggest @kalekundert sends an autonomous PR, if @Gabri95 is fine with relying on the lie_learn fork by @kalekundert at the moment.

@michaelfortunato
Copy link

michaelfortunato commented Aug 31, 2025

Hi!
If anyone else stumbles on this issue, I am running python 3.13 and was able to get everything installed pretty easily--though admittedly it does require a few extra commands.

Background

  1. Use uv to manage your python project.
  2. In the root directory of your project, call uv venv && source .venv/bin/activate to make sure your environment is ready.
  3. Make sure a fortran compiler is installed and available on your path. For instance, if using nix to manage your OS package, call nix profile install nixpkgs#gfortran15. I believe if you are using mac, you might have to install all of gcc to get gfortran15.

Steps

  1. If you do not have it already, add pyproject.toml to the root directory of your project. Give it these contents (or add them to your existing pyproject.toml).
dependencies = [
    "escnn",
    "lie-learn",
]
[tool.uv.sources]
escnn     = { git = "https://github.com/QUVA-Lab/escnn", rev = "master" }
lie-learn = { git = "https://github.com/AMLab-Amsterdam/lie_learn", rev = "master" }
  1. Run uv sync.
  2. (Optional) Run echo $? and ensure it prints 0 to ensure sure step 3 ran successfully.
    That's it! Hopefully this is useful.

@odinhg
Copy link

odinhg commented Dec 3, 2025

Thanks for sharing your solution @michaelfortunato. Adding GitHub sources as you suggested worked for me, too (even without uncommenting the build-system lines). Had to install gfortran first indeed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants