ywx649999311 / vizic

A Jupyter-based Interactive Visualization Tool for Astronomical Catalogs
Other
13 stars 3 forks source link

Installation on Ubuntu 16.04 64 bit #8

Closed charlyms closed 7 years ago

charlyms commented 7 years ago

Hello, I am afraid something went wrong with my Installation of vizic on Ubuntu 16.04 64 bit. I am not familiar with python that much, can you please figure uot, what exactly went wrong? The output from terminal: charlyms@ubuntu:~/Downloads/vizic/examples$ jupyter notebook --NotebookApp.server_extensions="['vizic.mongo_ext.extension']" [W 07:15:47.440 NotebookApp] server_extensions is deprecated, use nbserver_extensions [I 07:15:47.609 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret

WARNING: version mismatch between CFITSIO header (v3.39) and linked library (v3.37).

WARNING: version mismatch between CFITSIO header (v3.39) and linked library (v3.37).

WARNING: version mismatch between CFITSIO header (v3.39) and linked library (v3.37).

/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') /usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') /usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') /usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.') [W 07:17:11.041 NotebookApp] Error loading server extension vizic.mongo_ext.extension Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py", line 1416, in _rebuild() File "/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py", line 1408, in _rebuild pickle_dump(fontManager, _fmcache) File "/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py", line 956, in pickle_dump with open(filename, 'wb') as fh: PermissionError: [Errno 13] Permission denied: '/home/charlyms/.cache/matplotlib/fontList.py3k.cache'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py", line 1046, in init_server_extensions
    mod = importlib.import_module(modulename)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/usr/local/lib/python3.5/dist-packages/vizic/__init__.py", line 3, in <module>
    from .astroleaflet import AstroMap, GridLayer
  File "/usr/local/lib/python3.5/dist-packages/vizic/astroleaflet.py", line 12, in <module>
    from .healpix import get_vert_bbox
  File "/usr/local/lib/python3.5/dist-packages/vizic/healpix.py", line 1, in <module>
    import healpy as hp
  File "/usr/local/lib/python3.5/dist-packages/healpy/__init__.py", line 55, in <module>
    from .visufunc import (mollview,graticule,delgraticules,gnomview,
  File "/usr/local/lib/python3.5/dist-packages/healpy/visufunc.py", line 55, in <module>
    from . import projaxes as PA
  File "/usr/local/lib/python3.5/dist-packages/healpy/projaxes.py", line 24, in <module>
    import matplotlib.axes
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/axes/__init__.py", line 4, in <module>
    from ._subplots import *
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/axes/_subplots.py", line 10, in <module>
    from matplotlib.axes._axes import Axes
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/axes/_axes.py", line 20, in <module>
    import matplotlib.collections as mcoll
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/collections.py", line 27, in <module>
    import matplotlib.backend_bases as backend_bases
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", line 62, in <module>
    import matplotlib.textpath as textpath
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/textpath.py", line 15, in <module>
    import matplotlib.font_manager as font_manager
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py", line 1421, in <module>
    _rebuild()
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py", line 1408, in _rebuild
    pickle_dump(fontManager, _fmcache)
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/font_manager.py", line 956, in pickle_dump
    with open(filename, 'wb') as fh:
PermissionError: [Errno 13] Permission denied: '/home/charlyms/.cache/matplotlib/fontList.py3k.cache'

[I 07:17:11.856 NotebookApp] Serving notebooks from local directory: /home/charlyms/Downloads/vizic/examples [I 07:17:11.858 NotebookApp] 0 active kernels [I 07:17:11.859 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/ [I 07:17:11.859 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [I 07:17:45.787 NotebookApp] Kernel started: 9c7d9bf7-8259-4f63-b00a-b10d91353082 [W 07:17:55.939 NotebookApp] Timeout waiting for kernel_info reply from 9c7d9bf7-8259-4f63-b00a-b10d91353082

Jupyter output:

from vizic import *
import pandas as pd
import numpy as np
from ipywidgets import *
# If Jupyter sever is not running on the local host or having a port different than
# 8888, NotebookUrl widget is needed to obtain server address
url = NotebookUrl()
url
# Initiate connection to mongodb database, the defaults are:
# host = 'localhost'; port=27017; db='vis'; 
# url='http://localhost:8888/' (this is for jupyter server)
c = Connection(url = url.nb_url)
---------------------------------------------------------------------------

MissingSchema                             Traceback (most recent call last)

<ipython-input-3-d885b0444e7b> in <module>()
      2 # host = 'localhost'; port=27017; db='vis';
      3 # url='http://localhost:8888/' (this is for jupyter server)
----> 4 c = Connection(url = url.nb_url)

/usr/local/lib/python3.5/dist-packages/vizic/connection.py in __init__(self, host, port, db, url)
     15             self.client = pg.MongoClient(host, port)
     16             self.db = self.client[db]
---> 17             self.change_db(db)
     18         except ConnectionFailure as err:
     19             print('Error: Connection to MongoDB instance is refused!')

/usr/local/lib/python3.5/dist-packages/vizic/connection.py in change_db(self, db)
     29         }
     30         path = url_path_join(self._url, '/connection/')
---> 31         req = requests.post(path, data=body)
     32         if req.status_code != 200:
     33             raise Exception('Change database failed!')

/usr/lib/python3/dist-packages/requests/api.py in post(url, data, json, **kwargs)
    105     """
    106 
--> 107     return request('post', url, data=data, json=json, **kwargs)
    108 
    109 

/usr/lib/python3/dist-packages/requests/api.py in request(method, url, **kwargs)
     51     # cases, and look like a memory leak in others.
     52     with sessions.Session() as session:
---> 53         return session.request(method=method, url=url, **kwargs)
     54 
     55 

/usr/lib/python3/dist-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    452             hooks = hooks,
    453         )
--> 454         prep = self.prepare_request(req)
    455 
    456         proxies = proxies or {}

/usr/lib/python3/dist-packages/requests/sessions.py in prepare_request(self, request)
    386             auth=merge_setting(auth, self.auth),
    387             cookies=merged_cookies,
--> 388             hooks=merge_hooks(request.hooks, self.hooks),
    389         )
    390         return p

/usr/lib/python3/dist-packages/requests/models.py in prepare(self, method, url, headers, files, data, params, auth, cookies, hooks, json)
    291 
    292         self.prepare_method(method)
--> 293         self.prepare_url(url, params)
    294         self.prepare_headers(headers)
    295         self.prepare_cookies(cookies)

/usr/lib/python3/dist-packages/requests/models.py in prepare_url(self, url, params)
    351             error = error.format(to_native_string(url, 'utf8'))
    352 
--> 353             raise MissingSchema(error)
    354 
    355         if not host:

MissingSchema: Invalid URL 'connection/': No schema supplied. Perhaps you meant http://connection/?
# display catalog for objects clicked
PopupDis(layer=g)
df_vizic = pd.read_csv('demo.csv')
df_vizic['radius'] = df_vizic.petroR90_r # assign radius column
g = GridLayer(c, coll_name="vizic", df=df_vizic, scale_r=2)
---------------------------------------------------------------------------

NameError                                 Traceback (most recent call last)

<ipython-input-5-7da0a1898616> in <module>()
----> 1 g = GridLayer(c, coll_name="vizic", df=df_vizic, scale_r=2)

NameError: name 'c' is not defined
# create map widget
m = AstroMap(default_tiles=g, zoom=1)
m
# color picker for layers
LayerColorPicker(layer=g)
# color by property
g.custom_c = True
cdrop = CFDropdown(g)
cdrop.layout.width= '50%'
cdrop
# filter object through slider bar
f = FilterWidget(g)
g.filter_obj = True
f.link()
f
jupyter nbextension enable --py --sys-prefix widgetsnbextension

Kind regards from Germany Charlyms

ywx649999311 commented 7 years ago

@charlyms Could could you please show me the Jupyter Notebook version you are using? if the version you are using is >=4.3.0, please downgrade jupyter and try it again. thanks

charlyms commented 7 years ago

Hello, I got this output: charlyms@ubuntu:~$ pip freeze | grep jupyter jupyter==1.0.0 jupyter-client==4.4.0 jupyter-console==5.0.0 jupyter-core==4.2.1 charlyms@ubuntu:~$ Can you please advice me how to downgrade? Regards from Germany Chrlyms

ywx649999311 commented 7 years ago

@charlyms actually the notebook version can be accessed by "pip show notebook" and to downgrade just do "pip install notebook==4.2.3" this should be work. Please check the notebook version first, if the version is not the problem, we can look at something else.

cheers

charlyms commented 7 years ago

Hello, sorry, I am surprised by the output: charlyms@ubuntu:~$ pip show notebook Name: notebook Version: 4.2.3 Summary: A web-based notebook environment for interactive computing Home-page: http://jupyter.org Author: Jupyter Development Team Author-email: jupyter@googlegroups.com License: BSD Location: /home/charlyms/.local/lib/python2.7/site-packages Requires: ipykernel, jupyter-core, traitlets, tornado, ipython-genutils, jupyter-client, nbformat, nbconvert, jinja2, terminado charlyms@ubuntu:~$ I am afraid, Jupyter seems not to be the culprit (?) can you please tell me on wich distr you run vizic successfully? I had a short unseccessfull attempt on Fedora either. Regards Charlyms

ywx649999311 commented 7 years ago

@charlyms Hey, I am sorry for this issue. But the configuration I had was python 3.4, Ubuntu 14.04. I think the error might comes from the dependencies. Please let me know if still not working, I can try it out with your configuration.

Also here: PermissionError: [Errno 13] Permission denied: '/home/charlyms/.cache/matplotlib/fontList.py3k.cache' may it help if you run jupyter under root?

charlyms commented 7 years ago

Running vizic as root didn´t solve the problem but deleting the file "fontList.py3k.cache". Nevertheless Igot the same errors running the notebook. Is something wrong with your connection.py? Please look again at this output in the notebook: ---> 17 self.change_db(db) 18 except ConnectionFailure as err: 19 print('Error: Connection to MongoDB instance is refused!') I assume with no connection the programm will not work at all. Please try it out with my configuration! Regards Charlyms

ywx649999311 commented 7 years ago

@charlyms last place to check, did you have a mongodb instance running?

ywx649999311 commented 7 years ago

@charlyms hi, I have also tested with your configuration inside a docker container (ubuntu 16.04, python 3.5), here i attached the Dockerfile. I have seen no problems with a fresh build.I will assume the error might still comes from the permission.

if you have anymore questions, please let me know.

iss8.txt

best,