Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Export missing dependencies #247

Closed
Gdsimms opened this issue Aug 15, 2020 · 12 comments
Closed

Code Export missing dependencies #247

Gdsimms opened this issue Aug 15, 2020 · 12 comments

Comments

@Gdsimms
Copy link

Gdsimms commented Aug 15, 2020

I have only used dtale interactively until today when I decided to try exporting a chart (map) to my jupyter lab notebook to render the figure there.

I made the map chart look like I wanted, hit the code export button, pasted the copied code, made sure the dataframe I was using was copied to one named "df", and executed the cell in Jupyter Lab. The error I get is:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-31-22e8c42a521f> in <module>
     39         text=chart_data['aere_adsb_deg']
     40 )
---> 41 figure = go.Figure(data=[chart], layout=Layout({
     42     'autosize': True,
     43     'legend': {'orientation': 'h'},

NameError: name 'Layout' is not defined

With regard to dependencies, my own code has:

import pandas as pd
pd.options.mode.chained_assignment = None # default = 'warn'
import numpy as np
from IPython.display import clear_output
import sqlite3
import dtale
import matplotlib.pyplot as plt
import random
import pickle
from sqlalchemy import create_engine
import contextlib
import glob
import datetime
import os
import os.path
import pymap3d as pm

I did not specifically import the go. package, but it looks from searching that it may be related to Plotly....?

Anyway, I'd sure like to know what dependency to add in order to allow this code to run.

@Gdsimms
Copy link
Author

Gdsimms commented Aug 16, 2020

I changed the layout=Layout(... to layout=go.Layout(... and it at least accepted and ran the code. I then tried executing figure.show() and got a large blank drawn in my Jupyter lab notebook.

@Gdsimms
Copy link
Author

Gdsimms commented Aug 16, 2020

Now I've tried:

import plotly.io as pio

pio.renderers.default = 'jupyterlab'
print(pio.renderers)

of all the available renderers:

-----------------------
    Default renderer: 'jupyterlab'
    Available renderers:
        ['plotly_mimetype', 'jupyterlab', 'nteract', 'vscode',
         'notebook', 'notebook_connected', 'kaggle', 'azure', 'colab',
         'cocalc', 'databricks', 'json', 'png', 'jpeg', 'jpg', 'svg',
         'pdf', 'browser', 'firefox', 'chrome', 'chromium', 'iframe',
         'iframe_connected', 'sphinx_gallery', 'sphinx_gallery_png']

I've tried a few and 'browser' works in a new browser window but it does not have the map tiles I selected in the dtale maps view, instead it uses a very low-resolution monochrome map of coastlines only.

@Gdsimms
Copy link
Author

Gdsimms commented Aug 16, 2020

My environment:
Windows 10
Anaconda python

(base) C:\Users\g>conda list
# packages in environment at C:\Users\g\Anaconda3:
#
# Name                    Version                   Build  Channel
_anaconda_depends         2020.07                  py37_0
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0
alabaster                 0.7.12                     py_0    conda-forge
anaconda                  custom                   py37_1
anaconda-client           1.7.2                      py_0    conda-forge
anaconda-navigator        1.9.12                   py37_0
anaconda-project          0.8.3                      py_0    conda-forge
argh                      0.26.2          pyh9f0ad1d_1002    conda-forge
argon2-cffi               20.1.0           py37h4ab8f01_1    conda-forge
asn1crypto                1.4.0              pyh9f0ad1d_0    conda-forge
astroid                   2.3.3                    py37_1    conda-forge
astropy                   4.0.1.post1      py37h8055547_0    conda-forge
atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge
attrs                     19.3.0                     py_0    conda-forge
autopep8                  1.5.4              pyh9f0ad1d_0    conda-forge
babel                     2.8.0                      py_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.1                      py_0    conda-forge
backports.shutil_get_terminal_size 1.0.0                      py_3    conda-forge
backports.tempfile        1.0                        py_0    conda-forge
backports.weakref         1.0.post1       py37hc8dfbb8_1001    conda-forge
bcrypt                    3.1.7            py37h8055547_1    conda-forge
beautifulsoup4            4.6.3                    pypi_0    pypi
bitarray                  1.5.1            py37h4ab8f01_0    conda-forge
bkcharts                  0.2                      py37_0
blas                      1.0                         mkl
bleach                    3.1.5              pyh9f0ad1d_0    conda-forge
blosc                     1.20.0               ha925a31_0    conda-forge
bokeh                     2.1.1            py37hc8dfbb8_0    conda-forge
boto                      2.49.0                     py_0    conda-forge
bottleneck                1.3.2            py37hbc2f12b_1    conda-forge
branca                    0.4.1                    pypi_0    pypi
brotli                    1.0.7             ha925a31_1004    conda-forge
brotlipy                  0.7.0           py37h4ab8f01_1000    conda-forge
bzip2                     1.0.8                he774522_2    conda-forge
ca-certificates           2020.6.20            hecda079_0    conda-forge
certifi                   2020.6.20        py37hc8dfbb8_0    conda-forge
cffi                      1.14.1           py37h26f1ce3_0    conda-forge
chardet                   3.0.4           py37hc8dfbb8_1006    conda-forge
charls                    2.1.0                h33f27b4_2    conda-forge
clang_variant             1.0                     default    conda-forge
clangdev                  5.0.0             h87ae9c4_1008    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
cling                     0.5                           3  [cling vc14]  gouarin
cling-patches             1                             0    conda-forge
cloudpickle               1.5.0                      py_0    conda-forge
clyent                    1.2.2                      py_1    conda-forge
colorama                  0.4.3                      py_0    conda-forge
comtypes                  1.1.7           py37hc8dfbb8_1001    conda-forge
conda                     4.8.4            py37hc8dfbb8_2    conda-forge
conda-build               3.18.9                   py37_3
conda-env                 2.6.0                         1
conda-package-handling    1.7.0            py37h4ab8f01_4    conda-forge
conda-verify              3.4.2                      py_1
console_shortcut          0.1.1                         3
contextlib2               0.6.0.post1                py_0    conda-forge
cppzmq                    4.6.0                h1ad3211_0    conda-forge
cryptography              3.0              py37h26f1ce3_0    conda-forge
cryptopp                  7.0.0             he025d50_1004    conda-forge
curl                      7.71.1               h4b64cdc_4    conda-forge
cycler                    0.10.0                     py_2    conda-forge
cython                    0.29.21          py37h1834ac0_0    conda-forge
cytoolz                   0.10.1           py37hfa6e2cd_0    conda-forge
dash                      1.14.0             pyh9f0ad1d_0    conda-forge
dash-bootstrap-components 0.10.3             pyh9f0ad1d_0    conda-forge
dash-core-components      1.10.2             pyh9f0ad1d_0    conda-forge
dash-daq                  0.5.0              pyh9f0ad1d_1    conda-forge
dash-html-components      1.0.3              pyh9f0ad1d_0    conda-forge
dash-renderer             1.6.0              pyh9f0ad1d_0    conda-forge
dash-table                4.9.0              pyh9f0ad1d_0    conda-forge
dash_colorscales          0.0.4              pyh9f0ad1d_0    conda-forge
dask                      2.23.0                     py_0    conda-forge
dask-core                 2.23.0                     py_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
diff-match-patch          20200713           pyh9f0ad1d_0    conda-forge
distributed               2.23.0           py37hc8dfbb8_0    conda-forge
docutils                  0.16             py37hc8dfbb8_1    conda-forge
dtale                     1.13.0             pyh9f0ad1d_0    conda-forge
entrypoints               0.3             py37hc8dfbb8_1001    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
fastcache                 1.1.0            py37h8055547_1    conda-forge
filelock                  3.0.12             pyh9f0ad1d_0    conda-forge
flake8                    3.8.3                      py_1    conda-forge
flask                     1.1.2              pyh9f0ad1d_0    conda-forge
flask-compress            1.5.0              pyh9f0ad1d_0    conda-forge
folium                    0.11.0                   pypi_0    pypi
freetype                  2.10.2               hd328e21_0    conda-forge
fsspec                    0.8.0                      py_0    conda-forge
future                    0.18.2           py37hc8dfbb8_1    conda-forge
geneagrapher              1.0                      pypi_0    pypi
get_terminal_size         1.0.0                h38e98db_0
gevent                    20.6.2           py37h4ab8f01_0    conda-forge
giflib                    5.2.1                h2fa13f4_2    conda-forge
gitdb                     4.0.5                      py_0    conda-forge
gitpython                 3.1.7                      py_0    conda-forge
glob2                     0.7                        py_0    conda-forge
gmpy2                     2.1.0b1          py37h7db29ea_0    conda-forge
greenlet                  0.4.16           py37h4ab8f01_0    conda-forge
h5py                      2.10.0          nompi_py37hde23a51_104    conda-forge
hdf5                      1.10.6          nompi_he0bbb20_101    conda-forge
heapdict                  1.0.1                      py_0    conda-forge
html5lib                  1.1                pyh9f0ad1d_0    conda-forge
icc_rt                    2019.0.0             h0cc432a_1
icu                       64.2                 he025d50_1    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imagecodecs               2020.5.30        py37h92c78e3_2    conda-forge
imageio                   2.9.0                      py_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        1.7.0            py37hc8dfbb8_0    conda-forge
importlib_metadata        1.7.0                         0    conda-forge
iniconfig                 1.0.1              pyh9f0ad1d_0    conda-forge
intel-openmp              2019.4                      245
intervaltree              3.0.2                      py_0    conda-forge
ipykernel                 5.3.4            py37h5ca1d4c_0    conda-forge
ipyparallel               6.3.0            py37hc8dfbb8_0    conda-forge
ipython                   7.17.0           py37hc6149b9_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1                      py_0    conda-forge
isort                     4.3.21           py37hc8dfbb8_1    conda-forge
itsdangerous              1.1.0                      py_0    conda-forge
jdcal                     1.4.1                      py_0    conda-forge
jedi                      0.15.2                   py37_0    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
joblib                    0.16.0                     py_0    conda-forge
jpeg                      9d                   he774522_0    conda-forge
json5                     0.9.4              pyh9f0ad1d_0    conda-forge
jsonschema                3.2.0            py37hc8dfbb8_1    conda-forge
jupyter                   1.0.0                      py_2    conda-forge
jupyter_client            6.1.6                      py_0    conda-forge
jupyter_console           6.1.0                      py_1    conda-forge
jupyter_core              4.6.3            py37hc8dfbb8_1    conda-forge
jupyterlab                2.2.4                      py_0    conda-forge
jupyterlab-git            0.20.0                     py_1    conda-forge
jupyterlab_code_formatter 1.3.6                      py_0    conda-forge
jupyterlab_server         1.2.0                      py_0    conda-forge
jxrlib                    1.1                  hfa6e2cd_2    conda-forge
keyring                   21.3.0           py37hc8dfbb8_0    conda-forge
kiwisolver                1.2.0            py37heaa310e_0    conda-forge
krb5                      1.17.1               hc04afaa_2    conda-forge
lazy-object-proxy         1.5.1            py37h4ab8f01_0    conda-forge
lcms2                     2.11                 he1115b7_0    conda-forge
lerc                      2.2                  ha925a31_0    conda-forge
libaec                    1.0.4                he025d50_1    conda-forge
libarchive                3.3.3             h0c0e0cf_1008    conda-forge
libblas                   3.8.0                    14_mkl    conda-forge
libcblas                  3.8.0                    14_mkl    conda-forge
libclang                  9.0.1           default_hf44288c_0
libcurl                   7.71.1               h4b64cdc_4    conda-forge
libiconv                  1.15              hfa6e2cd_1006    conda-forge
liblapack                 3.8.0                    14_mkl    conda-forge
liblief                   0.10.1               ha925a31_0
libllvm9                  9.0.1                hde8ddfe_1    conda-forge
libpng                    1.6.37               ha81a0f5_2    conda-forge
libsodium                 1.0.17               h2fa13f4_0    conda-forge
libspatialindex           1.9.3                he025d50_3    conda-forge
libssh2                   1.9.0                hb06d900_5    conda-forge
libtiff                   4.1.0                h885aae3_6    conda-forge
libwebp-base              1.1.0                hfa6e2cd_3    conda-forge
libxml2                   2.9.10               h5d81f1c_2    conda-forge
libxslt                   1.1.33               h579f668_1    conda-forge
libzopfli                 1.0.3                ha925a31_0    conda-forge
llvmdev                   5.0.0                   cling_1  [cling vc14]  gouarin
llvmlite                  0.33.0           py37h8b575af_1    conda-forge
locket                    0.2.0                      py_2    conda-forge
lxml                      4.2.5                    pypi_0    pypi
lz4                       3.1.0            py37h2519948_0    conda-forge
lz4-c                     1.9.2                h62dcd97_1    conda-forge
lzo                       2.10              hfa6e2cd_1000    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.1.1            py37h8055547_1    conda-forge
matplotlib                3.3.1                         0    conda-forge
matplotlib-base           3.3.1            py37h35e8a6e_0    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
menuinst                  1.4.16           py37he774522_0
metakernel                0.24.4             pyh9f0ad1d_0    conda-forge
mistune                   0.8.4           py37h8055547_1001    conda-forge
mkl                       2019.4                      245
mkl-service               2.3.0            py37hfa6e2cd_0    conda-forge
mkl_fft                   1.1.0            py37hc8d92b1_1    conda-forge
mkl_random                1.1.0            py37he350917_0    conda-forge
mock                      4.0.2            py37hc8dfbb8_0    conda-forge
more-itertools            8.4.0                      py_0    conda-forge
mpc                       1.1.0             h7edee0f_1009    conda-forge
mpfr                      4.0.2                h62dcd97_1    conda-forge
mpir                      3.0.0             he025d50_1002    conda-forge
mpmath                    1.1.0                      py_0    conda-forge
msgpack-python            1.0.0            py37heaa310e_1    conda-forge
msys2-conda-epoch         20160418                      1
multipledispatch          0.6.0                      py_0    conda-forge
navigator-updater         0.2.1                    py37_0
nbconvert                 5.6.1            py37hc8dfbb8_1    conda-forge
nbdime                    2.0.0                      py_1    conda-forge
nbformat                  5.0.7                      py_0    conda-forge
networkx                  2.4                        py_1    conda-forge
nltk                      3.4.4                      py_0    conda-forge
nodejs                    14.8.0                        0    conda-forge
nose                      1.3.7           py37hc8dfbb8_1004    conda-forge
notebook                  6.1.3            py37hc8dfbb8_0    conda-forge
numba                     0.50.1           py37h3bbf574_1    conda-forge
numexpr                   2.7.1            py37h1834ac0_1    conda-forge
numpy                     1.19.1           py37hae9e721_0    conda-forge
numpy-base                1.18.5           py37hc3f5095_0
numpydoc                  1.1.0              pyh9f0ad1d_0    conda-forge
octave_kernel             0.31.0                     py_0    conda-forge
olefile                   0.46                       py_0    conda-forge
openjpeg                  2.3.1                h57dd2e7_3    conda-forge
openpyxl                  3.0.4                      py_0    conda-forge
openssl                   1.1.1g               he774522_1    conda-forge
packaging                 20.4               pyh9f0ad1d_0    conda-forge
pandas                    1.0.3            py37h3bbf574_1    conda-forge
pandoc                    2.10.1               he774522_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
paramiko                  2.7.1              pyh9f0ad1d_1    conda-forge
parso                     0.5.2                      py_0
partd                     1.1.0                      py_0    conda-forge
path                      15.0.0           py37hc8dfbb8_0    conda-forge
path.py                   12.5.0                        0    conda-forge
pathlib2                  2.3.5            py37hc8dfbb8_1    conda-forge
pathtools                 0.1.2                      py_1    conda-forge
patsy                     0.5.1                      py_0    conda-forge
pep8                      1.7.1                      py_0    conda-forge
pexpect                   4.8.0            py37hc8dfbb8_1    conda-forge
pickleshare               0.7.5           py37hc8dfbb8_1001    conda-forge
pillow                    7.2.0            py37hc826c6e_1    conda-forge
pip                       20.2.2                     py_0    conda-forge
pkginfo                   1.5.0.1                    py_0    conda-forge
plotly                    4.9.0              pyh9f0ad1d_0    conda-forge
plotly-orca               1.3.1                         1    plotly
pluggy                    0.13.1           py37hc8dfbb8_2    conda-forge
ply                       3.11                       py_1    conda-forge
portalocker               1.7.0            py37hc8dfbb8_0    conda-forge
powershell_shortcut       0.0.1                         2
prometheus_client         0.8.0              pyh9f0ad1d_0    conda-forge
prompt-toolkit            3.0.6                      py_0    conda-forge
prompt_toolkit            3.0.6                         0    conda-forge
psutil                    5.7.2            py37h4ab8f01_0    conda-forge
ptyprocess                0.6.0                    pypi_0    pypi
py                        1.9.0              pyh9f0ad1d_0    conda-forge
py-lief                   0.10.1           py37ha925a31_0
pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
pycosat                   0.6.3           py37h8055547_1004    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pycrypto                  2.6.1           py37h8055547_1004    conda-forge
pycurl                    7.43.0.5         py37h24bd3af_2    conda-forge
pydocstyle                5.0.2                      py_0    conda-forge
pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
pygments                  2.6.1                      py_0    conda-forge
pylint                    2.4.4                    py37_0    conda-forge
pymap3d                   2.4.1                      py_0    conda-forge
pynacl                    1.3.0           py37h2fa13f4_1001    conda-forge
pyodbc                    4.0.30           py37h6538335_0    conda-forge
pyopenssl                 19.1.0                     py_1    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py37h6538335_1    conda-forge
pyqt5-sip                 4.19.18                  pypi_0    pypi
pyqtwebengine             5.12.1                   pypi_0    pypi
pyreadline                2.1                   py37_1001    conda-forge
pyrsistent                0.16.0           py37h8055547_0    conda-forge
pysocks                   1.7.1            py37hc8dfbb8_1    conda-forge
pytables                  3.6.1            py37h2d87964_2    conda-forge
pytest                    6.0.1            py37hc8dfbb8_0    conda-forge
python                    3.7.4                h5263a28_0
python-dateutil           2.8.1                      py_0    conda-forge
python-jsonrpc-server     0.3.4              pyh9f0ad1d_1    conda-forge
python-language-server    0.31.9           py37hc8dfbb8_0    conda-forge
python-libarchive-c       2.9                      py37_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2020.1             pyh9f0ad1d_0    conda-forge
pywavelets                1.1.1            py37h44b1f71_1    conda-forge
pywin32                   227              py37hfa6e2cd_0    conda-forge
pywin32-ctypes            0.2.0           py37hc8dfbb8_1001    conda-forge
pywinpty                  0.5.7                    py37_0    conda-forge
pyyaml                    5.3.1            py37h8055547_0    conda-forge
pyzmq                     19.0.2           py37h453f00a_0    conda-forge
qdarkstyle                2.8.1              pyh9f0ad1d_1    conda-forge
qt                        5.12.5               h7ef1ec2_0    conda-forge
qtawesome                 0.7.2              pyh9f0ad1d_0    conda-forge
qtconsole                 4.7.5              pyh9f0ad1d_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
regex                     2020.7.14        py37h4ab8f01_0    conda-forge
requests                  2.24.0             pyh9f0ad1d_0    conda-forge
retrying                  1.3.3                      py_2    conda-forge
rope                      0.17.0             pyh9f0ad1d_0    conda-forge
rtree                     0.9.4            py37h804a536_1    conda-forge
ruamel_yaml               0.15.80         py37h8055547_1001    conda-forge
scikit-image              0.17.2           py37h3bbf574_1    conda-forge
scikit-learn              0.23.2           py37hdc70db3_0    conda-forge
scipy                     1.5.0            py37h9439919_0
seaborn                   0.10.1                        1    conda-forge
seaborn-base              0.10.1                     py_1    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                49.6.0           py37hc8dfbb8_0    conda-forge
simplegeneric             0.8.1                      py_1    conda-forge
singledispatch            3.4.0.3               py37_1000    conda-forge
sip                       4.19.24          py37h1834ac0_0    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
smmap                     3.0.4              pyh9f0ad1d_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
sortedcollections         1.2.1              pyh9f0ad1d_0    conda-forge
sortedcontainers          2.2.2              pyh9f0ad1d_0    conda-forge
soupsieve                 2.0.1            py37hc8dfbb8_0    conda-forge
sphinx                    3.2.1                      py_0    conda-forge
sphinxcontrib             1.0                      py37_1
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
sphinxcontrib-websupport  1.2.4              pyh9f0ad1d_0    conda-forge
spyder                    4.1.1            py37hc8dfbb8_1    conda-forge
spyder-kernels            1.9.3            py37hc8dfbb8_0    conda-forge
sqlalchemy                1.3.18           py37h4ab8f01_0    conda-forge
sqlite                    3.32.3               he774522_1    conda-forge
statsmodels               0.11.1           py37h4ab8f01_2    conda-forge
sympy                     1.6.2            py37hc8dfbb8_0    conda-forge
tbb                       2020.1               he980bc4_0    conda-forge
tblib                     1.6.0                      py_0    conda-forge
terminado                 0.8.3            py37hc8dfbb8_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
threadpoolctl             2.1.0              pyh5ca1d4c_0    conda-forge
tifffile                  2020.8.13                  py_0    conda-forge
tk                        8.6.10               he774522_0    conda-forge
toml                      0.10.1             pyh9f0ad1d_0    conda-forge
toolz                     0.10.0                     py_0    conda-forge
tornado                   6.0.4            py37hfa6e2cd_0    conda-forge
tqdm                      4.48.2             pyh9f0ad1d_0    conda-forge
traitlets                 4.3.3            py37hc8dfbb8_1    conda-forge
typed-ast                 1.4.1            py37hfa6e2cd_0    conda-forge
typing_extensions         3.7.4.2                    py_0    conda-forge
ujson                     1.35            py37h63f7a3c_1002    conda-forge
unicodecsv                0.14.1                     py_1    conda-forge
urllib3                   1.25.10                    py_0    conda-forge
vc                        14.1                 h869be7e_1    conda-forge
vs2015_runtime            14.16.27012          h30e32a0_2    conda-forge
watchdog                  0.10.3           py37hc8dfbb8_1    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_1    conda-forge
webencodings              0.5.1                      py_1    conda-forge
werkzeug                  1.0.1              pyh9f0ad1d_0    conda-forge
wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
widgetsnbextension        3.5.1            py37hc8dfbb8_1    conda-forge
win_inet_pton             1.1.0                    py37_0    conda-forge
win_unicode_console       0.5                   py37_1000    conda-forge
wincertstore              0.2                   py37_1003    conda-forge
winpty                    0.4.3                         4    conda-forge
wrapt                     1.12.1           py37h8055547_1    conda-forge
xarray                    0.16.0                     py_0    conda-forge
xeus                      0.8.0                    vc14_0  [vc14]  gouarin
xeus-cling                0.0.5                    vc14_0  [vc14]  gouarin
xlrd                      1.2.0              pyh9f0ad1d_1    conda-forge
xlsxwriter                1.3.3              pyh9f0ad1d_0    conda-forge
xlwings                   0.20.3           py37hc8dfbb8_0    conda-forge
xlwt                      1.3.0                      py_1    conda-forge
xmltodict                 0.12.0                     py_0    conda-forge
xtl                       0.3.8                         0  [vc14]  gouarin
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                he774522_0    conda-forge
yapf                      0.30.0             pyh9f0ad1d_0    conda-forge
zeromq                    4.3.2                ha925a31_3    conda-forge
zfp                       0.5.5                ha925a31_1    conda-forge
zict                      2.0.0                      py_0    conda-forge
zipp                      3.1.0                      py_0    conda-forge
zlib                      1.2.11            h62dcd97_1007    conda-forge
zope                      1.0                      py37_1
zope.event                4.4                pyh9f0ad1d_0    conda-forge
zope.interface            5.1.0            py37h8055547_0    conda-forge
zstd                      1.4.5                h1f3a1b7_2    conda-forge

@Gdsimms
Copy link
Author

Gdsimms commented Aug 16, 2020

From this: https://plotly.com/python/renderers/ it looks like I might need a jupyterlab extension for plotly, but even after installing that extension and rebuilding jupyterlab it exhibits the same behavior.

I'm just not sure why the exact same plot that I generate in the dtale charts window doesn't get produced.

@aschonfeld
Copy link
Collaborator

@Gdsimms i’m really sorry about that. The import you’re looking for is:

import plotly.graph_objects as go

Then you’ll use go.Layout

Just curious, which version of D-Tale are you running? I may have fixed this in the latest version 1.13.0, and if I havent i’ll have a new version out with the fix later this week.

Once again, my apologies

@aschonfeld
Copy link
Collaborator

aschonfeld commented Aug 16, 2020

Sorry, just read the rest of your posts and noticed you solved that part. Sorry it looks like there is some more code i need to include in order to display these charts in a notebook:

from plotly.offline import iplot, init_notebook_mode

init_notebook_mode(connected=True)
chart.pop(‘id’, None) # for aome reason iplot does not like ‘id’
iplot(chart)

“chart” being the chart created by the code

@Gdsimms
Copy link
Author

Gdsimms commented Aug 16, 2020

Sorry, just read the rest of your posts and noticed you solved that part. Sorry it looks like there is some more code i need to include in order to display these charts in a notebook:

from plotly.offline import iplot, init_notebook_mode

init_notebook_mode(connected=True)
chart.pop(‘id’, None) # for aome reason iplot does not like ‘id’
iplot(chart)

“chart” being the chart created by the code

Thank you for the prompt reply. I'm on a different machine tonight and I may not be able to test the suggested fix until Monday.

@aschonfeld
Copy link
Collaborator

Good news, I think I've fixed all the issues with map code export (and hopefully all chart code exports for that matter):
map_code_export

Some of the things I had to update:

  • my plotly import was wrong, it should be: import plotly.graph_objs as go
  • I was accidentally spliting column names into their individual letters on the groupby aggregation
  • missing a parenthesis on the dropna
  • not surrounding queries in double-quotes

Hope to have these changes out by the end of the week, but hopefully sooner :)

aschonfeld added a commit that referenced this issue Aug 18, 2020
* #243: column menu descriptions
* #247: code export compilation error fixes
* #242: type conversion column menu option & auto-column names on "Build Column"
* #235: nan formatting
aschonfeld added a commit that referenced this issue Aug 19, 2020
* #243: column menu descriptions
* #247: code export compilation error fixes
* #242: type conversion column menu option & auto-column names on "Build Column"
* #235: nan formatting
aschonfeld added a commit that referenced this issue Aug 20, 2020
* #243: column menu descriptions
* #247: code export compilation error fixes
* #242: type conversion column menu option & auto-column names on "Build Column"
* #235: nan formatting
aschonfeld added a commit that referenced this issue Aug 20, 2020
* #243: column menu descriptions
* #247: code export compilation error fixes
* #242: type conversion column menu option & auto-column names on "Build Column"
* #235: nan formatting
@aschonfeld
Copy link
Collaborator

Added in v1.14.0, @Gdsimms let me know how it goes 🤞

@Gdsimms
Copy link
Author

Gdsimms commented Aug 21, 2020

There are no error messages, but it still doesn't work. Maybe I'm missing a step here.

  1. Be in Jupyterlab, running a python notebook
  2. Have a pandas dataframe called myDF, containing lat, lon, & value columns
  3. dtale.show(myDF)
  4. Use the awesome power of dtale charts/maps/mapbox to create a beautiful color-coded plot of points over a street map.
  5. Click the "Code Export" link
  6. Dialog pops up full of python code, with a "copy" button in the lower right
  7. click copy button
  8. switch browser tabs back to Jupyterlab
  9. paste code
  10. at the top of the code block, type "df = myDF"
  11. execute code block
  12. no visible output
  13. add "figure.show()" as a bottom line
  14. execute code block and "figure.show()"
  15. a large blank area is displayed
    image

@Gdsimms
Copy link
Author

Gdsimms commented Aug 21, 2020

I notice your screenshot is jupyterHub. I've never used that. I'm in JupyterLab 2.2.5. Are there particular widgets or extensions I might need? The plots display fine in the dtale browser tabs that pop up.

@aschonfeld
Copy link
Collaborator

aschonfeld commented Aug 21, 2020

@Gdsimms I'm sorry you're still having issues, but not to worry we'll figure this out! 👍. So I'm wondering if you adding those couple lines I mentioned earlier in our thread (but neglected to add to my code export because it didn't appear I needed it when I ran my code):

from plotly.offline import iplot, init_notebook_mode

init_notebook_mode(connected=True)
figure.pop(‘id’, None) # for some reason iplot does not like ‘id’
iplot(chart)

I've added a file containing the current list of packages I have installed in my virtual environment I'm using w/ JupyterHub
py380_dependencies.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants