Python3 ERROR With pyowm import OWM produces RequestsDependencyWarning: - python-requests

I recently upgraded to python3.7.3 from python2.7.16 and when I run my weather script I get a RequestsDependencyWarning ERROR. I narrowed it down to from pyowm import OWM
>>> from pyowm import OWM
/home/pi/.local/lib/python3.7/site-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.2) or chardet (2.0.3) doesn't match a supported version!
RequestsDependencyWarning)
>>>
I have tried the following:
~ $ pip uninstall docker-compose
WARNING: Skipping docker-compose as it is not installed.
~ $ pip install chardet
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: chardet in /usr/lib/python3/dist-packages (3.0.4)
~ $ pip install requests
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests in ./.local/lib/python3.7/site-packages (2.25.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests) (1.26.2)
Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3/dist-packages (from requests) (2.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests) (2018.8.24)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3/dist-packages (from requests) (3.0.4)
pip install urllib3
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: urllib3 in /usr/local/lib/python3.7/dist-packages (1.26.2)
I get the same error when I try from requests import get
>>> from requests import get
/home/pi/.local/lib/python3.7/site-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.2) or chardet (2.0.3) doesn't match a supported version!
RequestsDependencyWarning)
>>>
Any other ideas are welcome.

I upgraded chardet:
pip install --upgrade chardet
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: chardet in /usr/lib/python3/dist-packages (3.0.4)
Collecting chardet
Downloading https://www.piwheels.org/simple/chardet/chardet-4.0.0-py2.py3-none-any.whl (178 kB)
|................................| 178 kB 409 kB/s
Installing collected packages: chardet
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
elastalert 0.2.4 requires PyYAML>=3.12, which is not installed.
elastalert 0.2.4 requires texttable>=0.8.8, which is not installed.
noaa-sdk 0.1.18 requires requests==2.22.0, but you have requests 2.25.1 which is incompatible.
aiohttp 3.6.2 requires chardet<4.0,>=2.0, but you have chardet 4.0.0 which is incompatible.
Successfully installed chardet-4.0.0
I then noticed PyYAML and texttable were missing. After installing those two items I then upgraded chardet:
pip install --upgrade chardet
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: chardet in ./.local/lib/python3.7/site-packages (4.0.0)
Seeing that chardet requirements were met I retried my script and it works fine

Related

Robotframework: SessionNotCreatedException: Message: Error: NS_BINDING_ABORTED

I am getting the below error when trying to execute the robotframework test scripts.
Parent suite setup failed:
SessionNotCreatedException: Message: Error: NS_BINDING_ABORTED
Stacktrace:
#checkLoadingState#chrome://remote/content/shared/Navigate.jsm:209:28
onStateChange#chrome://remote/content/shared/Navigate.jsm:254:28
Tests.Suites.Layer2.Dhl.Dhl Session | FAIL |
Suite setup failed:
SessionNotCreatedException: Message: Error: NS_BINDING_ABORTED
Stacktrace:
#checkLoadingState#chrome://remote/content/shared/Navigate.jsm:209:28
onStateChange#chrome://remote/content/shared/Navigate.jsm:254:28
Below are the list of files installed:
I installed python 3.10.5
C:\aoswebtest>pip list
Package Version
async-generator 1.10
attrs 21.4.0
bcrypt 3.2.2
certifi 2022.5.18.1
cffi 1.15.0
cryptography 36.0.1
et-xmlfile 1.1.0
h11 0.13.0
idna 3.3
openpyxl 3.0.9
outcome 1.1.0
paramiko 2.11.0
pip 22.0.4
pycparser 2.21
pydevd 2.7.0
PyNaCl 1.5.0
pyOpenSSL 22.0.0
PyYAML 6.0
robotframework 4.1.3
robotframework-pythonlibcore 3.0.0
robotframework-seleniumlibrary 6.0.0
robotframework-sshlibrary 3.8.0
scapy 2.4.5
scp 0.14.4
selenium 4.1.0
setuptools 58.1.0
six 1.16.0
sniffio 1.2.0
sortedcontainers 2.4.0
trio 0.20.0
trio-websocket 0.9.2
urllib3 1.26.9
webcolors 1.11.1
wsproto 1.1.0
xlrd 2.0.1
Can you anyone help my with this?
I have the same error. I used my pc and run selenium with firefox then it works fine. But when I copy code and run other pc, it shows error NS_BINDING_ABORTED.
I fix it by: downgrade firefox version(from 103.x.x -> 92.x.x)

how to manually install the pre-build python package into conda environment

