/usr/bin/python: No module named pip - python

I am having a bit of trouble getting everything to work on my Mac running El Capitan. I am running 3.5.1. I am under the impression that Pip is included with an install of the above, however when I try to use it to install sympy using the syntax in terminal: python -m pip install SomePackage, I get the error mentioned in the title. I tried running import pip in IDLE, and got no error, so I am quite confused. If I type pip into IDLE, I get:
<module 'pip' from '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/__init__.py'>
Does anybody know what the problem is? Do I need to navigate to a certain directory in Terminal when I run the command?

I believe that you can run it by calling pip in the terminal. If you have it already installed.
pip install sympy

Related

No module named scipy even though it is installed

I am trying to use scipy but when I import it with import scipy, it says "no module named scipy. I have used pip list to see if it is installed and it is, and i have tried pip install scipy but it just said that it was already installed. Does anyone know how to fix this?
SOLVED: ran the code with python3 instead of python
it is possible you have 2 versions of python installed, python2.7 or python3.x .. when you install stuff with pip and want to use it for a specific python version:
pip install scipy is for python 2.7, so its "python" in the terminal and "python x" to run scripts
pip3 install scipy is for python 3, so its "python3" in the terminal and "python3 x" to run scripts
in your case, you would be calling scripts like:
python pythonFile.py
you would be installing packages like:
pip install package
and you would be using python in the terminal with "python"
if that still doesn't work, for me solving that problem was updating numpy. not sure if it would be the same with you. hope this helped

How do I install selenium without pip?

I need to install a package, Selenium, for python, but when I run ’pip install selenium’ in my command prompt, it says that ’ pip is not recognized as an internal or external command,
operable program or batch file’. I have added my pip path to PATH variables, and I have made sure that pip is installed properly. I have reinstalled python to make sure that pip is installed, and repaired python in case there were missing components or something. I have tried running ’py -m pip install selenium’, and it says that selenium is already installed, but when I run my code it says that there is no module named selenium. I have two different python programs, this python and Anaconda;Spyder. When I install selenium on Spyder, it works, but when I run the code it doesn’t work, not showing any errors. Can you help me
Do you maybe have multiple python versions on your system like for example python2.7 and python3.8?
Maybe you could try using
pip3 install ...
python3 -m install ...
python -m pip install ...
That worked for me. Could you also share your error.
Are you using macOS?
I ran into a similar issue a while back, try:
pip3 install selenium

No module named 'cv2' even after successfully installing it using pip

I am working on ssd - tensor flow project. For which I have to use cv2.
I am able to import it in Jupyter notebook as well as in terminal too.
On running the following command
print cv2.__version__
I am getting output:-
3.4.1
which surely means its installed successfully. (I used sudo pip install opencv-python command to install and had tried brew install as well to resolve the issue) , but still when I run my example.py files using terminal commands. they are giving the following error
No module named 'cv2
I had tried every possibility (by searching for every related issue but still not able to resolve it). Please help.
This worked for me:
sudo apt-get install libopencv-dev python-opencv

pip not found after installation

I installed 'pip' on python, after it tells me that I don't have pip:
Here it tells me that the installation was ok:
But then I'm trying to install this:
but it tells me:
Why 'pip' not found?
EDIT: a picture for Lewis's answer :
Screenshot number 5:
If you have easy_install installed try running: sudo easy_install pip in your terminal and restarting PyCharm.
I see you are using an old version of Python (or at least have it installed). Try running pip3 install name_of_package if you are looking to install through python 3.
Seems that the script is being run from the wrong place. Try to run it from the regular terminal. Remember to get higher privilege,or pip may fail.

Python 3.x - Error while installing packages using pip

I've got a problem while I want to install couple packages for python 3.4.
The problem appears while I want to type pip. Any commands after word pip, easy_install are giving the same error. Installed get-pip.py before but the error still occurs:
C:\Users\Konrad>pip
Fatal error in launche: Job information querying failed
I'm running windows10 x64. The cmd was in admin mode.
Aby suggestions? I typed that error message through google, but there weren't any helpful answers.
Running python just works and launches Python 3.4.3.
That doesn't look like the Python pip command. You have a different pip executable in the way somewhere.
Use python -m pip as a work-around; it'll use Python to find the module and use it as a command-line tool (which is explicitly supported):
python -m pip install <something>

Categories

Resources