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

pip install fails on fresh python==3.11 and python==3.10 conda environment #381

Open
kamurani opened this issue Apr 5, 2024 · 1 comment

Comments

@kamurani
Copy link
Contributor

kamurani commented Apr 5, 2024

On a clean conda environment created with
conda create -n env_name python==3.11 on Linux, and then

pip install graphein 
graphein

I get the following:

[04/05/24 12:07:30] WARNING  To use the Graphein submodule graphein.protein.features.sequence.embeddings, you need to   embeddings.py:34
                             install: torch                                                                                             
                             To do so, use the following command: pip install torch                                                     
                    WARNING  To use the Graphein submodule graphein.protein.features.sequence.embeddings, you need to   embeddings.py:45
                             install: biovec                                                                                            
                             To do so, use the following command: pip install biovec                                                    
                             Alternatively, you can install graphein with the extras:                                                   
                                                                                                                                        
                             pip install graphein[extras]                                                                               
                    WARNING  To use the Graphein submodule graphein.protein.visualisation, you need to install:      visualisation.py:36
                             pytorch3d                                                                                                  
                             pytorch3d cannot be installed via pip                                                                      
                    WARNING  To use the Graphein submodule graphein.protein.meshes, you need to install: pytorch3d          meshes.py:30
                             To do so, use the following command: pip install pytorch3d                                                 
Traceback (most recent call last):
  File "/home/cam/.local/bin/graphein", line 5, in <module>
    from graphein.cli import main
  File "/home/cam/.local/lib/python3.10/site-packages/graphein/cli.py", line 10, in <module>
    from graphein.utils.config_parser import parse_config
  File "/home/cam/.local/lib/python3.10/site-packages/graphein/utils/config_parser.py", line 11, in <module>
    from graphein.molecule.config import MoleculeGraphConfig
  File "/home/cam/.local/lib/python3.10/site-packages/graphein/molecule/__init__.py", line 1, in <module>
    from .atoms import *
  File "/home/cam/.local/lib/python3.10/site-packages/graphein/molecule/atoms.py", line 98, in <module>
    Chem.rdchem.HybridizationType.SP,
NameError: name 'Chem' is not defined

Appears that the try: except: wrapper around the import statement isn't doing what it's meant to? Nothing mentioning rdkit was picked up in the pip install as far as I can tell.

# graphein/molecule/atoms.py
try:
    import rdkit.Chem as Chem
except ImportError:
    import_message(
        "graphein.molecule.atoms", "rdkit", "rdkit", True, extras=True
    )

Note: this occurs when using python==3.10 as well.

@a-r-j
Copy link
Owner

a-r-j commented Apr 5, 2024

Thanks for flagging. I think pip install rdkit will do the trick for now. Looks like there are some imports that need to be caught and some better logging too.

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