Sublime Forum

ImportError: No module named 'Bio'

#1

All,

I’m puzzled. At the command line the system’s /usr/bin/python uses the “Bio” module, no error:

5020 > python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

from Bio.Seq import Seq
^D

But my plugin code starts like this:

import sublime, sublime_plugin
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC

And exits like this in the Console:

ImportError: No module named ‘Bio’

from Bio.Seq import Seq
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named ‘Bio’

Why is that?

Thank you,

Brian O.

0 Likes

#2

Ah. The embedded interpreter. So what is the best workaround, given that anyone who would want to use this plugin I’m making will have to install the “Bio” (BioPython) code?

0 Likes

#3

Let’s try something like this in Plugin.py:

import sys
sys.path.append(’/usr/local/lib/python3.4/site-packages’)
from Bio.Seq import Seq

0 Likes