Can't install anything in the environment I have created - python

I have set up a new environment on conda.
Once it was created, I disabled threading so that the performance of the software I would be using will be maximised using:
conda env config vars set OMP_NUM_THREADS=1
conda env config vars set NUMEXPR_MAX_THREADS=1
I then tried to install the software and got the error
CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to
download and install packages.
Exception: HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /conda-forge/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
I though this could be specific to the software.
To test this, I tried installing python with
conda install -c conda-forge python
I got the same error here
CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to
download and install packages.
Exception: HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /conda-forge/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
It seems to be an issue with the environment, but I have set up other environments on this machine before and never had this issue.
Does anyone know what could be causing this issue?

I have now resolved this!
If anyone else has the same issue, going back into the base environment and then using "conda install -n name_of_environment python" worked.

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

MacOS 10.13 High Sierra "pip3 install" command doesn't work (SSLError)

for my job purposes, I need a MacOS, but there is no possibility to use a real mac. So I decided to set up virtual machine, using Virtualbox. After the machine was successfully setup, I've opened the Terminal app and run the following commands:
1)/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" (Homebrew install)
2)brew install python (Python 3 install)
3)pip3 install numpy
As an output of the last command, I got the next error message:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Of course, I've tried to find a solution online. Reinstalling python or openssl via Homebrew didn't help. Linking openssl or installing other CA also didn't solve the problem. How can I actually fix this?
P.C. I also know that Apple is a sh*t company and tries to have minimum hardware and software of other companies. That's why they use LibreSSL instead of OpenSSL. But the last one is one that Python requests in order to have the ability to install packages via pip. After python was installed, the following message was in terminal:
This formula is keg-only, which means it was not symlinked into /usr/local.
If you need to have openssl#1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"' >> ~/.bash_profile
Running proposed command also doesn't solve the problem. Any thoughts?

Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") On Linux

This question has been answered here but for Windows users. I am getting this error on a Linux machine on a 3rd party application under a Anaconda environment. I added the following paths to my PATH env:
<path>/anaconda2/lib
<path>/anaconda2/bin
But when I run:
import requests
requests.get("https://api.ipify.org")
I get the error:
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.ipify.org',
port=443): Max retries exceeded with url: / (Caused by SSLError("Can't
connect to HTTPS URL because the SSL module is not available."))
The 3rd party application and a conda shell both include those paths in the PATH env but it only works on the shell.
The error message says "SSL module is not available". Requests uses openssl for its "SSL module" so make sure openssl is installed and working correctly.
First run:
~$ conda list
You should see openssl and pyopenssl in the output
if you don't install openssl and pyopenssl
If openssl is installed run:
~$ openssl
If you get:
openssl: error while loading shared libraries: libcrypto.so.1.0.0: cannot enable executable stack as shared object requires: Invalid argument
Run using the version number from above
~$ sudo find / -name libcrypto.so.[your version]
Then using the path to libcrypto.so.[your version] from the output of the above:
~$ sudo execstack -c [path to]/libcrypto.so.[your version]
Then run to test:
~$ openssl
OpenSSL>
You will need to do this for all environments
It turns out the _ssl.so module in the lib-dynload directory of my python environment was being overriden by the _ssl.so module in the 3rd party software, it was conflicting. So I have made a sym-link to my own module.

Anaconda TensorFlow Installation Error "HTTP"How to fix?

I was trying to install Tensorflow by creating an environment but I got an error because I my Self-Signed Certificate. I fixed this once with pip but I don't know how to do that with Anaconda.
The error is:
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'tls_process_server_certificate\', \'certificate verify failed\')])")))'))
I tried to find a command to fix that but could not find one. I am supposed to be able to create the environment without any issue.
I have searched on Internet and found something related to Conda issue.
Before going to 1) and 2) steps, just type
conda config --set ssl_verify no
Then do following:
Create new environment by typing(optional)
conda create -n tensorflow pip python=3.7
activate tensorflow
Install Tensorflow 1.9
pip install --ignore-installed --upgrade tensorflow==1.9
I didn't get any error with this. If you have errors, comment down below.

conda error ssl certificate : HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443

no matter what I do I get this error
C:\Users\MyPc>conda update --all
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/free/win-64/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/free/win-64/repodata.json.bz2 (Caused by SSLError("Can\'t connect to HTTPS URL because the SSL module is not available."))'))
I have searched all the internet , re-installed anaconda and did whatever is there on suggestion but this issue is still there.
Windows 10
C:\Users\MyPc>anaconda --version
anaconda Command line client (version 1.7.2)
C:\Users\MyPc>conda --version
conda 4.5.12
In my case I got this kind of error message when I try to run this command
conda install tensorflow
here is the Error message
CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to download and install packages.
Exception: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
This is the solution for that
step 01
go to your installation path of anaconda3
step 02
now go to the this file path
anaconda3\Library\bin
step 03
now select this DLL file and copy that
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
step 04
after that go to this file path and paste that to inside of that folder
anaconda3\DLLs
I had this same issue, and the thing that fixed it for me was to install an earlier 32-bit version of Conda. For some reason the newer 64-bit version seemed prone to this error. You can find an earlier version of Conda here:
https://repo.continuum.io/archive/
You should search for an Anaconda3 version that only has x86, not x86_64.
I had the same problem, the simple solution is:
open anaconda navigator from start menu, then run CMD.exe Prompt, and install from there, that's it.

Categories