Skip to content

3D figures cannot be created in 1.4.2: 'module' object has no attribute '_string_to_bool' #4064

@chzhang

Description

@chzhang

I was trying to run some of the examples provided by http://matplotlib.org/examples/mplot3d/2dcollections3d_demo.html

The occur some error as follows:

Traceback (most recent call last):
File "some.py", line 34, in
ax = p3.Axes3D(fig)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/mpl_toolkits/mplot3d/axes3d.py", line 91, in init
_args, *_kwargs)
File "/Library/Python/2.7/site-packages/matplotlib/axes/_base.py", line 436, in init
self.cla()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/mpl_toolkits/mplot3d/axes3d.py", line 1045, in cla
Axes.cla(self)
File "/Library/Python/2.7/site-packages/matplotlib/axes/_base.py", line 897, in cla
self.grid(self._gridOn, which=rcParams['axes.grid.which'])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/mpl_toolkits/mplot3d/axes3d.py", line 1256, in grid
self._draw_grid = maxes._string_to_bool(b)
AttributeError: 'module' object has no attribute '_string_to_bool'

OS : OS X Yosemit 10.10.2
Python version: 2.7.6
matplotlib : 1.4.2

Install matplotlib use by 'pip'

I solved the problem by used
http://stackoverflow.com/questions/25383698/error-string-to-bool-in-mplot3d-workaround-found iamaziz's answer:

  1. rename (or delete) the folder mplot3d (so matplotlib thinks it's not there):
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/mpl_toolkits/mplot3d-old 2) update matplotlib with specifiying mplot3d: pip install --upgrade 'matplotlib[mplot3d]'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions