Issue
I was trying to install TensorFlow with Anaconda 3.9.9.
I ran the command
pip install tensorflow
and there was an error saying:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/tensorflow/
Could not fetch URL https://pypi.org/simple/tensorflow/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/tensorflow/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
I have tried adding /anaconda3
, /anaconda3/Scripts
and /anaconda3/library/bin
to the Path variable. I have also tried running the command:
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org tensorflow
but nothing seems to be working.
Did I miss anything and are there any other solution?
Solution
Try running below command to fix this issue:
pip install --upgrade
pip install ssl
Please create an virtual_environment to install TensorFlow
in Anaconda
.
Follow below code to install TensorFlow
in virtual_environment:
conda create -n tf tensorflow #Create a Virtual environment(tf).
conda activate tf #Activate the Virtual environment
pip install tensorflow #install TensorFlow in it.
Note: You need to activate the virtual_environment each time you want to use TensorFlow.
Answered By - TFer2
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.