SSL error while pip3 install - python

I am new to coding. While i try to install python-forecastio using pip3 for python3,it gives me below error.
$ sudo pip3 install --trusted-host pypi.python.org python-forecastio
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting python-forecastio
Could not fetch URL https://pypi.python.org/simple/python-forecastio/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement python-forecastio (from versions: )
No matching distribution found for python-forecastio

What is wrong is, as you may have guessed, the SSL module is not available.
So the simple way to fix the problem is to reinstall python. But the alternative is to run this simple line of code: import ssl. If you get an error you will know your python 3 installation is corrupt so you need to reinstall python, or if you don't get an error try using easy_install-3.x (what ever the module or link you want)(Use the specific python you have installed version in place of "x"). Hope I helped!
-Zeus

Related

LDAP installation for Python without Pip and .org's

i want to use LDAP with python and dont have the opportunity to use pip with pypi.python.org, pypi.org and files.pythonhosted.org. (cant get through Proxy, wont change)
so i need to download the package and install it.
as i understand there are .whl and zipped packages.
i tried bonsai but got the error C1083 because of the missing file basetsd.h
i tried python_ldap but it called for pyasn1, so i tried to install pyasn1 but it gave me a 407 Proxy Authorization Required -- Some packages may not be found Line with Error "Could not find suitable distribution for Requirement.parse('pyasn1<0.5.0,>=0.4.6')
There where no red or yellow errors so i tried python_ldap again, but with the same error like on the first attempt.
how do i setup a LDAP for Python if i cant reach pypi.python.org, pypi.org and files.pythonhosted.org ?
Greetings
Chorum
Python: 3.10.1
Pip: 21.2.4

install numpy and pandas on 1and1 shared hosting python

I've installed python 2.7.14 on my 1and1 shared hosting server using the following tutorial: http://geeksta.net/geeklog/python-shared-hosting/
it works and has a bunch of the modules that I use. However, i'd like to have numpy and pandas on this installation as well.
I'm having all sorts of issues, but the most basic one is when typing:
pip install numpy
which leads to the following error:
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
So it looks like maybe it's failing because I don't have SSL installed, but all the suggestions for installing SSL seems to require sudo (which I can't access root on a shared host).
A second question is that I'm wondering about is if I need to use a virtualenv or not. I'm new to this but it seems like it will allow me to install things, but again I tried to install virtualenv (as stated in the tutorial):
pip install virtualenvwrapper
but I get the same sort of SSL error:
Could not fetch URL https://pypi.python.org/simple/virtualenvwrapper/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement virtualenvwrapper (from versions: )
No matching distribution found for virtualenvwrapper
any help that can direct me in the right direction to get these modules installed would be greatly appreciated. Thanks.
Updated to ask additional approach Given the issue seems to be not being able to download a python package on a https site (b/c SSL isn't available), is it possible for me to download the package manually using my webbrowser then FTPing the file into my server filesystem and then using SSH commands to install the modules? If so, any tips would be much appreciated.
Okay, I finally figured it out. Basically, downloading each package manually from their various websites and ftp-ing them to the shared host and then unzipping and installing them manually is what worked for me. This avoids having to connect to an SSL site to download the file on the shared host.
for numpy:
I downloaded the source file (numpy-1.14.2.zip) for numpy from here: https://pypi.org/project/numpy/#files
FTP that to the python folder in my shared host.
unzipped it
unzip numpy-1.14.2.zip
then ran setup.py from inside the numpy-1.14.2 folder
python setup.py install
Then I repeated this for pandas and it's dependencies:
setuptools
NumPy: 1.9.0 or higher
python-dateutil: 1.5 or higher
pytz: Needed for time zone support

Pip SSL error on Mac

I keep getting this SSL error when using pip on my mac. I have done a fresh install of the OS and it hasn't made any different. Turning the firewall off also doesn't make any difference. Anyone got any ideas?
Here's the error:
> Seans-Mac-mini:~ seanhatch$ pip3 install discord.py
Collecting discord.py
Could not fetch URL https://pypi.python.org/simple/discord-py/: There was a problem confirming the ssl certificate: EOF occurred in violation of protocol (_ssl.c:719) - skipping
Could not find a version that satisfies the requirement discord.py (from versions: )
No matching distribution found for discord.py
Discord.py was used as an example but it doesn't work for any packages.

Unable to install mysql-connector-python in pycharm

Following is the error produced when I try to install "mysql-connector-python" in pycharm. Any help would be great.
Non-zero exit code(1)
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\karan.gupta\AppData\Local\Programs\Python\Python36-32\python.exe'.
Collecting mysql-connector-python
Could not fetch URL https://pypi.python.org/simple/mysql-connector-python/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) - skipping
Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
Run pip install mysql-connector from your Terminal, as the error handler suggests. Or try to run the same command from wherever you've already tried, but without the -python at the end.
Click here!
Use MySQLdb instead, i used it and it's working fine. Method is in the blog.
Hope it will help you
I believe this version of the connector works only with python 2.7, if you try installing it with python 2.7 version, maybe it will work.

Using pip and easy_install in virtualenv on Windows

I was trying to install a few packages in a virtual environment using pip. I was getting the error:
Downloading/unpacking pymongo
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pymongo
No distributions at all found for pymongo
I found that some say a workaround is downgrading your pip. I downloaded and installed pip 1.2.1 Now I get the error:
(env1)PS C:\dev\virtualenvs> pip install bottle
Downloading/unpacking bottle
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement bottle
No distributions at all found for bottle
The log says:
urlopen error [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions>
How do I correctly use virtualenvs on windows?
EDIT: I am able to use pip when not in my virtualenv.
In this case the operating system should not matter. Also this should not be a question about virtualenv (as suggested in your title). pip just cannot access the remote end that it would like to access. Does it take some time for the error message to appear (is this a timeout issue)? If yes, then this is a networking issue, maybe triggered by a firewall. You should check this first.

Categories