Ludwig: ImportError: Python is not installed as a framework.

Created on 18 Feb 2019  路  4Comments  路  Source: ludwig-ai/ludwig

Hey people,
I麓ve followed your instructions for installing ludwig manually.
Unfortunately when I try to run the binary i get an error message telling me that python isn麓t installed as a framework.
Here is the stack trace I get...

Traceback (most recent call last):
  File "/Users/tweak/Documents/code/ludwig/venv/bin/ludwig", line 11, in <module>
    load_entry_point('ludwig==0.1.0', 'console_scripts', 'ludwig')()
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/ludwig-0.1.0-py3.6.egg/ludwig/__init__.py", line 17, in <module>
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/ludwig-0.1.0-py3.6.egg/ludwig/cli.py", line 24, in <module>
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/ludwig-0.1.0-py3.6.egg/ludwig/visualize.py", line 32, in <module>
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/ludwig-0.1.0-py3.6.egg/ludwig/utils/visualization_utils.py", line 28, in <module>
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/matplotlib/pyplot.py", line 2374, in <module>
    switch_backend(rcParams["backend"])
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/matplotlib/pyplot.py", line 207, in switch_backend
    backend_mod = importlib.import_module(backend_name)
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/tweak/Documents/code/ludwig/venv/lib/python3.6/site-packages/matplotlib/backends/backend_macosx.py", line 14, in <module>
    from matplotlib.backends import _macosx
ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

I麓m on macOS Mojave 10.14 running Python 3.6.5.
Maybe you know a fix for this?

Meanwhile I麓ve just pip-installed ludwig in another venv which works like a charm.

waiting for answer

Most helpful comment

try :
conda install matplotlib

All 4 comments

try :
conda install matplotlib

will try, thanks!
But I already pip-install all requirements. so matplotlib is already installed at version 3.0.2

Hi @tony-dorfmeister , this issue should not exist in matplotlib >= 3.0. Anyway, I also pushed a fix that should solve it also for older versions of matplotlib. Can you please try again using the latest version of Ludwig on master?

Works like a charm. Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rfernand2 picture rfernand2  路  4Comments

bharatsewani1993 picture bharatsewani1993  路  4Comments

gogasca picture gogasca  路  3Comments

donfour10 picture donfour10  路  3Comments

w4nderlust picture w4nderlust  路  4Comments