Resolving SSL certificate verification issues when running commands using 'pip'

Resolving SSL certificate verification issues when running commands using 'pip'

Access blocks are quite common in corporate environments. As a result, you may encounter problems when trying to use BotCity tools and Python resources on a machine in your company's environment.

One problem that may occur in these scenarios is the failure of the SSL certificate validation when trying to execute commands using Python's `pip`, such as installing a dependency.

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:1000)'))': /simple/pip/

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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)'))) - skipping

If you are seeing an error similar to this in the Runner, log, or when running commands manually, it may be that your environment is blocking you from installing packages directly from PyPI (Python Package Index).

To resolve this issue, you can try running the following command to perform a global `pip` configuration related to `trusted-host`:

  1. pip config set global.trusted-host  "pypi.org files.pythonhosted.org pypi.python.org" --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

This way, the next time the Runner performs the dependency installation step, this SSL-related error will not happen again.

If this alternative is not enough, it is important to validate with your company's IT team whether this is an appropriate solution for your environment.

Also, remember to validate with your IT team whether it is necessary to perform additional configurations regarding the use of `pip`.

You can find more details about problems with blocking environments in the prerequisites section of the documentation.


    • Related Articles

    • Problems with dependencies when running an automation

      This problem usually occurs when the dependencies installation step is not done correctly. When running the code, a message is displayed regarding the installation of the packages: ModuleNotFoundError: No module named 'botcity’ The first step is to ...
    • Troubleshooting when using ‘Print Screen’ in BotCity Studio

      In some sporadic cases, when using the 'Print Screen' key to take a screenshot, the captured image is not displayed in Studio. This behavior may be related to several factors, such as other applications intercepting the 'Print Screen' action, ...
    • Keeping your remote session active when using Runner

      In some cases where a VM is used to run the automation, keeping the remote session active is necessary to avoid problems with the graphical interface, such as the OSError: screen grab failed error. This error is usually thrown when trying to perform ...
    • Problems with blocking environments

      If you are trying to use BotCity's tools in a corporate environment, you may encounter some issues related to environment locks. Here are some of the most common issues when using the BotCity Studio SDK in blocking environments: Installation through ...
    • Where can I find content to learn more about using BotCity?

      A great alternative to have a first contact with the tools is to access the courses available on BotCity Academy. Additionally, you can also access the tutorials available on the documentation portal: Getting started with BotCity Developing your ...