"ImportError: No module named selenium"

Installed selenium using pip : pip install selenium<br>
pip version : pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)<br>

python version : Python 2.7.5

Wasn't getting this error earlier.

"ImportError: No module named selenium"

Upgraded pip a while ago and started getting this error. Couldn't find anything useful from earlier questions.

sys.path:
['', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']

Can anyone please help?


Please check if you have multiple python interpreters in your machine.

check what is your default interpreter by python in your terminal and press ENTER.

if it is same as the version mentioned y PIP while installing, you should not have any problems.

or else,

change your default interpreter by keeping alias in your bash file,

append below line as last line as per your interpreter version

alias python='/usr/bin/python2.7.6'
链接地址: http://www.djcxy.com/p/55280.html

上一篇: wsgi和虚拟环境

下一篇: “ImportError:没有名为硒的模块”