AlgoLab / galig

A graph aligner
GNU General Public License v3.0
25 stars 12 forks source link

Installation Error: ModuleNotFoundError: No module named 'Bio' #21

Open Lisijun-m opened 1 year ago

Lisijun-m commented 1 year ago

I installed python3 biopython pysam gffutils pandas cmake samtools zlib in a newly created conda environment.

conda create -n asgal -y
conda activate asgal
conda install python=3.6 -y
conda install biopython
pip install pysam
pip install pandas
conda install samtools -y
conda install cmake -y
conda install gffutils -y
conda install zlib

And then execute the following commands:

git clone --recursive https://github.com/AlgoLab/galig.git
cd galig
make prerequisites
make

However when I try to run asgal (./asgal -h), there is an error:

Traceback (most recent call last):
  File "./asgal", line 12, in <module>
    from Bio import SeqIO
ModuleNotFoundError: No module named 'Bio'

How can I fix this problem?

ldenti commented 1 year ago

Hi, can you try running

python3 asgal.py -h

?

Lisijun-m commented 1 year ago

Unfortunately, when I use the example data of gene CG13375 in Drosophila Melanogaster I got the same error:

This is the command I executed: ~/galig/asgal -g genome.fa -a annotation.gtf -s sample_1.fa -o asgal_out

This is the error:

Traceback (most recent call last):
  File "/dat1/lisijun/galig/asgal", line 12, in <module>
    from Bio import SeqIO
ModuleNotFoundError: No module named 'Bio'
Lisijun-m commented 1 year ago

Hi, can you try running

python3 asgal.py -h

?

Command: python3 asgal.py -h

Error: python3: can't open file 'asgal.py': [Errno 2] No such file or directory

I searched though the galig directory, the bin directory and the scripts directory, but I can't find a python script named asgal.py. Where can I find asgal.py?

ldenti commented 1 year ago

Sorry, my fault, the script is asgal:

python3 asgal -h

(this from the root of this repo).

Lisijun-m commented 1 year ago

Sorry, my fault, the script is asgal:

python3 asgal -h

(this from the root of this repo).

It works! Now I can run the example data by asgal, thank you!

(By the way, I am wondering why there were errors like no python modules when executing asgal directly...)

ldenti commented 1 year ago

Great. I suspect it is due to the shebang https://github.com/AlgoLab/galig/blob/880811546525bb9c8afff44aea5ab375d0a33651/asgal#L1

Can you try to change it to

#!/usr/bin/env python

and try again with

./asgal -h

?

Lisijun-m commented 1 year ago

Since I installed ASGAL in a conda environment, I changed #!/usr/bin/python3 as !/dat1/lisijun/miniconda3/envs/asgal/bin/python

And it turns out that the command works! Thank you! ./asgal -h