Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (16.4k points)
edited by

With Python 3.5 docker image, I couldn't able to install cPickle.

Dockerfile

FROM python:3.5-onbuild

requirements.txt

cpickle

When I tried to construct the image

$ docker build -t sample .

Sending build context to Docker daemon 3.072 kB

Step 1 : FROM python:3.5-onbuild

# Executing 3 build triggers...

Step 1 : COPY requirements.txt /usr/src/app/

Step 1 : RUN pip install --no-cache-dir -r requirements.txt

 ---> Running in 016c35a032ee

Collecting cpickle (from -r requirements.txt (line 1))

  Could not find a version that satisfies the requirement cpickle (from -r requirements.txt (line 1)) (from versions: )

No matching distribution found for cpickle (from -r requirements.txt (line 1))

You are using pip version 7.1.2, however version 8.1.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1

1 Answer

0 votes
by (26.4k points)

In python 2.x, cPickle comes with std library. But, In case of Python 3.x, You need to do this if you want cPickle:

>>> import _pickle as cPickle

But, In python 3.x, it is easier just to use pickle. It is a bug if anything need cPickle in python 3.x

Want to learn more about python? Come and join: python course

Related questions

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
asked Mar 1, 2021 in Python by Rekha (2.2k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...