1

I have tried to add the path of chrome driver in Ubuntu 18.04LTS.

  1. How do I put chromedriver in PATH

its located at

/home/<usr>/Documents/Python/chromedriver

in my laptop

can any one help me with the solution for this?

Thanks in advance.

0

After you downloaded und extracted ChromeDriver you have three options.

  • A) Save the file in a directory which is already in PATH

  • B) Save the file at a custom location and add it to PATH

  • C) Save the file at a custom location and create a symlink to the file in one of the directories that are already in PATH

For the following examples let's assume the extracted file is in ~/Downloads

Example to A)

// Move file to a directory that's already in PATH
sudo mv ~/Downloads/chromedriver /usr/local/bin

// Make file executable
sudo chmod +x /usr/local/bin/chromedriver

Example to B)

// Move file to a directory that's not in PATH
mv ~/Downloads/chromedriver ~/Documents/Python/ChromeDriver/

// Make file executable
chmod +x ~/Documents/Python/ChromeDriver/chromedriver

// Add directory to PATH
echo 'export PATH="$HOME/Documents/Python/ChromeDriver:$PATH"' >> ~/.profile
source ~/.profile

Example to C)

// Move file to a directory that's not in PATH
mv ~/Downloads/chromedriver ~/Documents/Python/ChromeDriver/

// Make file executable
chmod +x ~/Documents/Python/ChromeDriver/chromedriver

// Create a symlink to 'chromedriver' in one of the directories 
// that are already in PATH (e.g. /usr/bin or /usr/local/bin)
sudo ln -s ~/Documents/Python/ChromeDriver/chromedriver /usr/bin/chromedriver

I hope i could make it clear.

2
  • Example to C) worked as solution – Akshat Zala May 6 '20 at 5:21
  • I'm glad i could help you. Actually, all three of them should work. – Don Foumare May 6 '20 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.