Where are python libraries installed?

As in thread name: when you install some python libraries using pip install -r requirements.txt or maybe using selenium/standalone-chrome:107.0 docker image → WHERE are those installed, how to know their directory/path? I just need exact path to webdriver/chromedriver (Selenium), as I’m using s=Service(“path/to/webdriver”) in my python code. It doesn’t work with any path/directory I tried so far. There’s one of errors I received:

selenium.common.exceptions.WebDriverException: Message: Service ./home/circleci/.wdm/drivers/chromedriver/linux64/108.0.5359/chromedriver unexpectedly exited. Status code was: 127

Below is my config.yml I was using:

version: 2.1
jobs:
  build:
    docker:
      - image: circleci/python:3.8
      - image: selenium/standalone-chrome:107.0

    steps:
      - checkout
      - run:
          name: Upgrade pip
          command: |
            pip install --upgrade pip
      - run:
          name: Install Dependencies
          command: |
            pip install -r requirements.txt
      - run:
          name: Run Selenium Tests1
          command: |
            python -m pytest test_page.py

Hello

You can use the browser-tools orb to install chrome and the chromedriver using the config.yml below this will make chromedriver available at /usr/local/bin/ which can be seen from the final command that is run.

version: 2.1

orbs:
  browser-tools: circleci/browser-tools@1.4.1

jobs:
  build:
    docker:
      - image: cimg/python:3.8
      - image: selenium/standalone-chrome:107.0

    steps:
      - checkout
      - browser-tools/install-chrome
      - browser-tools/install-chromedriver
      - run:
          command: |
            chromedriver --version
      - run:
          command: |
              ls /usr/local/bin/

Kind Regards
Owen Oliver

You should utilize virtual environments for installing and using python requirements. Installing packages using pip and virtual environments — Python Packaging User Guide