a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
1.03k stars 131 forks source link

The setup with Conda doesn't work as described #79

Closed avivko closed 2 years ago

avivko commented 2 years ago

I just want to start by saying that I really like your work / the idea behind this project.

But when I tried to install it with Conda, as suggested by your README, I noticed some problems.

1) In the README you say that you can install Graphein with the following commands, but "conda create env" is not a valid Conda command. it should be "conda env create".

git clone https://www.github.com/a-r-j/graphein
cd graphein
conda create env -f environment-dev.yml
pip install -e .

2) when you do do this, using the latest miniconda3 Linux release, Conda reports conflicts and the installation fails:

$ conda env create -f environment-dev.yml
Collecting package metadata (repodata.json): done
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
<...a long list of conflicts...>
a-r-j commented 2 years ago

Hi @avivko thanks for pointing out the typos!

Wrt the conda issue, I'd reccommend installing from pip instead & install appropriate CUDA and DL libraries manually. There's a also a dockerfile (#69 ) you can try. I've encountered problems with glibc when using the conda environments in certain machines.

a-r-j commented 2 years ago

Hi @avivko how did you get on?

a-r-j commented 2 years ago

Closing this. Please do comment if it’s not resolved & I’ll reopen the issue.

avivko commented 2 years ago

Hey @a-r-j,

Sorry for replying so late...

I did get Graphein to run using the pip setup (which requires Python=>3.8). However, I want to also use GetContacts which seems to require Python 3.6. How do you get both to work in the same environment? The same goes for pymol (at least when you install it with conda).

If I want to build dssp, GetContacts, and pymol from source (in order to avoid using conda). could you give me some advice as to how to do that in a way that is compatible with Graphein?

Thanks!

a-r-j commented 2 years ago

Hi @avivko hmm seems like we’re in the depths of dependency hell here! I think the simplest route if you want to build the others from source is to do the same for Graphein. Clone the repo and install from that. IIRC the only Python 3.8 code in the repo is the use of Literal In these lines: https://github.com/a-r-j/graphein/blob/5f018140e5b825a1846ba3dee840136ede794c2c/graphein/protein/config.py#L83

https://github.com/a-r-j/graphein/blob/5f018140e5b825a1846ba3dee840136ede794c2c/graphein/protein/config.py#L44

You could change them (and the python version requirement in setup.py) and then you should be able to install your local version with pip install -e .

What do you think of this?

avivko commented 2 years ago

Thanks for the quick reply!

I mean, I could create my own branch and start playing around with your code, yeah. However, given that this is an ongoing project, as long as you push more python>=3.8 lines, I would have continue troubleshooting conflicts. In addition, Dssn, GetContacts, and Pymol are also baked into Graphein, so wouldn't you rather find a general solution so that you would not have built-in dependency conflicts in your production code? The environment.yml file is also broken due to the same reason (with both Python==3.8 and pymol listed in the file).

I will try to find a workaround and keep you posted.

a-r-j commented 2 years ago

Hey @avivko. Yep, all good points. I was intending to give you a solution that would get you up and running ASAP.

I will remove the 3.8 specific parts to support 3.6+ - Colab is python 3.6+ and I don't think the typehints are worth not supporting colab & the dependencies you mentioned. Thanks again for pointing it out.

avivko commented 2 years ago

Hi @a-r-j ,

Hey @avivko. Yep, all good points. I was intending to give you a solution that would get you up and running ASAP.

I appreciate that! Thanks. I think Graphein is a great project, so I'm trying to make sure it is also user friendly :)

I will remove the 3.8 specific parts to support 3.6+ - Colab is python 3.6+ and I don't think the typehints are worth not supporting colab & the dependencies you mentioned. Thanks again for pointing it out.

I think a quick fix for python 3.5+ support will be using typing_extensions (pip install typing_extensions). AFAIK you can then just go ahead and import the Literal class (from typing_extensions import Literal) and not have to change anything / be able to use literals in the future too.

a-r-j commented 2 years ago

Thanks, that’s really neat - I didn’t know about typing_extensions. Will try to get to this today :)

a-r-j commented 2 years ago

Hey @avivko I started on this today. It looks like the from __future__ import annotations statements are breaking compatibility with 3.6 and lower as it was added in 3.7. Do you have any ideas on how to deal with this?

avivko commented 2 years ago

https://pypi.org/project/future-annotations/ maybe?

avivko commented 2 years ago

@a-r-j but tbh, I'm not sure that making Graphein 3.6 compatible has to be the way to go (would be nice, but is perhaps not a must). Colab runs on Python 3.7 nowadays, and with typing_extensions you should be able to get Graphein to be Python 3.7+ compatible, right? The main dependency problem seems to be Pymol because it doesn't support Python =>3.9, but it does support python 3.7 and 3.8. So I think that it's a good idea to get Graphein to support 3.7 with typing_extensions for Colab and then just state that, for now, Graphein supports only Python 3.7 or 3.8 (also on Pypi).

a-r-j commented 2 years ago

Hi @avivko thanks for the help! v.1.0.11 on PyPI should support 3.7 now. I tried going for 3.6 support but it's been sunset and it looked like it would be more effort than it's worth. I'd prefer to add additional features with that time instead.