FZJ-INM1-BDA / siibra-python

Software interfaces for interacting with brain atlases - Python client
Apache License 2.0
47 stars 9 forks source link

[bug] cannot import Gitlab from gitlab #23

Closed xgui3783 closed 3 years ago

xgui3783 commented 3 years ago

from etienne:

ImportError                               Traceback (most recent call last)
<ipython-input-1-0026f1f8a7a3> in <module>
----> 1 import siibra
      2 siibra.logger.setLevel('INFO')
      3 siibra.__version__

/run/media/etienne/DATA/Toolbox/BraiNets/siibra-python/siibra/__init__.py in <module>
     27 from os import path
     28
---> 29 from .space import REGISTRY as spaces
     30 from .parcellation import REGISTRY as parcellations
     31 from .atlas import REGISTRY as atlases

/run/media/etienne/DATA/Toolbox/BraiNets/siibra-python/siibra/space.py in <module>
     14
     15 from .commons import create_key
---> 16 from .config import ConfigurationRegistry
     17 from .retrieval import download_file
     18 from .bigbrain import BigBrainVolume

/run/media/etienne/DATA/Toolbox/BraiNets/siibra-python/siibra/config.py in <module>
     16 from . import logger,__version__
     17 from .commons import create_key
---> 18 from gitlab import Gitlab
     19
     20 # Until openminds is fully supported,

ImportError: cannot import name 'Gitlab' from 'gitlab' (/home/etienne/anaconda3/lib/python3.7/site-packages/gitlab/__init__.py)
xgui3783 commented 3 years ago

I believe this issue does not have to do with python-gitlab issue. This is simply a namespace confusion issue

EtienneCmb commented 3 years ago

Hi @xgui3783 ,

Thank you for referencing my issue. Do you have a suggestion for fixing it?

xgui3783 commented 3 years ago

I don't have much experience using python outside virtualenv, unfortunately.

python-gitlab did indeed have a bug in v2.7.0 release (demonstrated here, issue here )

The proof of concept of the python-gitlab issue shows that the error occurs when one attempts to fetch a file from a repository, and much after from gitlab import Gitlab

can you maybe cat /home/etienne/anaconda3/lib/python3.7/site-packages/gitlab/__init__.py and we can try to diagnose why the import is failing?

dickscheid commented 3 years ago

Is there any update on this one? @EtienneCmb does siibra work for you now? If not we might have a short call to resolve this and explain here.

EtienneCmb commented 3 years ago

Hi @dickscheid ,

I finally fixed my Gitlab issue, probably not the cleanest workaround but I didn't found a better solution :

After that siibra import works

dickscheid commented 3 years ago

Hi @EtienneCmb , thanks for the followup! Hmmm... not too satsifactory but good that you solved it. We will then monitor if this reappears for other users, but close the issue.

EtienneCmb commented 3 years ago

I do agree, I tried clean uninstall through pip and conda, nothing worked :\