phac-nml / mob-suite

MOB-suite: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies
Apache License 2.0
115 stars 31 forks source link

Error in installing mob_suite-3.0.0 (either by conda or pip3) - pandas EmptyDataError issue #63

Closed bioprojects closed 3 years ago

bioprojects commented 4 years ago

Dear developers,

Thank you for developing mob-suite and making it pubic. I'm eager to utilize it.

However, I'm facing the following errors in in installing mob_suite-3.0.0 (either by conda or pip3).

Could you give me an advise how to fix it? Thank you very much in advance.

####################################################################### Error by conda resulting in "ImportError: cannot import name 'EmptyDataError' from 'pandas.io.common' although manual execution of "from pandas.io.common import EmptyDataError" in the python 3 console doesn't cause any error. #######################################################################

$ which conda ~/miniconda3/bin/conda

$ python --version Python 3.7.3

$ conda create -c bioconda -n mob_suite mob_suite Preparing transaction: done Verifying transaction: done Executing transaction: done ERROR conda.core.link:_execute(700): An error occurred while installing package 'bioconda::mob_suite-3.0.0-py_1'. Rolling back transaction: done

LinkError: post-link script failed for package bioconda::mob_suite-3.0.0-py_1
location of failed script: /home/k-yahara/miniconda3/envs/mob_suite/bin/.mob_suite-post-link.sh
==> script messages <==
<None>
==> script output <==
stdout:
stderr: Traceback (most recent call last):
  File "/home/k-yahara/miniconda3/envs/mob_suite/bin/mob_init", line 7, in <module>
    from mob_suite.mob_init import main
  File "/home/k-yahara/miniconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/mob_init.py", line 8, in <module>
    from mob_suite.blast import BlastRunner
  File "/home/k-yahara/miniconda3/envs/mob_suite/lib/python3.8/site-packages/mob_suite/blast/__init__.py", line 9, in <module>
    from pandas.io.common import EmptyDataError
ImportError: cannot import name 'EmptyDataError' from 'pandas.io.common' (/home/k-yahara/miniconda3/envs/mob_suite/lib/python3.8/site-packages/pandas/io/common.py)

return code: 1

####################################################################### Error by pip #######################################################################

$ which pip ~/miniconda3/bin/pip

$ pip install --user mob_suite

g++ -c -pipe -O2 -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DPy_LIMITED_API=0x03040000 -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I. -I.. -I/home/k-yahara/miniconda3/include/python3.7m -I/home/k-yahara/miniconda2/include/qt -I/home/k-yahara/miniconda2/include/qt/QtMultimedia -I/home/k-yahara/miniconda2/include/qt/QtGui -I/home/k-yahara/miniconda2/include/qt/QtNetwork -I/home/k-yahara/miniconda2/include/qt/QtCore -I. -I/home/k-yahara/miniconda2/mkspecs/linux-g++ -o sipQtMultimediaQCustomAudioRoleControl.o sipQtMultimediaQCustomAudioRoleControl.cpp
/tmp/pip-install-1px41fwf/pyqt5/sip/QtMultimedia/qcustomaudiorolecontrol.sip:26:10: fatal error: qcustomaudiorolecontrol.h: No such file or directory
 #include <qcustomaudiorolecontrol.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:9092: sipQtMultimediaQCustomAudioRoleControl.o] Error 1
make[1]: Leaving directory '/tmp/tmpo14sga4w/QtMultimedia'
make: *** [Makefile:504: sub-QtMultimedia-make_first-ordered] Error 2
----------------------------------------

ERROR: Command "/home/k-yahara/miniconda3/bin/python /home/k-yahara/miniconda3/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp5gks5ebc" failed with error code 1 in /tmp/pip-install-1px41fwf/pyqt5

##################################### Koji Yahara Group Leader Antimicrobial Resistance Research Center National Institute of Infectious Diseases Aoba-cho 4-2-1, Higashimurayama-shi, Tokyo 189-0002 Japan

kbessonov1984 commented 4 years ago

Dear Koji Yahara, Thank you for reporting this issue. I was able to reproduce your error and have a solution ready.

Conda install error MOB-Suite v3.0.0

Issue: Upon conda install the following import statement fails from pandas.io.common import EmptyDataError to run

