0

Adding modules has been very confusing on my laptop. Whenever I run the pip command, it will appear to be successful – for example:

> pip install selenium
Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python2.7/dist-packages

However, when I try to use it in running python example.py, I get:

Traceback (most recent call last):
  File "scriptattempt.py", line 2, in <module>
    from selenium import webdriver
ImportError: No module named selenium

Where this happens with pretty much any modules I try to import. Not exactly sure why, I installed python 3 in the past, so I wasn't sure if maybe that's causing problems. I tried python3 example.py, but got the same error for packages in the line before. I looked in at my site-packages file, at location: /usr/local/lib/python2.7/site-packages but it's empty. Is this my problem? Is pip not unpacking in the correct location?

Rushy Panchal
  • 16,979
  • 16
  • 61
  • 94
Julian
  • 550
  • 1
  • 4
  • 16
  • Possible duplicate of [Python: installed selenium package not detected](http://stackoverflow.com/questions/30450388/python-installed-selenium-package-not-detected) – timbre timbre May 09 '16 at 00:40
  • If it's empty, then perhaps somebody deleted it from there, but didn't updated pip DB. Try to install it into user's folder with `pip install --user`, if you can't re-install it from scratch. – user3159253 May 09 '16 at 01:23

0 Answers0