Entering edit mode
2.7 years ago
Michal Nevo
▴
140
I'm working on a remote server with Linux. I created a new environment and got biopython installed with conda:
conda create --name new_bio python=3.5
conda activate new_bio
conda install -c conda-forge biopython
import Bio works when I am running it inside python:
(new_bio) -bash-4.2$ python
Python 3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:43)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Bio
>>> exit()
import Bio works when I am running my script like this:
(new_bio) -bash-4.2$ python my_Bio_script.py
hello
my_Bio_script.py:
from Bio import SeqIO
print('hello')
But when I try to run my script with Bash :
(new_bio) -bash-4.2$ sbash my_bash.sh
my_bash.sh bash file:
#!/bin/bash
module load anaconda ### load anaconda module
source activate new_bio ### activating environment, environment
must be configured before running the job
python my_Bio_script.py
I get this error:
Traceback (most recent call last):
File "T.py", line 1, in <module>
from Bio import SeqIO
ModuleNotFoundError: No module named 'Bio'
I have to send it as a Slurm Job in a bash file.. what can I do?