enthought / enstaller

Default Repo description from terraform module
Other
0 stars 0 forks source link

`cPickle.UnpicklingError` after 4.8.5 update #13

Closed pberkes closed 9 years ago

pberkes commented 9 years ago

Here's what happened: 1) I ran enpkg and it asked to update. I did.

↳ enpkg -s engeo
Fetching indices: .

Enstaller is out of date.  Update? ([y]/n) y
enstaller-4.8.5-1.egg                                                                                         [removing egg]
   5.14 MB [...............................................................................................................]        
enstaller-4.8.5-1.egg                                                                                       [installing egg]
   5.15 MB [...............................................................................................................]        
Enstaller has been updated.
Please re-run your previous command.

2) Re-running the command gives the error:

↳ enpkg -s engeo
enstaller: Error: enstaller crashed (uncaught exception <class 'cPickle.UnpicklingError'>: UnpicklingError("invalid load key, 'Y'.",)).
Please report this on enstaller issue tracker:
    http://github.com/enthought/enstaller/issues
You can get a full traceback by setting the ENSTALLER_DEBUG environment variable

3) The full traceback is:

↳ ENSTALLER_DEBUG=1 enpkg -s engeo
Traceback (most recent call last):
  File "/Users/pberkes/Library/Enthought/Canopy_64bit/User/bin/enpkg", line 10, in <module>
    sys.exit(main_noexc())
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/main.py", line 873, in main_noexc
    main(argv)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/main.py", line 744, in main
    repository = repository_factory(index_fetcher, config, args.quiet)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/main.py", line 497, in repository_factory
    resp = fetcher.fetch(url)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/fetch.py", line 93, in fetch
    proxies=self._proxies, verify=self.verify)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/requests/sessions.py", line 468, in get
    return self.request('GET', url, **kwargs)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/requests/sessions.py", line 585, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/requests/sessions.py", line 179, in resolve_redirects
    allow_redirects=False,
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/cachecontrol/adapter.py", line 31, in send
    cached_response = self.controller.cached_request(request)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/vendor/cachecontrol/controller.py", line 92, in cached_request
    resp = self.serializer.loads(request, self.cache.get(cache_url))
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/requests_utils.py", line 145, in get
    return self._decode_value(encoded_value)
  File "/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/requests_utils.py", line 135, in _decode_value
    return loads(str(encoded_value))
cPickle.UnpicklingError: invalid load key, 'Y'.
cournape commented 9 years ago

I don't know why, but the enpkg you are using is not the updated one (and is instead from canopy application....).

Can you paste the content of /Users/pberkes/Library/Enthought/Canopy_64bit/User/bin/enpkg ?

pberkes commented 9 years ago
pberkes@pietros_macbook:~/egit/meta-geophysics/geolibs (master)
↳ which enpkg
/Users/pberkes/Library/Enthought/Canopy_64bit/User/bin/enpkg

pberkes@pietros_macbook:~/egit/meta-geophysics/geolibs (master)
↳ cat /Users/pberkes/Library/Enthought/Canopy_64bit/User/bin/enpkg
#!/Users/pberkes/Library/Enthought/Canopy_64bit/User/bin/python
# This script was created by egginst when installing:
#
#   enstaller-4.8.5-1.egg
#
if __name__ == '__main__':
    import sys
    from enstaller.main import main_noexc

    sys.exit(main_noexc())
cournape commented 9 years ago

hm, from your user env python, can you do the following:

$ python
import sys
print(sys.path)
import enstaller
print(enstaller.__file__)
pberkes commented 9 years ago
↳ python
Enthought Canopy Python 2.7.6 | 64-bit | (default, Sep 15 2014, 17:43:19) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Users/pberkes/egit/meta-geophysics/geocanopy', '/Users/pberkes/egit/pyrasite', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/urwid-1.1.1-py2.7-macosx-10.6-x86_64.egg', '/Users/pberkes/egit/meta-geophysics/meta-ETS/etsdevtools', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PyGithub-1.21.0-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/grits_client-0.1-py2.7.egg', '/Users/pberkes/egit/vbench', '/Users/pberkes/egit/refcycle', '/Users/pberkes/egit/meta-geophysics/geolib', '/Users/pberkes/egit/meta-ETS/enable', '/Users/pberkes/egit/meta-ETS/chaco', '/Users/pberkes/egit/meta-geophysics/canopy_data', '/Users/pberkes/egit/meta-ETS/codetools', '/Users/pberkes/egit/scikit-image', '/Users/pberkes/egit/SlideTools', '/Users/pberkes/egit/simphony-mayavi/simphony-common', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/stevedore-1.2.0-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/enum34-1.0.4-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/argparse-1.3.0-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pbr-0.10.8-py2.7.egg', '/Users/pberkes/egit/simphony-mayavi', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/click-4.0-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/appdirs-1.4.0-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/tabulate-0.7.5-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/clint-0.4.1-py2.7.egg', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/args-0.1.0-py2.7.egg', '/Users/pberkes/egit/meta-geophysics/meta-ETS/traits', '/Users/pberkes/egit/canopy_dashboard/dependencies/jigna', '/Users/pberkes/egit/canopy_dashboard', '/Users/pberkes/o/keras', '/Users/pberkes/egit/envisage', '/Users/pberkes/egit/meta-geophysics/meta-ETS/traitsui', '/Users/pberkes/egit/canopy_platform', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages', '/Users/pberkes', '/Users/pberkes/o/gp', '/Users/pberkes/o/pyschool/pelita', '/Users/pberkes/o/tools', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python27.zip', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/plat-darwin', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/plat-mac', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/plat-mac/lib-scriptpackages', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/lib-tk', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/lib-old', '/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/lib-dynload', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages', '/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PIL']
>>> import enstaller
>>> enstaller.__file__
'/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/enstaller/__init__.pyc'
cournape commented 9 years ago

So that's the problem. For some reasons, you have the canopy app ('/Applications/Canopy.app/appdata/canopy-1.5.1.2730.macosx-x86_64/Canopy.app/Contents/lib/python2.7`) in your sys.path before user environment.

This is an issue with your environment. There are also a lots of eggs/develop entries in your sys.path, I advise you to clean those, as it increases the likelihood of such issues.

pberkes commented 9 years ago

ok... but who is adding that?

dpinte commented 9 years ago

@pberkes Can you ping Robin about that? It would be good to understand how we can have the appdata path before the user path.

cournape commented 9 years ago

For the .egg entries, I would look into setuptools (e.g. the easy_install.pth files in your PYTHONPATH).

For the directories entries, look into your PYTHONPATH.