marshuang80 / gloria

GLoRIA: A Multimodal Global-Local Representation Learning Framework forLabel-efficient Medical Image Recognition
Apache License 2.0
173 stars 29 forks source link

pip install failed #23

Open hxu105 opened 6 months ago

hxu105 commented 6 months ago

Howdy,

I am trying to install gloria via pip, and I did pip install git@github.com:marshuang80/gloria.git. I got this error:

ERROR: Invalid requirement: 'git@github.com:marshuang80/gloria.git' Hint: It looks like a path. File 'git@github.com:marshuang80/gloria.git' does not exist.

Could you help to take a look at it?

Many thanks!

rshayer95 commented 6 months ago

It is not working as It is taking the URL as file path. To resolve it run the following command: pip install git+https://github.com/marshuang80/gloria.git.

Just replaced @ with + to indicate the request from URL instead of treating it as file and added HTTPS to make the URL recognizable to pip

hxu105 commented 6 months ago

Thank you, but I found another error when importing gloria. AttributeError: module 'gloria' has no attribute 'constants'

rshayer95 commented 6 months ago

Or maybe you can directly download gloria package repository manually and place it where other package folders are. I think it would work since the folder gonna have init.py file there. They are mainly in site-packages folder or maybe in some other folder. But you need to find the folder on your system and place it there.

hxu105 commented 6 months ago

I downloaded the gloria to my site-packages, but it meets the same error AttributeError: module 'gloria' has no attribute 'constants'

rshayer95 commented 6 months ago

maybe we need to relocate constants or reimport constants in init.py file and use alias.

rshayer95 commented 6 months ago

In gloria/gloria/init.py file try to add the following line

from . import constants

If you see the code they imported builder but not constants from the directory, maybe they didn't placed at the file at right place to import it along with other files.

or the other option is to put constants.py one level up in hierarchy. For example, if file location is currently gloria/gloria/constants.py. It should be gloria/constants.py

Try both one by one if one works then great otherwise can always troubleshoot

hxu105 commented 6 months ago

Thank you for the suggestion, I will try those in a couple of days, and I will inform you whether they fix this issue or not. Many thanks again!