Module Not Found in Python After Installing in Terminal
This Question Has Been Asked a Few Times, but the Remedy Appears to Complicated Enough That I'm Still Searching for a User Specific Solution. I Recently...
This question has been asked a few times, but the remedy appears to complicated enough that I'm still searching for a user specific solution. I recently re-installed anaconda; now, after entering
"pip install splinter"
in the Terminal on my Mac I get the response:
"Requirement already satisfied: splinter in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: selenium>=2.53.6 in /usr/local/lib/python2.7/site-packages (from splinter)"
But, I get the following error in python (Anaconda) after entering import splinter
Traceback (most recent call last):
File "", line 1, in
import splinter
ImportError: No module named splinter"
When I enter which python in the terminal, this is the output: "/usr/local/bin/python"
I am editing the question here to add the solution: ~/anaconda2/bin/pip install splinter
3 Answers
1) Try uninstalling and the re install it:
pip uninstall splinter
2) Also manually delete splinter from "site-packages".
3)Also try this if problem still persists:
$ easy_install -m PACKAGE_name
those are two different pythons. you are using the pip from your default python, but trying to import the package from anaconda.
use
$ dirname `which python`
to see where the anaconda's python executable is, then see that folder for pip. now use this pip to install the package
I had the same issue, I uninstalled and reinstalled splinter many times but that didn't work. Then I typed source activate (name of my conda environment) and then did pip install splinter. It worked for me.