Python – mount can’t resolve selenium module in a container

I am trying to mount my host computer to my docker container which has selenium and chromeWebDrive. I ran the following command to start the container.

docker run -d -p 4444:4444 -v ${PWD}:/dev/shm selenium/standalone-chrome

The selenium/standalone-chrome is the image I found from official seleniumHQ repo here
https://github.com/SeleniumHQ/docker-selenium

In my host machine, I have a test.py file that looks like this in vs-code.


from selenium import webdriver
from selenium.webdriver.chrome.options import Options

However, I am getting warning from my vs-code saying unresolved import selenium

I don’t have selenium installed in my host machine and I was hoping to use docker instead.

Is there a way to make my vs-code recognize the selenium package inside my docker? Thanks a lot!

Source: StackOverflow