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

cPickle import error #46

Open
yoavram opened this issue Dec 6, 2016 · 15 comments
Open

cPickle import error #46

yoavram opened this issue Dec 6, 2016 · 15 comments
Milestone

Comments

@yoavram
Copy link
Contributor

yoavram commented Dec 6, 2016

ImportError: No module named 'cPickle'

On Python 3.5

@rossant
Copy link
Owner

rossant commented Dec 6, 2016

Thanks, should be easy to fix with try/except import pickle, PR welcome!

@yoavram
Copy link
Contributor Author

yoavram commented Dec 7, 2016

So you imagine something like:

try:
  import cPickle
except ImportError:
  import pickle as cPickle

@rossant
Copy link
Owner

rossant commented Dec 7, 2016

Actually, looking at the code it seems like this fix is already implemented... Are you using the latest version?

@yoavram
Copy link
Contributor Author

yoavram commented Dec 7, 2016

I did an pip install ipycache:

(X)  ~  pip install ipycache
Collecting ipycache
Installing collected packages: ipycache
Successfully installed ipycache-0.1.4
(X)  ~  python
Python 3.5.2 | packaged by conda-forge | (default, Jul 26 2016, 01:37:38)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipycache
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xxx/miniconda3/envs/X/lib/python3.5/site-packages/ipycache.py", line 11, in <module>
    import inspect, os, sys, textwrap, cPickle
ImportError: No module named 'cPickle'
>>>

@rossant
Copy link
Owner

rossant commented Dec 7, 2016

Could you try with the development version?

pip install git+https://github.com/rossant/ipycache --upgrade

@yoavram
Copy link
Contributor Author

yoavram commented Dec 7, 2016

Works:

(X)  ~  python
Python 3.5.2 | packaged by conda-forge | (default, Jul 26 2016, 01:37:38)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipycache
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xxx/miniconda3/envs/X/lib/python3.5/site-packages/ipycache.py", line 11, in <module>
    import inspect, os, sys, textwrap, cPickle
ImportError: No module named 'cPickle'
>>>
(X)  ~  pip install git+https://github.com/rossant/ipycache --upgrade
Collecting git+https://github.com/rossant/ipycache
  Cloning https://github.com/rossant/ipycache to /private/var/folders/rm/dnbfymg93tb4lbb2h8x83ld40000gp/T/pip-f5uwttqj-build
Installing collected packages: ipycache
  Found existing installation: ipycache 0.1.4
    Uninstalling ipycache-0.1.4:
      Successfully uninstalled ipycache-0.1.4
  Running setup.py install for ipycache ... done
Successfully installed ipycache-0.1.5.dev0
(X)  ~  python
Python 3.5.2 | packaged by conda-forge | (default, Jul 26 2016, 01:37:38)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipycache
/Users/xxx/miniconda3/envs/X/lib/python3.5/site-packages/IPython/config.py:13: ShimWarning: The `IPython.config` package has been deprecated. You should import from traitlets.config instead.
  "You should import from traitlets.config instead.", ShimWarning)
/Users/xxx/miniconda3/envs/X/lib/python3.5/site-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
  warn("IPython.utils.traitlets has moved to a top-level traitlets package.")
>>> ipycache
<module 'ipycache' from '/Users/xxx/miniconda3/envs/X/lib/python3.5/site-packages/ipycache.py'>

@matanox
Copy link

matanox commented Nov 8, 2018

using the dev version (the second install option) i get a versioning oriented warning:

lib/python3.6/site-packages/IPython/config.py:13: ShimWarning:

The `IPython.config` package has been deprecated since IPython 4.0. You should import from traitlets.config instead.

lib/python3.6/site-packages/ipycache.py:17: UserWarning:

IPython.utils.traitlets has moved to a top-level traitlets package.

@diallobakary4
Copy link

The dev version is also giving me a warning:

/home/bdiallo/.conda/envs/bakbio/lib/python3.6/site-packages/IPython/config.py:13:

ShimWarning: The IPython.config package has been deprecated since IPython 4.0. You should import from traitlets.config instead.
"You should import from traitlets.config instead.", ShimWarning)
/home/bdiallo/.conda/envs/bakbio/lib/python3.6/site-packages/ipycache.py:17: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
from IPython.utils.traitlets import `Unicode

@oborisov
Copy link

oborisov commented Jan 2, 2020

Having the same "ImportError: No module named 'cPickle'" after both "conda install -c conda-forge ipycache" and "pip install ipycache".
"pip install git+https://github.com/rossant/ipycache --upgrade" working seamlessly,
thanks

@chris-rands
Copy link

This is a simple python 3 vs. python 2 issue, is has been fixed in this repo, would someone (@rossant ?) be able to tag a new release here on github and update on pypi?

@rossant
Copy link
Owner

rossant commented Feb 4, 2020

I'm no longer maintaining this repository but could give github/pypi permissions to anyone who would volunteer to maintain it

@chris-rands
Copy link

@rossant Thanks for the response, are you not maintaining it because better tools are available or because you are too busy?

@rossant
Copy link
Owner

rossant commented Feb 4, 2020

Too busy and I no longer use it, and I wouldn't be surprised if there were better tools, but I can't really tell!

@eldad-a eldad-a mentioned this issue May 4, 2020
@eldad-a
Copy link

eldad-a commented May 4, 2020

@diallobakary4 wrote:

The dev version is also giving me a warning:

/home/bdiallo/.conda/envs/bakbio/lib/python3.6/site-packages/IPython/config.py:13:
ShimWarning: The IPython.config package has been deprecated since IPython 4.0. You should import from traitlets.config instead.
"You should import from traitlets.config instead.", ShimWarning)
/home/bdiallo/.conda/envs/bakbio/lib/python3.6/site-packages/ipycache.py:17: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.
from IPython.utils.traitlets import `Unicode

In case this is still of help, please see 48#issuecomment-623323002 for a way to circumvent these warnings.

@mbrukman
Copy link
Collaborator

@rossant — can you give me PyPI permissions, please? I'd like to make another ipycache release to fix this issue.

My PyPI username is the same as my GitHub username.

@mbrukman mbrukman added this to the Release 0.1.5 milestone Jan 18, 2022
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

8 participants