jupyter / jupyter/notebook

'import fbprophet' fails in ipython while it's ok in notebook

Open
#3,213 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

```
[root@0b56f3e010c5 /root]
#/root/anaconda3/bin/ipython
Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: import fbprophet
...: fbprophet.__version__
...:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in ()
----> 1 import fbprophet
2 fbprophet.__version__

/root/anaconda3/lib/python3.5/site-packages/fbprophet/__init__.py in ()
6 # of patent rights can be found in the PATENTS file in the same directory.
7
----> 8 from fbprophet.forecaster import Prophet
9
10 __version__ = '0.2.1'

/root/anaconda3/lib/python3.5/site-packages/fbprophet/forecaster.py in ()
18 logger = logging.getLogger(__name__)
19
---> 20 from matplotlib import pyplot as plt
21 from matplotlib.dates import MonthLocator, num2date
22 from matplotlib.ticker import FuncFormatter

/root/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py in ()
114 ## Global ##
115
--> 116 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
117
118 _IP_REGISTERED = None

/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/__init__.py in pylab_setup(name)
58 # imports. 0 means only perform absolute imports.
59 backend_mod = __import__(backend_name, globals(), locals(),
---> 60 [backend_name], 0)
61
62 # Things we pull in from all backends

/root/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_tkagg.py in ()
4
5 import six
----> 6 from six.moves import tkinter as Tk
7 from six.moves import tkinter_filedialog as FileDialog
8

/root/anaconda3/lib/python3.5/site-packages/six.py in __get__(self, obj, tp)
90
91 def __get__(self, obj, tp):
---> 92 result = self._resolve()
93 setattr(obj, self.name, result) # Invokes __set__.
94 try:

/root/anaconda3/lib/python3.5/site-packages/six.py in _resolve(self)
113
114 def _resolve(self):
--> 115 return _import_module(self.mod)
116
117 def __getattr__(self, attr):

/root/anaconda3/lib/python3.5/site-packages/six.py in _import_module(name)
80 def _import_module(name):
81 """Import module, returning the module after the last dot."""
---> 82 __import__(name)
83 return sys.modules[name]
84

/root/anaconda3/lib/python3.5/tkinter/__init__.py in ()
33 import sys
34
---> 35 import _tkinter # If this fails your Python may not be configured for Tk
36 TclError = _tkinter.TclError
37 from tkinter.constants import *

ImportError: libXdmcp.so.6: cannot open shared object file: No such file or directory

In [2]:
```

![image](https://user-images.githubusercontent.com/4527219/34969003-977565e8-faa7-11e7-9ee9-16e773405415.png)

It's very strange 'cause they should not have any difference.

Contributor guide

Open the contributing guide

Research direction

Reproduce the import from /root/anaconda3/bin/ipython and compare it with the notebook environment described in the report. Start with fbprophet/forecaster.py and the traceback through matplotlib/pyplot.py, backend_tkagg.py, and tkinter; the reported failure is the missing libXdmcp.so.6. Done means the environment difference is identified and importing fbprophet works consistently in both contexts.

Written by the indexing model from the issue text.

Assessment

Tech stack
anaconda, jupyter-notebook, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.