JaGeo / LobsterPy

Package to perform automatic bonding analysis with the program Lobster in the field of computational materials science and quantum chemistry
https://jageo.github.io/LobsterPy/
BSD 3-Clause "New" or "Revised" License
74 stars 27 forks source link

import of `typing` causing issues for down stream installs #293

Closed jmmshn closed 2 months ago

jmmshn commented 2 months ago

import of typing causing issues for downstream installs

Looks like this dependency is causing some problems with matgl and dgl. Not sure exactly how to fix this and it looks like it's really only problematic with the strict install of atomate2.

https://github.com/JaGeo/LobsterPy/blob/62b8b4fcc47155b1bd3237c1e71267249d479e3f/pyproject.toml#L34C1-L35C1

Collecting typing (from lobsterpy==0.4.4->atomate2==0.0.14.post63+g3079e557)
  Using cached typing-3.7.4.3-py3-none-any.whl
INFO: pip is looking at multiple versions of matgl to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 3.10.0.0 Requires-Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <3.5; 3.7.4.2 Requires-Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <3.5
ERROR: Could not find a version that satisfies the requirement dgl>=2.0.0 (from matgl) (from versions: 0.9.0, 0.9.1, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.2.post1)
ERROR: No matching distribution found for dgl>=2.0.0
JaGeo commented 2 months ago

But the error comes from dgl?

JaGeo commented 2 months ago

For LobsterPy, it simply says that it uses a cached version of typing. I don't think LobsterPy is the issue here. Why would typing affect dgl?

JaGeo commented 2 months ago

Or did you just install typing and dgl for testing?

JaGeo commented 2 months ago

I just created a fresh environment (Python 3.11) and installed typing and dgl. No issues.

Same for "pip install typing" and "pip install atomate2[strict]".

jmmshn commented 2 months ago

Thanks for looking into this! So I was not able to pip install -e .[strict] on the main branch of atomate2 with dgl being the main problem. lobsterpy looked like the last package that caused a clash so I raised the issue here.

So ultimately this might be an issue with matgl or dgl. Please let me know if you see the same problem with the main branch of atomate2.

JaGeo commented 2 months ago

There are no issues here either. I assume you have something else installed in your environment that causes problems. I also cleaned my pip cache to make sure I installed the latest versions and just now recreated the Conda environment.

Also, lobsterpy's typing requirement is completely open regarding version number. I don't see how this could cause any conflicts.

JaGeo commented 2 months ago

Maybe, recreate your environment?

JaGeo commented 2 months ago

Feel free to reopen if you have more evidence that the typing import is the issue.

jmmshn commented 2 months ago

I nuked my environment and even reinstalled Conda but still have the same install problems for atomate2 strict from main. I do agree this is likely not a lobsterpy issue though. Will check elsewhere.

JaGeo commented 2 months ago

Weird. I did the same thing.

Python version dependent? Dependent on the operating system?

jmmshn commented 2 months ago

This was persistent across different python versions on OSX for me. This could be related to the following: https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-use-mkl-on-M2-mac/m-p/1479942#M34512

Cannot attempt reproduction on other mac devices.

JaGeo commented 2 months ago

If you have an idea how to solve this, let me know. But to me, an open typing dependency is a weird reason to cause such a failure.