I am trying to install mysql-python using:
pip install mysql-python
the package is being installed below, although I already have Python 2.6 on the system.
/Library/Python/2.5/site-packages
How can I get pip to install in:
/Library/Python/2.6/site-packages
I tried using:
pip install --install-option="--prefix=/Library/Python/2.6/site-packages/" mysql-python
but that didn't work and it outputs:
Requirement already satisfied (use --upgrade to upgrade): mysql-python in
/Library/Python/2.5/site-packages
Cleaning up...
You should have pip-2.6. If you don't have pip version 2.6 :
You have to install setuptools for Python 2.6 (example : setuptools-0.6c11-py2.6.egg). Then, you have easy_install-2.6. You can do :
easy_install-2.6 pip
Finally, you have pip version 2.6. To install mysql-python :
pip-2.6 install mysql-python
Related
I'm experiencing a issue with my packages, I installed a package with Python 3.7 and the current version of Python in my computer is 3.9. So I can't uninstall or update the given package.
ζ pip3 install --upgrade youtube-dl
Requirement already satisfied: youtube-dl in /usr/local/lib/python3.9/site-packages (2021.4.7)
Collecting youtube-dl
Downloading youtube_dl-2021.4.26-py2.py3-none-any.whl (1.9 MB)
|████████████████████████████████| 1.9 MB 551 kB/s
Installing collected packages: youtube-dl
Attempting uninstall: youtube-dl
Found existing installation: youtube-dl 2021.4.7
Uninstalling youtube-dl-2021.4.7:
Successfully uninstalled youtube-dl-2021.4.7
Successfully installed youtube-dl-2021.4.26
WARNING: You are using pip version 21.0.1; however, version 21.1.1 is available.
You should consider upgrading via the '/usr/local/opt/python#3.9/bin/python3.9 -m pip install --upgrade pip' command.
ζ youtube-dl --version
2021.04.01
ζ which pip3
/usr/local/opt/python#3.9/bin/pip3
ζ which youtube-dl
/Library/Frameworks/Python.framework/Versions/3.7/bin/youtube-dl
How can
What you need to do to solve this issue is navigate to the Pip from the version that you have installed the package, in this case, 3.7, uninstall or update the package using this pip.
ζ cd /Library/Frameworks/Python.framework/Versions/3.7/bin/
ζ ./pip3 uninstall youtube-dl
Found existing installation: youtube-dl 2021.4.1
Uninstalling youtube-dl-2021.4.1:
Would remove:
/Library/Frameworks/Python.framework/Versions/3.7/bin/youtube-dl
/Library/Frameworks/Python.framework/Versions/3.7/etc/bash_completion.d/youtube-dl.bash-completion
/Library/Frameworks/Python.framework/Versions/3.7/etc/fish/completions/youtube-dl.fish
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl-2021.4.1.dist-info/*
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/*
/Library/Frameworks/Python.framework/Versions/3.7/share/doc/youtube_dl/README.txt
/Library/Frameworks/Python.framework/Versions/3.7/share/man/man1/youtube-dl.1
Proceed (y/n)? y
Successfully uninstalled youtube-dl-2021.4.1
Now you can install the package with latest the Python in your system
ζ pip3 install youtube-dl
This answer also provide a method for dealing with multiple python versions
well and if you are looking to install the latest pip version with the help of pip, just runpython3 -m pip install pip=="VERSION_NUMBER_HERE" for a precise pip installation
I have the following issue every time I try to install a package in Python 3:
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command
I tried to do the upgrade pip command as follows, with the also following warning:
$ pip3 install --upgrade pip
Collecting pip
Using cached pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Successfully installed pip-20.3.1
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command
I tried the other way, with the same error:
$ /usr/bin/python3 -m pip install --upgrade pip
Collecting pip
Using cached pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Successfully installed pip-20.3.1
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command
I also tried the Following suggestion to solve this problem, downloading the package and ask pip to install directly from the .tar.gz file:
$sudo python3 -m pip install /home/me/Downloads/pip-20.3.1.tar.gz
[sudo] password for me:
Processing /home/me/Downloads/pip-20.3.1.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: pip
Building wheel for pip (PEP 517) ... done
Created wheel for pip: filename=pip-20.3.1-py2.py3-none-any.whl size=1518515 sha256=36207044a2b9042728f3cd0f971569217f4e2e9c68c84adbf5c42617e08b9d3c
Stored in directory: /root/.cache/pip/wheels/0e/09/b2/4673e6d2eee911dbbeaeeba8e68eebb9719b1b3ba25ad93e2c
Successfully built pip
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'pip'. No files were found to uninstall.
Successfully installed pip-20.3.1
Again, the same error happens:
$pip3 install pydot
Collecting pydot
Using cached pydot-1.4.1-py2.py3-none-any.whl (19 kB)
Collecting pyparsing>=2.1.4
Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Installing collected packages: pyparsing, pydot
Successfully installed pydot-1.4.1 pyparsing-2.4.7
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
My Python versions are:
$python --version
Python 3.7.9
$python3 --version
Python 3.8.5
My PATH variable links the following directories:
$echo $PATH
/home/me/.local/bin:/home/me/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
What is happening here? should I have to add something to my PATH variable in order to link the right python version to the pip upgrade command? or there is something else to be done?
Just do the pip3 upgrade with sudo. I think you mixed up python2 and python3 installs with your sudo call.
Just tested and gave me the correct version on pip3:
$ sudo pip3 install --upgrade pip
Collecting pip
Downloading pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 2.6 MB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.0.2
Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'pip'. No files were found to uninstall.
Successfully installed pip-20.3.1
$ pip3 --version
pip 20.3.1 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)
Tested on KDE Neon (Ubuntu 20.04).
Also make sure you don't have another version of pip installed somewhere in the user installations. These easily get mixed up between apt and the user locations for python installs.
pip install --upgrade pip --no-cache-dir
This worked for me
You are using pip version 19.2.3, however version 20.3.4 is available.
You should consider upgrading via the pip install --upgrade pip command.
I am running Mac OS High Sierra Version 10.13.5. I tried to install virtualenv and got message saying I need to upgrade pip to a later version
AKALBAG-M-82RZ:Python amkalbag$ pip install --user virtualenv
You are using pip version 6.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting virtualenv
Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
So I tired upgrading pip:
AKALBAG-M-82RZ:~ amkalbag$ pip install --upgrade pip
You are using pip version 6.1.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
I also tried using sudo, but that did not help either.
AKALBAG-M-82RZ:~ amkalbag$ sudo -H pip install --upgrade pip
Password:
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
I keep getting message "Requirement already up-to-date".
How can I upgrade to pip version 10.0.1 so I may then install virtualenv?
I'm trying to install pandas on the raspberry pi 2 (model b, 7 wheezy), python3.5.1, pip 9.0.1 with the command from the title, this is my terminal.
pi#raspberrypi ~ $ sudo pip3 install pandas
Collecting pandas
Using cached pandas-0.21.0.tar.gz
Requirement already satisfied: python-dateutil>=2 in /usr/local/lib/python3.5/site-packages (from pandas)
Requirement already satisfied: pytz>=2011k in /usr/local/lib/python3.5/site-packages (from pandas)
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.5/site-packages (from pandas)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.5/site-packages (from python-dateutil>=2->pandas)
Installing collected packages: pandas
Running setup.py install for pandas ... /
I have left it like this for hours, with no progress, what is wrong?
Without success, I have tried:
Pip Install hangs
https://bbs.archlinux.org/viewtopic.php?id=174186
Edit in response to Andy K's comment, I have tried the following with apt-get:
pi#raspberrypi ~ $ sudo apt-get install python3-pandas
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-pandas
I've added the correct repositories, but still no joy
I solved this by upgrading the os on the pi, then using the command:
sudo apt-get install python3-pandas
My repositories are now slightly different to in the repositories link in the question, they are below:
deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
If anyone's interested, the specs are now as below:
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Finally, with the new os I still could not pip install pandas, i left it running overnight with no success
I've had this same issue on ARM machines using Docker. On my machine python3-pip provided an old pip distribution (9.0.1). So for me upgrading pip & setuptools sufficed
pip3 install -U pip setuptools
Then you can install the rest of your dependencies normally.
I just had the same problem on my venv and the solution was upgrade my pip3 version, by default my venv came with pip 18.1 and the actual is 21.3.1.
first i ran
pip3 install --upgrade pip
after
pip3 install pandas
I'm using NVIDIA Jetpack 4.6 on a Jetson Nano with Ubuntu 18.04. 'pip3 install --upgrade pandas' would just hang until I upgraded pip and setuptools. You'd think they'd ship a more recent version considering that Jetpack 4.6 just came out.
I develop for both Python 2 and 3.
Thus, I have to use both pip2 and pip3.
When using pip3 - I receive this upgrade request (last two lines):
$ pip3 install arrow
Requirement already satisfied (use --upgrade to upgrade): arrow in c:\program files (x86)\python3.5.1\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in c:\program files (x86)\python3.5.1\lib\site-packages (from arrow)
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in c:\program files (x86)\python3.5.1\lib\site-packages (from python-dateutil->arrow)
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
My default pip is for Python 2, namely:
$ python -m pip install --upgrade pip
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
However, none of the following explicit commands succeed in upgrading the Python 3 pip:
$ python -m pip3 install --upgrade pip3
/bin/python: No module named pip3
$ python -m pip install --upgrade pip3
Collecting pip3
Could not find a version that satisfies the requirement pip3 (from versions: )
No matching distribution found for pip3
$ python -m pip install --upgrade pip3.4
Collecting pip3.4
Could not find a version that satisfies the requirement pip3.4 (from versions: )
No matching distribution found for pip3.4
What is the correct command to upgrade pip3 when it is not the default pip?
Environment:
$ python3 -V
Python 3.4.3
$ uname -a
CYGWIN_NT-6.1-WOW 2.5.2(0.297/5/3) 2016-06-23 14:27 i686 Cygwin
Just use the pip3 command you already have:
pip3 install --upgrade pip
The installed project is called pip, always. The pip3 command is tied to your Python 3 installation and is an alias for pip, but the latter is shadowed by the pip command in your Python 2 setup.
You can do it with the associated Python binary too; if it executable as python3, then use that:
python3 -m pip install --upgrade pip
Again, the project is called pip, and so is the module that is installed into your site-packages directory, so stick to that name for the -m command-line option and for the install command.
When I searched for "how to update pip3" this came up. I had the problem described here in mind:
The Problem
Upgrading with pip3 might make point pip to the Python 3 version.
It seems as if this is not the case (any more).
The solution
Update the one you want to keep after the one you want to upgrade. Hence
pip3 install --upgrade pip
pip2 install --upgrade pip --force-reinstall
will make sure that pip points to pip2.