How to pip install pickle under Python 3.9 in Windows? - python

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!

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

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!

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.

Related

Pip installed a module I want to use, but still getting "module not found" error

I am trying to use the Python module Gdal. I have run pip install gdal and I recieve the message
Requirement already satisfied: gdal in c:\users\willy\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (3.3.1)
and yet when I run import gdal in my Python IDE (I use Spyder), I still get the error no module named gdal
You need to tell Spyder which Python interpreter to use. Point it to the one you're installing the package for, as it seems that it's using a different one.
https://docs.spyder-ide.org/current/faq.html#using-existing-environment
From the documentation it seems you have to call:
from osgeo import gdal
See here
Answer is here in Spyder docs: https://docs.spyder-ide.org/5/faq.html#using-packages-installer
Don't try to use pip install and expect it to work in Spyder. Follow these instructions

Having issue importing requests and I assume it's my python runtime not being set correctly

Probably stupidly I tried to install the latest version of Python, in this case using the download from python site, but after doing that I was then getting python still running on the previous version python-3.6. I'm on OSX and was using sublime.
So I have been trying to work out how to update it to use the newest version. I've followed; https://opensource.com/article/19/5/python-3-default-mac.
All of the responses to queries now point to the python-3.9.5 version. So that's great and my runtime is using that. However after installing the requests using pip install I get the following error when running.
import requests
ModuleNotFoundError: No module named 'requests'''
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
I stumbled upon Modules are installed using pip on OSX but not found when importing which I have been trying to work through.
I have been able to run the import command successfully in terminal, however it's intermittent as I've tried again and it's broken, so I'm lost. I'm running it something trying to run the python3.6 version, which after updating I followed these instructions to remove when I have uninstalled that from my mac https://www.macupdate.com/app/mac/5880/python/uninstall.
If there is any ideas, would love some help, mainly to try and tell me what that error message is telling me.
In particular, what does this mean?
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.6/
I should clarify too; when I run 'pip list'
I see
requests 2.25.1
Assuming that you are not installing requests package properly, and assuming your python executable is named python:
python -m pip install requests
If however, your python executable is named something else instead, e.g. python3, replace python with that name:
python3 -m pip install requests

Failed to install scitools-iris using pip: ImportError No module named target_pkg (in pyke)

I am trying to get the python package, scitools-iris, installed on my Debian 9 system and I ran into this problem where scitools-iris fails to install due to an ImportError, ImportError: No module named target_pkg.
I am using python 2.7 and all packages are installed using pip only. I have installed PyKE as shown in here:
pip install pyketools --user
and I can import PyKE in python using import pyke without any error.
Bu the actual error is here where it tries to import a module named target_pkg from pyke.target_pkg. I tried the import statement in python,
from pyke.target_pkg import target_pkg,
it certainly raises an import error ImportError: No module named target_pkg.
How do I get around this problem and install iris in my system?
Have I installed the wrong package for PyKE?
Found out what I have been doing wrong. I actually had the wrong package installed for PyKE using pip. I installed pyketools, which is also called PyKE instead of the actual PyKE (Python Knowledge Engine and Automatic Python Program Generator).
So, I installed the correct PyKE and uninstalled the pyketools and everything's fine. Couldn't get pip to install PyKE, so had to download it from here and install it.

I want to check the grammatical mistakes of user data by using NLTK (python)?

I have download language-check package and pasted in D:\Lib\site-packages\nltk but when I type the code over python interpreter as:
import language_check
It gives me an error: no module named language_check.
You need to properly install the package first, for example using
pip install language_check
here are a couple of links to help you:
https://docs.python.org/3/installing/
How do I install Python packages on Windows?

Unable to use pymssql in Python 3.5

I have installed pymssql using pip however It is never found when I try to import into a project.
I get the error, No module found 'pymssql'
I have attempted to copy the .pyd file (pymssql-2.1.2-cp35-cp35m-win_amd64.pyd) to the project directory and this is still a problem
So. just using...
import pymssql
...results in the module not being found, If I try to reinstall through pip it states it is installed and requirement is already satisfied.
How can i get this useable
I am using Python 3.5 and Windows 10
Python is installed in Appdata/Local/Programs/Python35
Modules are installed Appdata/Roaming/Python35/site-packages/
Installing the .whl file manually from the Pymssql website resolved the issue and allowed me to use the module in my project!

Categories