2

A very similar problem, but different solution.

When I try to do import speech_recognition as sr in Jupyter, it returns the no moduled named... error.

But doing it in a terminal is fine. So I looked through the sys.paths of both. In Jupyter:

//anaconda/lib/python3.5/site-packages/six-1.10.0-py3.5.egg',
 '/Users/don',
 '/Users/don/Users/don/Documents/PyModules/skynet',
 '//anaconda/lib/python35.zip',
 '//anaconda/lib/python3.5',
 '//anaconda/lib/python3.5/plat-darwin',
 '//anaconda/lib/python3.5/lib-dynload',
 '/anaconda/lib/python3.5/site-packages/Sphinx-1.3.1-py3.5.egg',
 '//anaconda/lib/python3.5/site-packages',
 '//anaconda/lib/python3.5/site-packages/aeosa',
 '//anaconda/lib/python3.5/site-packages/IPython/extensions',
 '/Users/don/.ipython'

In terminal:

/Users/don/Applications/miniconda3/lib/python3.5/site-packages
/datashader-0.4.0-py3.5.egg
/Users/don
/Users/don/Users/don/Documents/PyModules/skynet
/Users/don/Applications/miniconda3/lib/python35.zip
/Users/don/Applications/miniconda3/lib/python3.5
/Users/don/Applications/miniconda3/lib/python3.5/plat-darwin
/Users/don/Applications/miniconda3/lib/python3.5/lib-dynload
/Users/don/Applications/miniconda3/lib/python3.5/site-packages
/Users/don/Applications/miniconda3/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg

If I run this first in Jupyter, then the module speech_recognition imports fine: sys.path.append('/Users/don/Applications/miniconda3/lib/python3.5/site-packages')

I'd just like to know what's going on? I've found a solution of sorts, but I'd like a more elegant one, so I don't have to do sys.path.append every time. This is particularly endemic to a bunch of modules I've installed lately using pip install <module>.

2
  • Are you running jupyter from within an activated conda environment? Commented Jan 6, 2017 at 9:50
  • I'm not too sure what that means...could you explain that? Commented Jan 22, 2017 at 11:20

1 Answer 1

3

This fixed it, but I don't know how or why. I just did $ pip3 install jupyter, and everything magically imported correctly after that. Nevertheless, if someone could give me a clue about what got fixed (because I don't even know what went wrong), that would be great.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.