2

I created conda Python3.6 environment called betting.

Next activated the env with source activate betting

I run pip install betfairlightweight for the package.

Running pip list tells package is installed, but notebook fails to import the package with error > ModuleNotFoundError: No module named 'betfairlightweight'

Based on StackOverflow question 36382508

I installed ipykernel to this environment. Stopped and ran jupyter notebook from this env. However it seems that it does not solve my issue. I also tried to install notebook to this env, but import still fails to find module.

I added the same conda betting envaroment to PyCharm and importing betfairlightweight works fine. So this is clearly linked to notebook.

Next in notebook, I run >

import sys
print(sys.executable)

Seems that my notebook is running from anaconda root, which explains why it cannot find the package. How do change from which env notebook runs? I am already on that env. Do I need to run jupyter from absolute path or something?

Kimmo Hintikka
  • 13,472
  • 7
  • 34
  • 63
  • 1
    How did you start the Jupyter Notebook? It sounds like you might have started it from terminal without having done `source activate betting` before `jupyter notebook`? – Little Bobby Tables Mar 13 '17 at 09:55
  • I have actually that makes this weird. I gave up and just installed pip package to root env as I just need to quickly test something and share the notebook. I can then delete the whole thing after. Only place where this does not work is Jupyter notebook I can use Spyder without an issue as well. – Kimmo Hintikka Mar 13 '17 at 11:41

0 Answers0