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

pytorch-lightning==1.5.10 has a non-standard dependency specifier #1

Open
DaisyBrumit opened this issue Mar 27, 2024 · 1 comment
Open

Comments

@DaisyBrumit
Copy link

I have installed DEBIAS-M and am running into a problem with the pytorch-lightning dependency.

Initial command
pip install git+https://github.com/korem-lab/DEBIAS-M.git

This returns a warning
DEPRECATION: pytorch-lightning 1.5.10 has a non-standard dependency specifier torch>=1.7.*. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of pytorch-lightning or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063

*link to the error-referenced url for convenience.

Secondary issue
When following the example code, running command from debiasm import DebiasMClassifier returns error AttributeError: module 'distutils' has no attribute 'version'

Traceback led to the import command for pytorch-lightning as follows:
File "/Users/dfrybrum/anaconda3/envs/debias/lib/python3.9/site-packages/debiasm/__init__.py", line 3, in <module> from .torch_functions import DEBIASM_train_and_pred, DEBIASM_train_and_pred_log_additive File "/Users/dfrybrum/anaconda3/envs/debias/lib/python3.9/site-packages/debiasm/torch_functions.py", line 5, in <module> import pytorch_lightning as pl File "/Users/dfrybrum/anaconda3/envs/debias/lib/python3.9/site-packages/pytorch_lightning/__init__.py", line 20, in <module> from pytorch_lightning.callbacks import Callback # noqa: E402

This appears to trace back to the pytorch-lightning 1.5.10 dependency (related pytorch tickets supplied here and here).

Attempts to fix
I first attempted to fix the issue by installing a newer version of pytorch-lightning (version 1.9.3). This version installed successfully but is of course incompatible with the requirements of DEBIAS-M.

Has anyone else run into this issue and is there a known workaround?

@gaustin15
Copy link
Collaborator

I believe the distutils error is coming from some internal package dependencies, and based on what I've seen it should be possible to support pytorch-lightning 1.5 in your python 3.9 environment. Could you by any chance to running the example code using an environment built off of the following requirements.txt file? This python3.9 environment was able to run the example code on my machine.
requirements.txt

Regarding the package specifier warning -- we're currently looking into adding compatibility for the latest torch versions, although for the time being that warning will not affect debias-m's performance, since debias-m's setup file specifies it's own set of torch version requirements.

If the above requirements file does not resolve your error, could you by any chance share your environment's conda list output?

gaustin15 added a commit that referenced this issue Jun 5, 2024
gaustin15 added a commit that referenced this issue Jun 5, 2024
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

No branches or pull requests

2 participants