Traceback (most recent call last):
  File "/galaxy/database/dependencies/_conda/envs/mob_suite@3.0.0/bin/mob_typer", line 7, in <module>
    from mob_suite.mob_typer import main
  File "/galaxy/database/dependencies/_conda/envs/mob_suite@3.0.0/lib/python3.7/site-packages/mob_suite/mob_typer.py", line 7, in <module>
    import mob_suite.mob_init
  File "/galaxy/database/dependencies/_conda/envs/mob_suite@3.0.0/lib/python3.7/site-packages/mob_suite/mob_init.py", line 8, in <module>
    from mob_suite.blast import BlastRunner
  File "/galaxy/database/dependencies/_conda/envs/mob_suite@3.0.0/lib/python3.7/site-packages/mob_suite/blast/__init__.py", line 9, in <module>
    from pandas.io.common import EmptyDataError
ImportError: cannot import name 'EmptyDataError' from 'pandas.io.common' (/galaxy/database/dependencies/_conda/envs/mob_suite@3.0.0/lib/python3.7/site-packages/pandas/io/common.py)

Reason: pandas>=1.1.0 code update Solution: Recently published pandas version 1.1.0 does not haveEmptyDataErrordefinition in pandas/io/common.py. The exceptions are located as before in pandas.errors.EmptyDataError. As a temporary solution please install pandas version that is not equal or higher that 1.1.0 (e.g. try version 1.0.5).
After conda fresh environment creation please run

conda install pandas==1.0.5 -y
conda install mob_suite==3.0.0 -y

Meanwhile will update conda package explicitly restricting higher pandas versions and subsequently update code in mob_suite/blast/__init__.py to from pandas.error import EmptyDataError

Pip installation error MOB-Suite v3.0.0

I got the same pandas related error via pip install and the remediation is again pip install pandas==1.0.5. I was not able to reproduce the qcustomaudiorolecontrol.h gcc error, but what I've found is that newest PyQt version >=5.14 has some issues so try to downgrade to version 5.11 (pip install pyqt5==5.11.3)

Successfully installed PyQt5-sip-4.19.19 pyqt5-5.11.3
bioprojects commented 4 years ago

Thank you very much! The temporary solution enabled me to install it using conda in an environment.

Another environment caused the "Found conflicts!" error when I tried "conda install pandas==1.0.5 -y". I will try the permanent solution in the environment when it is released.

Thank you very much again.

kbessonov1984 commented 4 years ago

In a couple of days a new conda build 2 for MOB-Suite version 3.0.0 will be released with the pandas version restricted range up to 1.0.5. The code fix making it compatible with any future pandas version will be released in future MOB-Suite version 3.0.1 in several of weeks. The Found conflicts environment resolution error might be due to a shared common pandas dependency by several tools in that environment that request incompatible version ranges. We recommend to have a separate conda environment for each tool.

bioprojects commented 4 years ago

Thank you very much. I'm looking forward to the release of version 3.0.1.

In a computing cluster system, in order to "have a separate conda environment for each tool", I executed $ conda create -c anaconda -n pandas pandas==1.0.5 $ conda activate pandas $ (pandas) conda create -n mob_suite mob_suite==3.0.0 but it still caused the same error. So I will try the version 3.0.1 for this environment.

Many thanks again.

kbessonov1984 commented 4 years ago

Hello, yesterday a new mob_suite conda recipe was released fixing the pandas library issue. To install it simply run again conda install -c bioconda mob_suite and version 3.0.0 build 2 should be installed.

With respect to separate environments I meant that it is better to have separate environment for each tool like mob-suite, spades assembler, etc. (not for pandas library).

The release of version 3.0.1 will be not immediate so I advise to use current updated conda environment. Install via pip still needs pip install pandas==1.0.5 step before mob_suite install. This will be fixed in the 3.0.1 releasae

tseemann commented 3 years ago

Will mob_suite ever support pands>=1.1 ?

kbessonov1984 commented 3 years ago

@tseemann starting version 3.0.1 pandas version 1.1 and above is compatible as we moved EmptyDataFrame exception import from pandas.errors module (and we expect all future versions will work too). We just restricted the version to 1.0.5 in case pandas developers will modify something else in their code breaking the tool as we saw happening in pandas version 1.1. Is there any particular interest in making pandas version range be broader?

caizhangbin commented 6 months ago

Hi, I installed the software using pip but it gave me the EmptyDataError when running the program. Pandas version was 2.1.0. any solution?

kbessonov1984 commented 6 months ago

Yes, we do not support pandas 2.0 and above. Downgrade to version 1.5.3 inclusive or lower and all issues should disappear. This pandas version range is also in conda recipe.

To support pandas 3.0 (that would be released soon), 2.0 and 1.0 we would require serious code overhaul as pandas library changes quite a lot between releases.