How to update SSL certificates on Windows? - python

I'm having a problem with python package requests-html. When the package is trying to download chromium, I'm getting an error:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate
(_ssl.c:1056)
It's the same problem as here and it has been resolved for Mac. Any idea how can I fix this on Windows? In case it matters, installing packages with PIP works fine. Windows 8, Python 3.7.

Have you tried using verify=False in your request args?
This should make the request ignore SSL Cerificate requirements.

Related

Pip install from archive

I am trying to install Dtale in jupyter notebook. Due to the firewall restrictions, I cannot install it online. I tried to download the archive file dtale-2.2.0.tar.gz and ran this command inside the jupyter notes.
pip install <path>/dtale-2.2.0.tar.gz
This fails as it could not find pypandoc. Then I downloaded the pypandoc-1.7.5.tar.gz and ran
pip install <path>/pypandoc-1.7.5.tar.gz.
But this time I get the error:
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/d2/04/08841501db81bceb7a86a98dea7c12b0185fcc69bfdf1aea266f727d1d7e/poetry_core-1.0.8-py2.py3-none-any.whl (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
I know the host is unreachable due to the firewall, that is the reason why I downloaded the package. Can someone guide me through how to install the packages from the .gz archive file?
Thanks
this error tells you that there is a pkg in dependencies that can NOT be downloaded.
its name is poetry-core, so you should download and install it manually.
here is a url for it: https://files.pythonhosted.org/packages/d2/04/08841501db81bceb7a86a98dea7c12b0185fcc69bfdf1aea266f727d1d7e/poetry_core-1.0.8-py2.py3-none-any.whl
in case you can't download it too due to your firewall, you can use VPN.
in case you can't do that either, then you can download it from this url:
https://www.mediafire.com/file/kpnfupmf5px84um/poetry_core-1.0.8-py2.py3-none-any.whl/file
I have downloaded and re-uploaded it

Getting SSL error with Python on one virtual machine profile but not another

So basically I have a windows virtual machine that is running Anaconda, which has Python 3.8 installed. Both profiles share this installation on the VM, in the conda environment I have installed certifi which makes it work perfectly for User 1, but when I run the same conda environment for User 2 I get the following error:
(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))
Any ideas as to why one user running the same script in the same environment wouldn't have the same result? I can provide more if necessary. Just not sure what I could give.

Problems to install pyautogui

I am having problems to install pyautogui. I have installed Python, Pip and Anaconda in my notebook, but when I try to install pyautogui using the code within cmd: pip install pyautogui I have the return bellow:
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pyautogui/
Could not fetch URL https://pypi.org/simple/pyautogui/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pyautogui/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) - skipping
ERROR: Could not find a version that satisfies the requirement pyautogui (from versions: none)
ERROR: No matching distribution found for pyautogui
Someone could help me, please?
It really depends on your setup, but here are a few things that might help:
Generally, when you're installing a package, you go to the command prompt and type something like python -m pip install pyautogui; python is written here to tell the command prompt you're using the python language, -m tells it to look for a module (in this case pip) rather than some script file name, and pip install pyautogui means you're trying to install a module called pyautogui
Pip looks in a few specific places for modules. If it doesn't find them there, it lets you know they were not found. If the module you're trying to install can't be found, generally you'll want to hunt down an actual file for it and install it with that file. However, I know it can find pyautogui, because I just installed it yesterday!
If you're using a Jupyter Notebook within Anaconda, which it sounds like you are, you may not actually want to use your computer's command prompt. Your computer may be finding a different version of Python than your Anaconda installation. So, if you want to be able to use pyautogui in Anaconda, you'll want to follow these steps:
Open Anaconda Navigator
Launch the CMD.exe prompt in the Navigator, which is set up to deal with the Anaconda installation
Type pip install pyautogui in this window and hit enter
I'm not sure about this, but i had the same problem while creating a discord bot with discord.py , what i ended doing was downloading an SSL certificate from a website( search on google there are a bunch of them) then opening the download and it automatically sets it up. And that fixed the problem for me.
Try this command
pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org pyautogui

SSL Certificate Failure

Running Spyder under the Anaconda package 3.8 with python 3.6. Ever since April I have been receiving an error trying to install packages using pip with the error:
Could not fetch URL https://pypi.python.org/simple/scrapy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443)
Does anyone have any way I can rectify this issue. This doesn't happen at my home PC. Thanks

python setup.py fails on osx with ssl error

I am trying to upload a new python project from my mac to PyPI via:
python setup.py sdist upload -r pypi
When I try to upload a package, I get the following error on OSX:
Submitting dist/PyTreasuryDirect-0.1.0.tar.gz to https://pypi.python.org/pypi
error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
This question is slightly related to these two questions, ssl with pip and when importing the ssl library. However I need setup.py to work in my case, how can I get past this ssl error?
I also get the same error on Python 2.7.9 and Python 3.5 using OSX 10.10.2 (14C109)
The solution for OS X 10.10 is to use its default Python version 2.7.6.
This problem is related to the fact that starting from Python version 2.7.9 certificate validation for stdlib http clients is enabled by default (PEP 476). This issue is described in Python bug tracker.

Categories