Need to install Azure cosmos-db python sdk via conda. But I can only install up to version 3.1.2 and 4.2.0 is needed in the project. I wonder how can I manually load the prebuild cosmo sdk in to the conda environment?
I have a env.yml file shown as follow, the enviroment is created via conda env create -f <path_to_env.yml>
name: cco_1410
channels:
- conda-forge
dependencies:
- azure-cosmos=4.2.0 (this would lead to fail)
- python=3
- fastapi=0.65.0
- pytest
install 4.2.0 version via conda is not possible. Conda is only able to install up to 3.1.2 version
conda search azure-cosmos
returns
/opt/miniconda3/lib/python3.9/site-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.2) or chardet (4.0.0) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Loading channels: done
# Name Version Build Channel
azure-cosmos 3.0.2 py_0 conda-forge
azure-cosmos 3.1.0 py_0 conda-forge
azure-cosmos 3.1.1 py_0 conda-forge
azure-cosmos 3.1.2 py_0 conda-forge
azure-cosmos 3.1.2 py_0 pkgs/main
In lieu of someone fixing the Conda Forge feedstock so that the newer versions are available on Conda, it is a PyPI package, so one can also install it through Pip:
name: cco_1410
channels:
- conda-forge
dependencies:
- python=3
- fastapi=0.65.0
- pytest
- pip
- pip:
- azure-cosmos==4.2.0
Please read the Conda documentation on installing non-Conda packages.
Microsoft releases Azure SDK packages for conda every three months in Microsoft channel (https://anaconda.org/microsoft).
azure-cosmos 4.2.0 was included in Sep. release.
You can find it from https://anaconda.org/microsoft/azure-cosmos.
(I work in MS in the SDK team)

Some problems with installing JupyterLab

Installed JupiterLab, but ran into a problem in the terminal.
> Terminals not available (error was No module named 'winpty.cywinpty')
Tried the following commands:
First
pip install pywinpty
Requirement already satisfied: pywinpty in c:\python38\lib\site-packages (0.5.7)
Second (version)
Python --version 3.8.3
jupyter-lab --version
2.1.5
ipython --version
7.16.1
Third
import winpty
conda install pywinpty
and others don't get rid of startup errors
On Windows it can be solved by installing pywinpty from the wheel provided here: https://www.lfd.uci.edu/~gohlke/pythonlibs/ .
Just download (the wheel) and install it via:
pip install -I the_wheel_name_you_have_downloaded

RequestLibrary module not found

I need to use the RequestsLibrary library and when I import it:
*** Settings ***
Library SeleniumLibrary
Library RequestsLibrary
I get an error module not found. When I run pipenv graph I can clearly see it's installed:
(marek) bash-3.2$ pipenv graph
robotframework-requests==0.5.0
- requests [required: Any, installed: 2.22.0]
- certifi [required: >=2017.4.17, installed: 2019.6.16]
- chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]
- idna [required: >=2.5,<2.9, installed: 2.8]
- urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.3]
- robotframework [required: Any, installed: 3.1.2]
What am I doing wrong ?
As turned out the issue was the fact that I installed the library using pipenv install xyz and that creates brand new virtual environment prior to library installation. So I basically ended up with a virtual environment within virtual environment and Robot couldn't access it. As soon as I got rid off the extra virtual environment, exited out and ran pipenv install robotframework-requests outside of any venv, it ran.

Symfony 3 composer, ext-dom and ext-xml missing [duplicate]

This question already has answers here:
PHPUnit working in IDE, but server says class not found
(2 answers)
Closed 5 years ago.
I am running Linux Mint 18.1. My IDE is PhpStorm and I am trying to install PHPUnit trough the composer. I followed the installation steps at https://getcomposer.org/download/.
Problem 1
- Installation request for phpunit/phpunit 6.4.x-dev -> satisfiable by phpunit/phpunit[6.4.x-dev].
- phpunit/phpunit 6.4.x-dev requires ext-dom * -> the requested PHP extension dom is missing from your system.
Problem 2
- symfony/symfony v3.3.6 requires ext-xml * -> the requested PHP extension xml is missing from your system.
- symfony/symfony v3.3.6 requires ext-xml * -> the requested PHP extension xml is missing from your system.
- symfony/symfony v3.3.6 requires ext-xml * -> the requested PHP extension xml is missing from your system.
- Installation request for symfony/symfony (locked at v3.3.6, required as 3.3.*) -> satisfiable by symfony/symfony[v3.3.6].
Solutions I have tried:
Install php-xml
Install php7.0-xml
This answer says to check if "extension=dom.so" is enabled in any of your php.ini files. It is not even present in my files
Any suggestions? Thanks a lot!
All you need to install from your terminal in Debian is:
sudo apt-get install php-xml
Or, if you're using PHP 7:
sudo apt-get install php7.0-xml

Resources