I had the same problem: script with import colorama was throwing an ImportError, but sudo pip install colorama was telling me "package already installed".
My fix: run pip without sudo: pip install colorama. Then pip agreed it needed to be installed, installed it, and my script ran.
Or even better, use python -m pip install <package> (or python3 or python3.6 or even the full path). The benefit of this is, since you are executing the specific version of python that you want the package in, pip will unequivocally install the package into the "right" python. Again, don't use sudo in this case... then you get the package in the right place, but possibly with (unwanted) root permissions.
My environment is Ubuntu 14.04 32-bit; I think I saw this before and after I activated my virtualenv.
Answer from Dan H on Stack OverflowI had the same problem: script with import colorama was throwing an ImportError, but sudo pip install colorama was telling me "package already installed".
My fix: run pip without sudo: pip install colorama. Then pip agreed it needed to be installed, installed it, and my script ran.
Or even better, use python -m pip install <package> (or python3 or python3.6 or even the full path). The benefit of this is, since you are executing the specific version of python that you want the package in, pip will unequivocally install the package into the "right" python. Again, don't use sudo in this case... then you get the package in the right place, but possibly with (unwanted) root permissions.
My environment is Ubuntu 14.04 32-bit; I think I saw this before and after I activated my virtualenv.
In my case, it was a permission problem. The package was somehow installed with root read/write permission only, and another user just could not read/write to it!
I'm trying to import/use an ETL package, PETL, withimport petl as etl
I did
pip install petl
from my project's root library; it appeared to install fine but VSCode is telling me it can't find the module; and when I try to run it from the terminal there it gives syntax error
I'm using python 3.7; I don't think I have multiple versions of python installed, but not sure how to check that
this seems to be a relatively common problem; a quick google answer says it's not looking where pip installed it
6 months ago I installed pymssql, am using that in the same script, and am able to find that fine (I'm just now getting back into a small python project)
says it's not looking where pip installed it
If you run "pip -V" in the cli it will display where pip will install.
If you run 'import sysconfig; print(sysconfig.get_paths()["purelib"])' it will show where python looks for packages.
If you know which interpreter you want to use, you can ensure an install will be going to the right place by running "python3 -m pip install mymodule" .
I know this has already been answered, but just to throw it out here:
You can also type "pip list -v" in CMD to list locations of all installed packages
Try:
pip install dedupe
Without 'sudo' command. Otherwise you'll install library without rw permissions for common user (only root can rw)
I also get the same error when i start using "kali linux" . Maybe your python3 is try to find your script's module in the "/usr/local/lib/python3.x" directory . So if that module is not there then the ModuleNotFoundError: No module named 'dedupe' error is happening .
Actually I don't have permanent solution, but you can try following one ..........
To solve that problem simpley go to that directory where the module is present to see the directory just run sudo pip3 install "moduleName" command on the "terminal"
you probably get something like this :-
"Requirement already satisfied: 'moduleName' in /usr/local/lib/python3.x/dist-packages (moduleVersion)"
or
"Requirement already satisfied: 'moduleName' in /usr/lib/python3/dist-packages (moduleVersion)".
Then just copy that `Module` to the `/usr/local/lib/python3.` directory......
Hopefully it should work....... Thank you...