[Matplotlib-devel] venv, pip and Matplotlib development code

Jorge Scandaliaris jscandaliaris at gmail.com
Tue Aug 4 23:39:36 CEST 2015


Thomas Caswell <tcaswell at ...> writes:

> 
> 
> I can't tell from the trace back if you have activated or not.  I also 
> would not clone the repo into the venv.
> If the source for mpl is in `~/source/matplotlib` :
> 
> pyvenv --system-site-packages /tmp/test
> source /tmp/test/bin/activate 
> cd ~/source/matplotlib
> python setup.py develop
> 
> Should install matplotlib into the 'test' venv (which lives in RAM on 
> most modern linux machines).
> 
> Tom
@Jouni K. Seppänen: I used the --system-site-packages option, thus I believe
it's fine 

@Thomas Caswell: thanks for your patience! I was doing it wrong it seems. I
just followed your recipe. Now matplotlib installs OK, but I get the same
error with trendvis!

Details:
  - I just moved the whole ~/.local folder somewhere else. Now I am 100%
sure nothing installed with --user can mess my tests.
  - No system matplotlib is installed, but its dependencies are system
(distro) packages.
  - I cleaned both mpl and trendvis repos with `git clean -fxd`
  - I follow your recipe to create the virtualenv and install matplotlib.
This succeeds.
  - I also do `python setup.py develop` in trendvis repo. This also succeeds.
  - Run the three examples from trendvis README.rst. The first suceeds,
although the resultant image differs slightly with the image at trendvis'
github page. The two more complex examples yield an error. Trace pasted below:

$ python two_row_ygrid_with_frame.py 
Traceback (most recent call last):
  File "two_row_ygrid_with_frame.py", line 41, in <module>
    ex1.draw_frame()
  File "/home/jscandal/sw/trendvis/trendvis/trendvis/gridclass.py", line
666, in draw_frame
    ur_corner = self._convert_coords(ur_axis, (urdx, urdy))
  File "/home/jscandal/sw/trendvis/trendvis/trendvis/gridclass.py", line
921, in _convert_coords
    ax_coords = axis.transData.transform(coordinates)
  File
"/home/jscandal/sw/matplotlib/matplotlib.py3/lib/matplotlib/transforms.py",
line 1303, in transform
    values = np.asanyarray(values)
  File "/usr/lib/python3.4/site-packages/numpy/core/numeric.py", line 514,
in asanyarray
    return array(a, dtype, copy=False, order=order, subok=True)
ValueError: Expected 2-dimensional array, got 1

I also tried to remove the system-installed numpy and install it in the
virtualenv (maybe the problem is related to arch's numpy?), but that didn't
suceed. I tried to do `pip install numpy` and I got an error. I also tried
building manually, but didn't manage. The three examples run fine if I use
the system version of matplotlib (1.4.3)

Regards,

Jorge


More information about the Matplotlib-devel mailing list