brew install 准确粘贴了路径

Where brew install has pasted the path exactly

我正在尝试使用 splinter,它是一个基于 selenium 的网络浏览包。

最初我尝试 运行 并得到了错误,即使我已经下载了 chromedriver。

from splinter import Browser
browser = Browser()

os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

但是我设法 运行 brew install chromedriver 之后的代码。 我很好奇 brew install 将路径粘贴到哪里。我查看了 .bash_profile 并没有发现任何区别。

找出实际文件的安装位置 运行 brew info chromedriver。在我的机器上,这给出了路径

/usr/local/Cellar/chromedriver/2.33

这不是我的$PATH,而是运行宁type程序上告诉我们

$ type chromedriver
chromedriver is /usr/local/bin/chromedriver

在路径中。此外,该路径是指向实际安装文件夹的符号链接,您可以这样找到它

ls -l /usr/local/bin/chromedriver
lrwxr-xr-x  1 harald  admin  44 Nov 25 21:08 /usr/local/bin/chromedriver -> ../Cellar/chromedriver/2.33/bin/chromedriver