econchick / new-coder

New Coder tutorials
zlib License
597 stars 394 forks source link

import error in dataviz tutorial #198

Open Anmol-Singh-Jaggi opened 8 years ago

Anmol-Singh-Jaggi commented 8 years ago

I setup my system exactly as described in the tutorial website. But, I still got an import error while running the dataviz code:

>> python graph.py

RuntimeError: module compiled against API version a but this version of numpy is 9
Traceback (most recent call last):
  File "graph.py", line 14, in <module>
    import matplotlib.pyplot as plt
  File "/home/anmol/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 27, in <module>
    import matplotlib.colorbar
  File "/home/anmol/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 32, in <module>
    import matplotlib.artist as martist
  File "/home/anmol/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/artist.py", line 12, in <module>
    from .transforms import Bbox, IdentityTransform, TransformedBbox, \
  File "/home/anmol/Envs/DataVizProj/local/lib/python2.7/site-packages/matplotlib/transforms.py", line 39, in <module>
    from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: numpy.core.multiarray failed to import

List of packages installed in the virtualenv:

>> pip freeze

funcsigs==0.4
geojson==1.0.6
matplotlib==1.4.2
mock==1.3.0
nose==1.3.7
numpy==1.9.1
pbr==1.8.1
pyparsing==2.0.7
python-dateutil==2.4.2
pytz==2015.7
six==1.10.0

Here is a screenshot showing the error.

This was solved by executing pip install -U numpy as suggested by this link.

My system specifications: