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

Issues with traits; virtualenv, pip, ubuntu 14.04 #62

Open
KennethNielsen opened this issue Nov 12, 2014 · 0 comments
Open

Issues with traits; virtualenv, pip, ubuntu 14.04 #62

KennethNielsen opened this issue Nov 12, 2014 · 0 comments

Comments

@KennethNielsen
Copy link

Hi

I'm having some problems installing pyparty on ubuntu 14.04 with virtual env and pip.

The main problem is that the current pyparty package in pypi has a requirement of a specific version (4.3.0) of traits, that is no longer installable from pypi. I tried to simply install the available version instead (4.5.0) but then I run into another problem. Enthought has changed their import paths so instead of:

from enthought.traits.api import ...
# it is now
from traits.api import ...

which means that the imports in:
tools/manager.py
trait_types/intornone.py
fails.

From here I went down two different paths. I tried to fix the imports in those two files and I installed the enthought etsproxy module, which is meant to translate the imports.

Both solutions mean that the basic test import:

from pyparty import *

works BUT if the run the basictest ipython notebook some things fail. More specifically in the block

ax1, ax2 = splot(1,2)

c.reset_background()
c.rez = (700,700)
c.background='orange'
c.show(ax1, title="Resolution set first")

c.reset_background()
c.background='orange'
c.rez = (700,700)
c.show(ax2, title="BG reset first");

the two c.background='orange' lines fails with this traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-16-f30c5eb0ea46> in <module>()
      3 c.reset_background()
      4 c.rez = (700,700)
----> 5 c.background='orange'
      6 c.show(ax1, title="Resolution set first")
      7 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/pyparty/tools/canvas.pyc in _set_background(self, bg)
    903     def _set_background(self, bg):
    904         """ Set background and use new resolution if there is one """
--> 905         self.set_bg(bg, keepres=False, inplace=True)
    906 
    907     # REDO THIS WITH COLOR NORM AND STUFF!  Also, dtype warning?

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/pyparty/tools/canvas.pyc in set_bg(self, bg, keepres, inplace)
    838 
    839         oldres = cout.rez
--> 840         cout._update_bg(bg)
    841 
    842         if keepres:

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/pyparty/tools/canvas.pyc in _update_bg(self, background)
    924         # colorstring or hex
    925         elif isinstance(background, basestring):
--> 926             self._background = bgu.from_string(background, self.rx, self.ry)
    927             self._bgstyle = 'file/colorstring/url'
    928 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/pyparty/background/bg_utils.pyc in from_string(path_or_color, resx, resy)
     37     # Separte method because plan to expand later
     38     try:
---> 39         return imread(op.expanduser( path_or_color) ) #expand user ok for URL
     40     except IOError:
     41         if not resx:

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/skimage/io/_io.pyc in imread(fname, as_grey, plugin, flatten, **plugin_args)
     95 
     96     with file_or_url_context(fname) as fname:
---> 97         img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
     98 
     99     if as_grey and getattr(img, 'ndim', 0) >= 3:

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/skimage/io/manage_plugins.pyc in call_plugin(kind, *args, **kwargs)
    207                                (plugin, kind))
    208 
--> 209     return func(*args, **kwargs)
    210 
    211 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/matplotlib/pyplot.pyc in imread(*args, **kwargs)
   2213 @docstring.copy_dedent(_imread)
   2214 def imread(*args, **kwargs):
-> 2215     return _imread(*args, **kwargs)
   2216 
   2217 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/matplotlib/image.pyc in imread(fname, format)
   1256             raise ValueError('Only know how to handle extensions: %s; '
   1257                              'with PIL installed matplotlib can handle '
-> 1258                              'more images' % list(six.iterkeys(handlers.keys)))
   1259         return im
   1260 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/six.pyc in iterkeys(d, **kw)
    557 else:
    558     def iterkeys(d, **kw):
--> 559         return iter(d.iterkeys(**kw))
    560 
    561     def itervalues(d, **kw):

AttributeError: 'builtin_function_or_method' object has no attribute 'iterkeys'

and later in the block:

from pyparty.data import lena_who
c.background = lena_who()
c.show()
print 'newshape = ', c.shape

the call to the lena_who() functions fails with this traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-35-0d50285db227> in <module>()
      1 from pyparty.data import lena_who
----> 2 c.background = lena_who()
      3 c.show()
      4 print 'newshape = ', c.shape

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/pyparty/data/__init__.pyc in lena_who(*args, **kwargs)
     52 def lena_who(*args, **kwargs):
     53     """ Yound lady, released with her full permission """
---> 54     return load("lena_who.jpg", *args, **kwargs)
     55 
     56 def nanogold(*args, **kwargs):

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/pyparty/data/__init__.pyc in load(f, rez)
     36         Image loaded from skimage.data_dir.
     37     """
---> 38     img = imread(op.join(data_dir, f))
     39     if rez:
     40         rx, ry = rez

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/skimage/io/_io.pyc in imread(fname, as_grey, plugin, flatten, **plugin_args)
     95 
     96     with file_or_url_context(fname) as fname:
---> 97         img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
     98 
     99     if as_grey and getattr(img, 'ndim', 0) >= 3:

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/skimage/io/manage_plugins.pyc in call_plugin(kind, *args, **kwargs)
    207                                (plugin, kind))
    208 
--> 209     return func(*args, **kwargs)
    210 
    211 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/matplotlib/pyplot.pyc in imread(*args, **kwargs)
   2213 @docstring.copy_dedent(_imread)
   2214 def imread(*args, **kwargs):
-> 2215     return _imread(*args, **kwargs)
   2216 
   2217 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/matplotlib/image.pyc in imread(fname, format)
   1256             raise ValueError('Only know how to handle extensions: %s; '
   1257                              'with PIL installed matplotlib can handle '
-> 1258                              'more images' % list(six.iterkeys(handlers.keys)))
   1259         return im
   1260 

/home/kenni/tmp/ve/base/local/lib/python2.7/site-packages/six.pyc in iterkeys(d, **kw)
    557 else:
    558     def iterkeys(d, **kw):
--> 559         return iter(d.iterkeys(**kw))
    560 
    561     def itervalues(d, **kw):

AttributeError: 'builtin_function_or_method' object has no attribute 'iterkeys'

Does anyone has any hints at how to fix this or how to install pyparty with pip in a virtualenv?

Regards Kenneth

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

1 participant