I would like to use SOMPY from my Jupiter Notebook Hub.
> print (sys.version)
2.7.12 | packaged by conda-forge | (default, Feb 9 2017, 14:36:30)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]
> !git clone https://github.com/sevamoo/SOMPY.git;
> !cd SOMPY; python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to SOMPY.egg-info/requires.txt
writing SOMPY.egg-info/PKG-INFO
writing top-level names to SOMPY.egg-info/top_level.txt
writing dependency_links to SOMPY.egg-info/dependency_links.txt
reading manifest file 'SOMPY.egg-info/SOURCES.txt'
writing manifest file 'SOMPY.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/sompy
copying build/lib/sompy/codebook.py -> build/bdist.linux-x86_64/egg/sompy
copying build/lib/sompy/__init__.py -> build/bdist.linux-x86_64/egg/sompy
copying build/lib/sompy/normalization.py -> build/bdist.linux-x86_64/egg/sompy
copying build/lib/sompy/neighborhood.py -> build/bdist.linux-x86_64/egg/sompy
creating build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/view.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/hitmap.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/umatrix.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/__init__.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/bmuhits.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/mapview.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/histogram.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/visualization/dotmap.py -> build/bdist.linux-x86_64/egg/sompy/visualization
copying build/lib/sompy/sompy.py -> build/bdist.linux-x86_64/egg/sompy
copying build/lib/sompy/decorators.py -> build/bdist.linux-x86_64/egg/sompy
byte-compiling build/bdist.linux-x86_64/egg/sompy/codebook.py to codebook.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/normalization.py to normalization.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/neighborhood.py to neighborhood.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/view.py to view.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/hitmap.py to hitmap.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/umatrix.py to umatrix.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/bmuhits.py to bmuhits.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/mapview.py to mapview.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/histogram.py to histogram.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/visualization/dotmap.py to dotmap.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/sompy.py to sompy.pyc
byte-compiling build/bdist.linux-x86_64/egg/sompy/decorators.py to decorators.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying SOMPY.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying SOMPY.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying SOMPY.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying SOMPY.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying SOMPY.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/SOMPY-1.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing SOMPY-1.0-py2.7.egg
Removing /opt/conda/envs/python2/lib/python2.7/site-packages/SOMPY-1.0-py2.7.egg
Copying SOMPY-1.0-py2.7.egg to /opt/conda/envs/python2/lib/python2.7/site-packages
SOMPY 1.0 is already the active version in easy-install.pth
Installed /opt/conda/envs/python2/lib/python2.7/site-packages/SOMPY-1.0-py2.7.egg
Processing dependencies for SOMPY==1.0
Searching for numexpr==2.6.2
Best match: numexpr 2.6.2
Adding numexpr 2.6.2 to easy-install.pth file
Using /opt/conda/envs/python2/lib/python2.7/site-packages
Searching for scikit-learn==0.18
Best match: scikit-learn 0.18
Adding scikit-learn 0.18 to easy-install.pth file
Using /opt/conda/envs/python2/lib/python2.7/site-packages
Searching for scipy==0.19.0
Best match: scipy 0.19.0
Adding scipy 0.19.0 to easy-install.pth file
Using /opt/conda/envs/python2/lib/python2.7/site-packages
Searching for numpy==1.12.0
Best match: numpy 1.12.0
Adding numpy 1.12.0 to easy-install.pth file
Using /opt/conda/envs/python2/lib/python2.7/site-packages
Finished processing dependencies for SOMPY==1.0
Because trying import sompy raises exception about lack of ipdb module (ipdb is not listed in setup.py), I have installed it manually:
>!pip install ipdb
Collecting ipdb
Downloading ipdb-0.10.3.tar.gz
Requirement already satisfied: setuptools in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipdb)
Requirement already satisfied: ipython<6.0.0,>=0.10.2 in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipdb)
Requirement already satisfied: pickleshare in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: decorator in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: traitlets>=4.2 in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: pexpect; sys_platform != "win32" in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: simplegeneric>0.8 in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: pygments in /opt/conda/envs/python2/lib/python2.7/site-packages (from ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: six>=1.9.0 in /opt/conda/envs/python2/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: wcwidth in /opt/conda/envs/python2/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: ipython-genutils in /opt/conda/envs/python2/lib/python2.7/site-packages (from traitlets>=4.2->ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: enum34; python_version == "2.7" in /opt/conda/envs/python2/lib/python2.7/site-packages (from traitlets>=4.2->ipython<6.0.0,>=0.10.2->ipdb)
Requirement already satisfied: scandir in /opt/conda/envs/python2/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython<6.0.0,>=0.10.2->ipdb)
Building wheels for collected packages: ipdb
Running setup.py bdist_wheel for ipdb ... - done
Stored in directory: /home/jovyan/.cache/pip/wheels/cd/9e/a2/b521d7d90da1032f805e08bf00dce70101ddc39dcb1bb245cb
Successfully built ipdb
Installing collected packages: ipdb
Successfully installed ipdb-0.10.3
> import sys
> sys.path.insert(0, '/SOMPY/sompy/')
> import sompy
MultipleInstanceErrorTraceback (most recent call last)
<ipython-input-7-e59cc99b7bc9> in <module>()
1 import sys
2 sys.path.insert(0, '/SOMPY/sompy/')
----> 3 import sompy
build/bdist.linux-x86_64/egg/sompy/__init__.py in <module>()
/opt/conda/envs/python2/lib/python2.7/site-packages/SOMPY-1.0-py2.7.egg/sompy/sompy.pyc in <module>()
30
31 #lbugnon
---> 32 import sompy,ipdb
33 #
34
/opt/conda/envs/python2/lib/python2.7/site-packages/ipdb/__init__.py in <module>()
5 # https://opensource.org/licenses/BSD-3-Clause
6
----> 7 from ipdb.__main__ import set_trace, post_mortem, pm, run # noqa
8 from ipdb.__main__ import runcall, runeval, launch_ipdb_on_exception # noqa
9
/opt/conda/envs/python2/lib/python2.7/site-packages/ipdb/__main__.py in <module>()
60 # the instance method will create a new one without loading the config.
61 # i.e: if we are in an embed instance we do not want to load the config.
---> 62 ipapp = TerminalIPythonApp.instance()
63 shell = get_ipython()
64 def_colors = shell.colors
/opt/conda/envs/python2/lib/python2.7/site-packages/traitlets/config/configurable.pyc in instance(cls, *args, **kwargs)
421 raise MultipleInstanceError(
422 'Multiple incompatible subclass instances of '
--> 423 '%s are being created.' % cls.__name__
424 )
425
MultipleInstanceError: Multiple incompatible subclass instances of TerminalIPythonApp are being created.
I would like to use SOMPY from my Jupiter Notebook Hub.
Because trying import sompy raises exception about lack of ipdb module (ipdb is not listed in setup.py), I have installed it manually:
What version of ipdb are you using?