In this short post, you’ll see one way to install a package in Anaconda when facing a connection timeout.
Normally, you can install a Python package in Anaconda by opening the Anaconda Prompt and then typing the following command to install your desired package:
pip install package_name
However, there could be times when you get the following connection timeout error:
In that case, you may apply the steps below to overcome this error.
Steps to Install a Package in Anaconda when Facing Connection Timeout
Step 1 – Download the needed package
- Search for your desired package by going to The Python Package Index (PyPI)
- Type the name of the package in the search bar and then press ENTER
- Click on your desired package
- Press on the “Download files” under the Navigation menu
- Click on the ‘Wheel’ version (‘whl’ file) that you wish to download
Step 2 – Place the downloaded file in a location of your choosing
Now place the ‘whl’ file that you just downloaded in a location of your choosing.
For example, let’s suppose that the file was placed under the following path:
Step 3: Install the package
For the final step, open the Anaconda Prompt.
Then, type cd\ and press ENTER:
Now type cd + the location where your downloaded ‘whl’ file is stored. For our example:
Finally, type pip install precise_file_name.whl
Don’t forget to include the file extension which is ‘.whl‘
Once you’re done, press ENTER and your package would be installed.