Cpickle module... not in Lib installs

Tim Jarman tmj at SPAMLESSjarmania.com
Fri Mar 25 20:20:18 EST 2005


Marcus Lowland wrote:

> Thanks Marc, but... I've searched the file directories for cpickle (not
> specifying file type) and only came up with test_cpickle.py. Also, if
> cPickle.so were the correct file and existed in my lib then the
> following would not happen.
> 
>>>> import cpickle
> 
> Traceback (most recent call last):
>   File "<pyshell#0>", line 1, in -toplevel-
>     import cpickle
> ImportError: No module named cpickle
>>>>

Au contraire, the spelling *is* important:

Python 2.4 (#1, Dec 31 2004, 17:21:43)
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cpickle
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named cpickle
>>> import cPickle
>>> cPickle
<module 'cPickle' from '/usr/local/lib/python2.4/lib-dynload/cPickle.so'>
>>>

Python is case-sensitive, and this extends to imports (modulo the
idiosyncrasies of the underlying OS).

-- 
Website: www DOT jarmania FULLSTOP com



More information about the Python-list mailing list