0

The import is import pandas_market_calendars.

First let's see that it's available in the virtualenv:

me@me-ThinkPad-T470p:~/myprojct/bin$ source activate
(myprojct) me@me-ThinkPad-T470p:~/myprojct/bin$ ipython
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: 

In [1]: import pandas_market_calendars

In [2]: quit()

Good. Now I launch the jupyter notebook:

(myprojct) me@me-ThinkPad-T470p:~/myprojct/docs$ jupyter notebook unit_tests.ipynb

and in that notebook, I have a line:

import pandas_market_calendars

that gives:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-2-686a3ec1e720> in <module>()
----> 1 import pandas_market_calendars

ImportError: No module named 'pandas_market_calendars'
user189035
  • 5,589
  • 13
  • 52
  • 112
  • 1
    You actually need a jupyter notebook installation and kernel that point to your virtualenv python interpreter. The notebook you're opening is probably pointing to a python version outside of your virtual environment. – Abdou Dec 25 '17 at 23:54
  • @abdou: thanks that helps a lot (total jupyter newbie here). Do you mean something [like this?](https://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs/) – user189035 Dec 25 '17 at 23:56
  • 1
    That is exactly what I am referring to. Give it a go and see if it'll do. – Abdou Dec 25 '17 at 23:59
  • @Abdou: it worked! Thanks again for the pointer! – user189035 Dec 26 '17 at 00:01

0 Answers0