How to pip install pickle under Python 3.9 in Windows?
Asked Answered
C

4

12

I need the pickle package installed under my Python 3.9 under Windows 10.

What I tried

When trying with pip install pickle I was getting:

ERROR: Could not find a version that satisfies the requirement pickle (from versions: none) ERROR: No matching distribution found for pickle

Then I tried the solution suggested in this question using pip install pickle5 but got the following error:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

I then tried to install the Tool suggested by the error but got same error message after trying again pip install pickle5.

Question

Which is the correct way to install pickle package under Python 3.9 in Windows 10?

UPDATE

There is no need to install pickle module as it comes already installed along with Python 3.x. Just needed to do import pickle and voila!

Colorful answered 29/7, 2021 at 20:21 Comment(2)
pickle is part of the standard library, so there is no need to pip install it. See also: #48478449Feathered
@Feathered I tried the solution stated in that question but failed. It's even under a different Python version. I would not say this is a duplicate. Even the solution I suggest is different and the error message I get when pip install pickle5 is not mentioned in that question.Colorful
T
26

Cedric UPDATED answer is right. Pickle exists within Python 3.9. You don't need pip install pickle. Just use it.

import pickle
Ten answered 19/8, 2021 at 18:3 Comment(1)
Great answer! thanksIrretrievable
C
2

I found a way that I'm not sure it's the optimal but it works.

I did pip install pickle4

And then in the script just

import pickle4 as pickle

UPDATE

There is no need to install pickle as it's already within Python 3.9. Just needed to import pickle and voila!

Colorful answered 29/7, 2021 at 20:21 Comment(0)
I
1

For Generalized Summary, for almost all Python versions, you never need to worry for installing 'pickle' as it comes already installed with the python interpreter.
Hence, simple import works:

import pickle

In case this doesn't work, refer to Pickle Install Problems on Stack Overflow.
Another suggested way is to run: pip install pickle-mixin

For other Queries and Info, refer to Python Pickle Documentation.

Ilianailine answered 24/10, 2021 at 5:2 Comment(0)
S
-1

pip install pickle5

is the best possible way for installing pickle.

Sociopath answered 27/8, 2023 at 15:42 Comment(1)
The "best possible way"? Why not use the built-in module?Gratify

© 2022 - 2024 — McMap. All rights reserved.