Edit:
According to the pip website (https://pip.pypa.io/en/stable/installing), I should already have pip installed with my Python version 2.9.7, but I assumed that I don't because of the error message.
I then attempted to install pip by downloading get-pip.py. It was successful but I got the messages:
Found existing installation: pip 1.3.1
Uninstalling pip-1.3.1:
Successfully uninstalled pip-1.3.1
Successfully installed pip-8.1.1 wheel-0.29.0
So it seems I did have a version of pip, so I'm not sure why I was getting the error message described in my original post.
But when I tried to then pip install jupyter, I just get:
-bash: pip: command not found
again. Can someone tell me what I'm doing wrong please?
I need to install iPython Notebook. I already have Python (version 2.7.9) installed on my Macbook, running OS X (version 10.7.5).
After some initial investigation, I saw somebody say that I could just run:
pip install "ipython[notebook]"
When I did this however, I got:
-bash: pip: command not found
So do I have to install pip first? And then use pip to install the Notebook? I'm out of my depth and a little confused!
Okay so my problem was that pip was installed, but in a location that was not included in my $PATH variable.
One of the answers here is relevant.
Related
so I just uninstalled a wrong version of python 3.8 and downloaded python 3.7.4
Now I'm trying to install packages using the command pip install X and get the following error.
C:\Users\User>pip install cv2
Fatal error in launcher: Unable to create process using '"c:\users\user\appdata\local\programs\python\python38-32\python.exe" "C:\Users\User\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe" install cv2': The system cannot find the file specified.
clearly it is still trying to use the old version of python 3.8 even though I have uninstalled it and reinstalled pip several times.
Any idea on why its trying to look for this old path? and how can I change the default path it is using?
(btw this is just a matter of convenience because as of the moment if I use the command python -m pip install X it does seem to work)
try command python -m pip install --upgrade pip
Delete and clear environment config and install again...
I am a Python Noob. (Using Mac OS 10.12 & Python 3.7)
I'm trying to use mpl_toolkits.basemap
to execute the code
from mpl_toolkits.basemap import Basemap
I googled the way to get matplotlib and successfully installed it.
However, while it's possible to run "from mpl_toolkits.basemap import Basemap" in terminal on mac,
it fails to be loaded if I run the command within IDLE.
Then, I googled to figure out the issue and got the hint that
it could be resolved if I install Basemap properly.
To install Basemap, I think I need to go with "FINK".
However, Fink is only available up to 10.5 OS while mine is 10.12.
And FINK website says do not update OS before upgrading FINK.
However, it's too late for me.
Cause I updated my OS longtime ago and recently I started to learn Python Using Mac.
So I guess, if there is a way to install Basemap not using apt-get,
(the codes below is from "Python basemap module impossible to import")
sudo apt-get install libgeos-3.5.0
sudo apt-get install libgeos-dev
sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
I think my issue could be cleared.
Since I'm really really noob, I'm not sure this is the reason for my failing in "from mpl_toolkits.basemap import Basemap".
What I tried so far is
1) brew install basemap
with the error of
Error: No available formula with the name "basemap"
==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
2) pip install basemap
with the error of
Requirement already satisfied
3) sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
with the error of
Command "python setup.py egg_info" failed with error code 1 in
/private/tmp/pip-install-lux494o4/pyproj/
4) conda install basemap
with the following message of
All requested packages already installed.
5) conda install -c conda-forge basemap
with the following message
Preparing transaction: done Verifying transaction: done Executing
transaction: done
Can anyone help to install basemap properly so that I could run
"from mpl_toolkits.basemap import Basemap"
in my IDLe?
My IDLE Sheel keeps saying
Traceback (most recent call last): File "", line 1, in
from mpl_toolkits.basemap import Basemap ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
while my terminal doesn't have problem with running the code.
Appreciate it in advance.
any luck? I spent the day battling this as well. I had the most success when I tried downloading an older version of basemap.
I was using python 2.7 and this worked okay sudo -H pip2 install https://github.com/matplotlib/basemap/archive/v1.1.0.tar.gz
For python 3 try replacing pip2 with pip3 or pip.
Ran into this myself today my solution:
install libgeos on mac
brew install geos
then as you suggested use pip to install mpl_tools:
pip3 install -q https://github.com/matplotlib/basemap/archive/master.zip
This also may help:
missing libgeos_c.so on OSX
Firstly, I suggest you to set Anaconda up. Then follow below steps;
Create a new environment in anaconda.
Install Jupyter Notebook and launch it. If it works, turn it off.
Change your anaconda environment in your terminal.
Try installation commands below;
conda install ...
conda install forge ...
pip install ...
This question is for a Windows 10 laptop. I'm currently trying to install tensorflow, however, when I run:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl
I get the following error:
tensorflow-1.0.0-cp35-cp35m-win_x86_64.whl is not a supported wheel on this platform.
I am trying to install the cpu-version only of tensorflow in an Anaconda 4.3.0 version. I had python 3.6.0 and then I downgraded to 3.5.0, none of them worked.
I also had same problem when I installed anaconda 4.3 version
Here is my solution.
Instead of using Anaconda3 4.3, install Anaconda3 4.2(Anaconda3-4.2.0-Windows-x86_64.exe)
Type on command line(If you are using GPU version)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
Typeon command line(If you are using CPU only)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl
I'm working on win10 with python version=3.5.2, 64 bit
You can use same version of anaconda and execute this command
conda create -n tensorflow python=3.5
activate tensorflow
pip install tensorflow-gpu
It worked for conda 4.0.8
So are you sure you correctly downgraded your python? Run this command on command line pip -V. This should print the pip version and the python version.
Inside your Anaconda environment, try running this:
pip install --upgrade tensorflow
This will do the job. The issue was discussed here also.
Here is the screenshot of how this helped me:
If you have python3 on Windows insatalled, you can use the following command(non GPU):
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl
Worked for me.
There are already two posts on stack overflow on this topic; however, none of them have resolved or addressed my specific situation.
I have installed pytest via pip install pytest. I am able to import the library in Python as well.
The problem is that when I try to use the py.test command in Terminal, I get py.test: command not found.
Does anyone have any insight as to why I am not able to use the command in the terminal?
EDIT: It even shows up as an installed package:
$ pip list
cycler (0.9.0)
matplotlib (1.5.1)
numpy (1.10.1)
pip (8.1.0)
py (1.4.31)
pyparsing (2.0.7)
pytest (2.9.0)
python-dateutil (2.4.2)
pytz (2015.7)
scipy (0.17.0)
setuptools (7.0)
six (1.10.0)
tensorflow (0.5.0)
vboxapi (1.0)
wheel (0.26.0)
using python -m pytest will work for you.
Or if you using virtual environment and installed pytest on virtualenv you should then run py.test alongside your virtual environment.
Check this website can be useful:http://pythontesting.net/framework/pytest/pytest-introduction/
I already had the latest version of pytest on macOS with Homebrew-installed Python 2.7 and this fixed it:
pip uninstall pytest
pip install pytest
Are you on a mac with homebrew by any chance?
I had the same issue and it basically came down to permissions/conflict with the mac os base installed python. pip install would not install or link stuff into /usr/local/bin (it happened with both virtualenv and pytest).
I uninstalled python 2.7 completely with homebrew (brew uninstall python).
Next, I reinstalled python with homebrew to fix pip (it was not a symlink in /usr/local/bin/pip where it should have been linked to Cellar) -- brew install python
Then I uninstalled pip with sudo -- sudo python -m pip uninstall pip to remove the pip owned by root
Now I uninstalled and reinstalled python with homebrew again to reinstall pip with the correct permissions brew uninstall python && brew install python
Next I fixed the python symlinks brew link python
Finally, pip install pytest worked! (and so did pip install virtualenv)
I found the information in the chosen answer from this post very helpful:
https://superuser.com/questions/915810/pip-not-working-on-hombrew-python-2-7-install.
If you're not on a mac, sorry for the noise...
I may be late, but while exploring this I noticed that this can be because the Scripts folder for python is not present in the PATH.
For me this is my scripts folder:
C:\Python38\Scripts\
If the path is a problem then running pip install pytest should actually you give you the warning with the path it was added to.
This should be present in the path. If on windows, edit the environment variables and this location to the PATH.
For me the path was incorrect because of an improper installation of python
I had the same issue. I had pytest v2.8.3 installed and the binary was on my path but under the name py.test. Upgrading to v3.0.3 added the regular pytest executable to the path.
I had the same problem. I have changed the Python installed folder permission to full access. And then uninstalled the pytest and installed again.
pip uninstall pytest
In my case, I had a similar issue in ubuntu 20.04. The below solution worked for me.
Cause: Shell remembers the previous version or previously used Path, hence we need to force the shell to 'forget' the old location - with -r
hash -r pytest
Then execute the tests it should work fine.
For MAC users:
Download python universal installer for mac:
https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg
Then try to install pytest module in terminal using this command:
pip install pytest
Hope this will fix the issue. Thanks!
use the command, pip install -U pytest and install it in your cmd prompt, it will solve the issueenter image description here
I used macbook air m2, and the way I deal with this problem is:
Command in terminal in macbook:
which pytest
/opt/anaconda3/bin/pytest -> my terminal shows this
Then you got the path of pytest, in the "Command", before "pytest", add its path and following with the path of python file you wanna test.
/opt/anaconda3/bin/pytest /Users/cindyng/Desktop/Testing.py
Done, and if you cannot find the path of python in macbook, "which python" also helps, and you can put it in "Home" and "Custom Python Builder".
Hope that helps, good luck!
I Fixed this issue via below steps.
1.First uninstall existing pytest.
2.Check python version.
3.then verify pytest version is supported with python version or not via github issue tracker.
4. via sudo install pytest
sudo pip install pytest
5. verify pytest version and insatlled correctly or not.
pip list
pytest --version
6.run any test using pytest test_abc.py
I encounter the same problem, python -m pytest works for me.
For Windows 7, x64, I'm trying to configure some libraries in Python. I use Python 2.7.11 and the Visual C++ Compiler Package for Python 2.7. When I try to install the library 'numpy-1.10.4+mkl-cp27-none-win_amd64.whl' using pip or easy_install, like:
C:\Python27\Scripts pip install D:\Downloads\numpy-1.10.4+mkl-cp27-none-win_amd64.whl
Nothing happens! I only see blank and can't do anything against it. After searching many pages about similar issues, I followed the instructions from this page:
http://arunrocks.com/guide-to-install-python-or-pip-on-windows/
Thus after installing pip and easy_install in the same path as Python and checking my environment variable the problem still persists..
Do anybody know what else I can do to use pip, or to install the wanted libraries? I'm really thankful for any idea!
You need to use the --use-wheel flag, and also have installed wheel. For example:
pip install wheel
pip install --use-wheel yourfile.whl
Your Windows Account doesnt have full persmissions. Maybe it says its Administrator, but something (ex Server) blocks some operations. I had the same issue at work, I couldnt install PIP but also XAMPP server on my PC.
However, I solved 1st issue - simply ran CMD as Admin, then went to
C:\Python27 and typed:
python.exe -m pip install MySQLdb
so PIP worked, and finally I updated it:
pip install --upgrade pip
P.S: I had 2 pythons 2.7 and 3.5 but did not reinstall or delete anything.