如何将Firefox添加到Amazon Web Service上的Linux实例的系统PATH?

这是一个天真的问题,但是如何将Firefox添加到Amazon Web Service Linux实例上的系统PATH? 我应该澄清,我安装了firefox到/home/firefox而不是/usr/bin 。 谢谢! 我正在尝试加载firefox webdriver(导入selenium )出现以下错误:

 >>> driver = webdriver.Firefox() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 64, in __init__ self.binary = capabilities.get("binary") or FirefoxBinary() File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 47, in __init__ self._start_cmd = self._get_firefox_start_cmd() File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 163, in _get_firefox_start_cmd " Please specify the firefox binary location or install firefox") RuntimeError: Could not find firefox in your system PATH. Please specify the firefox binary location or install firefox 

将以下内容添加到~/.profile

 export PATH="$PATH:/home/firefox" 

或者是~/.bashrc~/.bash_profile ,如果shell是Bash。

请参阅Shell初始化文件