gbouras13 / pharokka

fast phage annotation program
MIT License
149 stars 17 forks source link

ModuleNotFoundError: No module named 'Bio' #200

Closed camilogarciabotero closed 2 years ago

camilogarciabotero commented 2 years ago

Description

Hi George,

I tried the new version (v0.1.11) installed via mamba (mamba install pharokka), but once the downloaded is completed and run the help menu, an error was printed: ModuleNotFoundError: No module named 'Bio'

What I Did

pharokka.py -h

The entire error output:

Traceback (most recent call last):
  File "/Applications/miniconda3/envs/pharokka/bin/pharokka.py", line 3, in <module>
    import input_commands
  File "/Applications/miniconda3/envs/pharokka/bin/input_commands.py", line 5, in <module>
    from Bio import SeqIO
ModuleNotFoundError: No module named 'Bio'

Conda environment list

Here is my conda envirnment list:

# packages in environment at /Applications/miniconda3/envs/pharokka:
#
# Name                    Version                   Build  Channel
aragorn                   1.2.41               ha5712d3_0    bioconda
backports                 1.0                        py_2    conda-forge
backports.tempfile        1.0                        py_0    conda-forge
backports.weakref         1.0.post1       pyhd8ed1ab_1003    conda-forge
bcbio-gff                 0.6.9              pyh5e36f6f_0    bioconda
biopython                 1.79            py310h1961e1f_2    conda-forge
brotli                    1.0.9                h5eb16cf_7    conda-forge
brotli-bin                1.0.9                h5eb16cf_7    conda-forge
bx-python                 0.9.0           py310hd9b96a7_0    bioconda
bzip2                     1.0.8                h0d85af4_4    conda-forge
ca-certificates           2022.6.15.2          h033912b_0    conda-forge
certifi                   2022.6.15.2        pyhd8ed1ab_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
emboss                    6.6.0                h6debe1e_0    bioconda
expat                     2.4.8                h96cf925_0    conda-forge
fastpath                  1.9             py310he24745e_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.0               h5bb23bf_1    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.37.0          py310h90acd4f_0    conda-forge
freetype                  2.12.1               h3f81eb7_0    conda-forge
gawk                      5.1.0                h8a989fb_0    conda-forge
gettext                   0.19.8.1          hd1a6beb_1008    conda-forge
giflib                    5.2.1                hbcb3906_2    conda-forge
hhsuite                   3.3.0           py310pl5321h6c969c3_5    bioconda
icu                       70.1                 h96cf925_0    conda-forge
infernal                  1.1.4           pl5321ha5712d3_1    bioconda
jpeg                      9e                   hac89ed1_2    conda-forge
kiwisolver                1.4.4           py310habb735a_0    conda-forge
lcms2                     2.12                 h577c468_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libblas                   3.9.0           16_osx64_openblas    conda-forge
libbrotlicommon           1.0.9                h5eb16cf_7    conda-forge
libbrotlidec              1.0.9                h5eb16cf_7    conda-forge
libbrotlienc              1.0.9                h5eb16cf_7    conda-forge
libcblas                  3.9.0           16_osx64_openblas    conda-forge
libcxx                    14.0.6               hccf4f1f_0    conda-forge
libdeflate                1.14                 hb7f2c08_0    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgd                     2.3.3                h1e214de_3    conda-forge
libgfortran               5.0.0           10_4_0_h97931a8_25    conda-forge
libgfortran5              11.3.0              h082f757_25    conda-forge
libiconv                  1.16                 haf1e3a3_0    conda-forge
libidn2                   2.3.3                hac89ed1_0    conda-forge
liblapack                 3.9.0           16_osx64_openblas    conda-forge
libopenblas               0.3.21          openmp_h429af6e_3    conda-forge
libpng                    1.6.37               h5481273_4    conda-forge
libsqlite                 3.39.3               ha978bb4_0    conda-forge
libtiff                   4.4.0                hdb44e8a_4    conda-forge
libunistring              0.9.10               h0d85af4_0    conda-forge
libwebp                   1.2.4                hfa4350a_0    conda-forge
libwebp-base              1.2.4                h775f41a_0    conda-forge
libxcb                    1.13              h0d85af4_1004    conda-forge
libzlib                   1.2.12               hfd90126_3    conda-forge
llvm-openmp               14.0.4               ha654fa7_0    conda-forge
lzo                       2.10              haf1e3a3_1000    conda-forge
matplotlib-base           3.5.3           py310h1bfeb8c_2    conda-forge
minced                    0.4.2                hdfd78af_1    bioconda
mmseqs2                   13.45111        pl5321hdb1ff06_2    bioconda
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
numpy                     1.23.3          py310h1b7c290_0    conda-forge
openjdk                   17.0.3               hbc0c0cd_2    conda-forge
openjpeg                  2.5.0                h5d0d7b0_1    conda-forge
openssl                   3.0.5                hfd90126_2    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pandas                    1.4.4           py310hecf8f37_0    conda-forge
patsy                     0.5.2              pyhd8ed1ab_0    conda-forge
perl                      5.32.1          2_h0d85af4_perl5    conda-forge
phanotate                 1.5.0                hb6a186f_2    bioconda
pharokka                  0.1.11               hdfd78af_0    bioconda
pillow                    9.2.0           py310h54af1cc_2    conda-forge
pip                       22.2.2             pyhd8ed1ab_0    conda-forge
prodigal                  2.6.3                ha5712d3_4    bioconda
pthread-stubs             0.4               hc929b4f_1001    conda-forge
pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
python                    3.10.6          hc14f532_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-lzo                1.14            py310h484c9e0_1    conda-forge
python_abi                3.10                    2_cp310    conda-forge
pytz                      2022.2.1           pyhd8ed1ab_0    conda-forge
readline                  8.1.2                h3899abd_0    conda-forge
scipy                     1.9.1           py310h240c617_0    conda-forge
seaborn                   0.12.0               hd8ed1ab_0    conda-forge
seaborn-base              0.12.0             pyhd8ed1ab_0    conda-forge
setuptools                65.3.0             pyhd8ed1ab_1    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
statsmodels               0.13.2          py310h1bbcd0e_0    conda-forge
textwrap3                 0.9.2                      py_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
trnascan-se               2.0.9           pl5321ha5712d3_3    bioconda
typing_extensions         4.3.0              pyha770c72_0    conda-forge
tzdata                    2022c                h191b570_0    conda-forge
unicodedata2              14.0.0          py310h1961e1f_1    conda-forge
wget                      1.20.3               hd3787cc_1    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.9                h35c211d_0    conda-forge
xorg-libxdmcp             1.1.3                h35c211d_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
zlib                      1.2.12               hfd90126_3    conda-forge
zstd                      1.5.2                hfa58983_4    conda-forge

