I have recently installed PhantomJS and encountered this error on my first run:
from selenium import webdriver from selenium.webdriver.common.keys import Keys d
For me it start to work after
apt install nodejs-legacy # just an alias node/nodejs to make npm install work apt purge phantomjs # optionaly npm install -g phantomjs # most important part because apt installation failed for me