How to install plistlib in python3 virtualenv? - python-3.x

I've created a Python 3 virtual environment, and I am trying to install the plistlib package.
However, I am getting the following error:
(venv) venv$pip install --upgrade plistlib
Collecting plistlib
Could not find a version that satisfies the requirement plistlib (from versions: )
No matching distribution found for plistlib

The plistlib module is within the standard libraries. You don't need to install it, it will be available for import in your existing Python 3 installation.

Related

Python3: No module named dateutil

I am unable to get dateutil installed in my Python code.
from dateutil import tz
ImportError: No module named dateutil
I had date-util installed (Python version is 3.7.3)
> pip3 install python-dateutil
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: python-dateutil in /usr/lib/python3/dist-packages (2.7.3)
I cannot uninstall them (to reinstall). I get the following error
> sudo pip3 uninstall python-dateutil
Not uninstalling python-dateutil at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'python-dateutil'. No files were found to uninstall.
Then, I used the following command to uninstall:
> sudo apt-get remove python3-dateutil #This worked
> pip3 install python-dateutil
This works, but asks me to install cycler, kiwisolver, pyparsing, which I install using pip3. But I still cant get the python code working - has the same error (ImportError: No module named dateutil)
Any suggestions on what's going on?
I found a solution - The python code is being called from a bash script. It worked fine until recently. Recently I installed some other packages that installed python 2.x. So, the python scripts were using Python 2.x rather than 3.x. I had symbolic links to python 3.x, but that didn't help.
Now, I am explicitly use python3 mycode.py to overcome this issue.
I highly recommend to use conda environment instead of pip. See, there are several modules which do not give expected behaviour in pip (like pytorch).
Get the package installed using:
conda install -c conda-forge python-dateutil
returning the question, to get the package running it requires fulfillment of it's dependencies. If you are using python 3.7.3 its obvious that it may lack in some of the features of modern python 3.11 as a result you get the obvious error. The python package python-dateutil must have been configured according to the modern python language version.
Iam using python 3.11.1 and the package gets installed very perfectly. You may install old version of package or upgrade your python language version or use Conda as mentioned before.

Competing Python versions

On my Mac, I have 2 versions of Python running, one from Brew (3.9) and another one (3.8)
When I try to install some data science packages via pip3, they are installed but cannot be used as 3.9 takes over.
python3 --version
Python 3.9.10
which python3
/opt/homebrew/bin/python3
pip3 install pandas
Requirement already satisfied: pandas in /Library/Python/3.8/site-packages
python3
import pandas
ModuleNotFoundError: No module named 'pandas'
pandas is just one example of the many packages I see via pip3 freeze.
What are my options to point to installed versions at Python 3.8 ?
There are different ways to approach this:
One temporary option is to use alias like this:
alias python3=python3.8
You can use directly python3.8 in your terminal.
If you want to install the packages to python3.9 then you can also use pip3.9
You could use:
python3 -m pip install module
which will use pip to install to the python version you just used.
The recommended way is to use:
python3 -m pip install module

No matching distribution found for intel-numpy

I'm trying to install Intel's numpy version through pip on Windows as described on their website.
> python -m pip install intel-numpy
Collecting intel-numpy
Could not find a version that satisfies the requirement intel-numpy (from versions: )
No matching distribution found for intel-numpy
I have 64-bit Python on Windows 10 and the main numpy package isn't installed. What am I doing wrong?
The problem was my version of Python: intel-numpy is currently packaged for Python 3.6 and not 3.7. Installing Python 3.6 fixed it.

not able to install a python package

I am trying to install a module in python but it is throwing me below error. I dont understand. I am also not able to find wheel file for this module.
Anyone else imported this module ?
Module Name :generatengrams
pip install generatengrams
from generatengrams import ngrammatch
Getting below error:
Could not find a version that satisfies the requirement generatengrams (from versions: )
No matching distribution found for generatengrams
pip install ngram
Check Python ngram. PyPI

Python PIP unsatisifed requirement cookielib3pp

I'd like to install cookielib for Python 3.5. However, I'm getting an unclear error message:
Tom#osx:~/mycode$ pip3 search cookielib
cookielib3 -
Tom#osx:~/mycode$ pip3 install cookielib3
Collecting cookielib3
Could not find a version that satisfies the requirement cookielib3 (from versions: )
No matching distribution found for cookielib3
What is going on here?
If you searched on PyPi, you probably saw: https://pypi.python.org/pypi/cookielib3/0.0.0
It's a dummy package. In Python 3 there's no cookielib or cookielib3. According to Python 3.2 - cookielib you should use http.cookiejar instead.

Resources