Which is weird because Bioconda is in there. By the way the emboss library is still being downloaded from conda.

Best.

gbouras13 commented 2 years ago

Gday Camilo,

That is an extremely strange error indeed - it should not be occurring as biopython is installed with Pharokka (and also shouldn't be occurring because the tests to update the version in Bioconda would have caught this).

All I can think is that there is an error with Biopython in your environment.

I would recommend manually re-installing biopython into your environment.

conda uninstall biopython then `conda install biopython'

to see if that works. Otherwise try a completely new environment install. Otherwise, perhaps try a manual install from the GitHub repo/release v0.1.11.

Regarding emboss, I am planning on doing a significant re-write of the codebase to make it more streamlined in the next few weeks. I will make sure emboss (and hh-suite) are removed from the bioconda dependencies when this happens - you cannot remove them with an automatic version update on bioconda.

George

gbouras13 commented 2 years ago

Hi Camilo,

I tried to install Pharokka on a HPC and ran into the same error as you regarding Biopython - and when I tried to install Biopython manually I ran into a solving error relating to Python 3.1 (which means there is some issue with Python 3.10 in my experience).

Therefore, I would try

conda create -n pharokka_env pharokka==0.1.11 python=3.9

which will create an environment called pharokka_env with Pharokka v0.1.11 and python 3.9 installed. This worked for me.

Let me know how this goes.

George

gbouras13 commented 2 years ago

Hi Camilo,

As you can probably see with the activity on the repo, I have updated pharokka to v1.0.0.

Hopefully this solves the issue. You will need to re-install the databases before running pharokka.

George

camilogarciabotero commented 2 years ago

Hey George,

Sorry for the delayed response. Made all the previous suggestions. Even the reinstallation in a new environment and still the message keeps appearing... Any other alternative?

gbouras13 commented 2 years ago

Hi Camilo,

This is a very strange error - especially considering that you seem to have a correctly installed environment.

Seeing as you are running Monterey 12.6, the other issue I can think of is that there could be some issue with Monterey and conda (particularly if you are running this on an M1 chip Mac). I have come across such issues in the past (not with Monterey though) so it might be a conda issue.

e.g. this seems similar to your issue https://stackoverflow.com/questions/73727787/monterey-12-6-and-conda-environment-issue

George

gbouras13 commented 2 years ago

Hi Camilo,

Any update with this error? I'd recommend trying a fresh pharokka v1.1.0 install and seeing if the issue persists.

George

camilogarciabotero commented 2 years ago

Hi George,

Just tried and it is now working! No idea what was going on here, but I'll close the issue. Thanks.