I use the following code to run Tor controlled by Selenium in Lubuntu:
from selenium import webdriver from selenium.webdriver.firefox.firefox_profile import Firef