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

DLL load failed while importing lets_plot_kotlin_bridge #118

Closed
zwyber opened this issue Apr 17, 2020 · 6 comments
Closed

DLL load failed while importing lets_plot_kotlin_bridge #118

zwyber opened this issue Apr 17, 2020 · 6 comments
Assignees

Comments

@zwyber
Copy link

zwyber commented Apr 17, 2020

I greatly appreciate the effort to make a nice ggplot-like plotting library for Python! However, when installing and importing I got an ImportError:
ImportError: DLL load failed while importing lets_plot_kotlin_bridge: The specified module could not be found.

Environment:

  • Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
  • Created empty venv with python -m venv venv and activated it
  • ran pip with pip install jupyterlab ipython numpy pandas lets_plot (installs lets_plot 1.3.0)
  • start IPython terminal and from lets_plot import * (as suggested)

Results in an import error, full error is in the attached with the issue

@zwyber
Copy link
Author

zwyber commented Apr 17, 2020

ImportError                               Traceback (most recent call last)
<ipython-input-1-29fbef30cdcb> in <module>
----> 1 from lets_plot import *

[PATH_TO_VENV]venv\lib\site-packages\lets_plot\__init__.py in <module>
     11 from .plot import *
     12 from ._global_settings import LetsPlotSettings
---> 13 from .frontend_context import *
     14 
     15 __all__ = (plot.__all__ +

[PATH_TO_VENV]venv\lib\site-packages\lets_plot\frontend_context\__init__.py in <module>
      4 #
      5 
----> 6 from ._configuration import *
      7 
      8 __all__ = _configuration.__all__

[PATH_TO_VENV]venv\lib\site-packages\lets_plot\frontend_context\_configuration.py in <module>
      6 
      7 from ._frontend_ctx import FrontendContext
----> 8 from ._html_contexts import _create_html_frontend_context, _use_isolated_frame
      9 from .._global_settings import get_global_bool
     10 from ..plot.core import PlotSpec

[PATH_TO_VENV]venv\lib\site-packages\lets_plot\frontend_context\_html_contexts.py in <module>
      5 
      6 from ._frontend_ctx import FrontendContext
----> 7 from ._jupyter_notebook_ctx import JupyterNotebookContext
      8 from ._static_html_page_ctx import StaticHtmlPageContext
      9 from .._global_settings import has_global_value, get_global_bool, HTML_ISOLATED_FRAME

[PATH_TO_VENV]venv\lib\site-packages\lets_plot\frontend_context\_jupyter_notebook_ctx.py in <module>
     13 
     14 from ._frontend_ctx import FrontendContext
---> 15 from .. import _kbridge as kbr
     16 from .._global_settings import get_global_str, has_global_value, is_production
     17 from .._version import __version__

[PATH_TO_VENV]venv\lib\site-packages\lets_plot\_kbridge.py in <module>
      5 from typing import Dict
      6 
----> 7 import lets_plot_kotlin_bridge
      8 
      9 from ._type_utils import standardize_dict

ImportError: DLL load failed while importing lets_plot_kotlin_bridge: The specified module could not be found.```

@VDovidaytis-HORIS
Copy link
Collaborator

Thank you for reporting this issue!

I suppose that you don't have any MinGW support on your Windows machine.

Could you try these steps, please:

  • install Anaconda3 (Miniconda3)
  • create Python 3.8 env by running conda create -n <env_name> python=3.8
  • activate it: conda activate <env_name>
  • install MinGW toolchain to Conda: conda install m2w64-toolchain
  • install other libs, that you need and lets-plot.

Then try to import and use lets-plot.

@VDovidaytis-HORIS
Copy link
Collaborator

VDovidaytis-HORIS commented Apr 24, 2020

Added installation procedure to the README_PYTHON.md file for Windows users:

#120

@VDovidaytis-HORIS
Copy link
Collaborator

@zwyber have you tried the steps I mentioned above? Did it help in your problem?

@zwyber
Copy link
Author

zwyber commented Apr 24, 2020

Hi @VDovidaytis-HORIS , apologies for the late response! It was a busy week, I only had some time now to tinker with Python.

Indeed I had no MinGW on my laptop. I can confirm the steps you mentioned fixes the problem! The setup instructions are clear.

Remains a bit odd why the package can install with a missing MinGW toolchain without throwing an error during install. If possible, it would be nice to have the package fail to install without MinGW. Otherwise the current instructions are sufficiently clear!

Thank you for for the solution!

PS: Since I am familiar with R and the ggplot2 package, I tried ggsave() out of habit. I noticed it was not implemented in lets-plot, instead using the export module. If you want to make the transition from R even smoother, you may want to consider adding a ggsave() wrapper :)

@alshan
Copy link
Collaborator

alshan commented Apr 24, 2020

@zwyber thanx for the feedback, I've created an issue regarding ggsave wrapper: #122

Although we can only support device="svg" at this time.

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

3 participants