Open yoavram opened 7 years ago
Thanks, should be easy to fix with try/except import pickle, PR welcome!
So you imagine something like:
try:
import cPickle
except ImportError:
import pickle as cPickle
Actually, looking at the code it seems like this fix is already implemented... Are you using the latest version?
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'
>>>
Could you try with the development version?
pip install git+https://github.com/rossant/ipycache --upgrade
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'>
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.
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
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
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?
I'm no longer maintaining this repository but could give github/pypi permissions to anyone who would volunteer to maintain it
@rossant Thanks for the response, are you not maintaining it because better tools are available or because you are too busy?
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!
@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.
@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.
ImportError: No module named 'cPickle'
On Python 3.5