This might be silly but I am unable to install cPickle
with python 3.5 docker image
Dockerfile
JavaScript
x
2
1
FROM python:3.5-onbuild
2
requirements.txt
JavaScript
1
2
1
cpickle
2
When I try to build the image
JavaScript
1
14
14
1
$ docker build -t sample .
2
Sending build context to Docker daemon 3.072 kB
3
Step 1 : FROM python:3.5-onbuild
4
# Executing 3 build triggers...
5
Step 1 : COPY requirements.txt /usr/src/app/
6
Step 1 : RUN pip install --no-cache-dir -r requirements.txt
7
---> Running in 016c35a032ee
8
Collecting cpickle (from -r requirements.txt (line 1))
9
Could not find a version that satisfies the requirement cpickle (from -r requirements.txt (line 1)) (from versions: )
10
No matching distribution found for cpickle (from -r requirements.txt (line 1))
11
You are using pip version 7.1.2, however version 8.1.1 is available.
12
You should consider upgrading via the 'pip install --upgrade pip' command.
13
The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
14
Advertisement
Answer
cPickle
comes with the standard library… in python 2.x. You are on python 3.x, so if you want cPickle
, you can do this:
JavaScript
1
2
1
>>> import _pickle as cPickle
2
However, in 3.x, it’s easier just to use pickle
.
No need to install anything. If something requires cPickle
in python 3.x, then that’s probably a bug.