pip install --upgrade pip installs the same version - python

Somehow pip --upgrade doesn't upgrade any packages.
I'm on OSX El Capitan (10.11.3) and installed python using brew install python
Python: /usr/local/bin/python# -> ../Cellar/python/2.7.11/bin/python
Pip: /usr/local/bin/pip# -> ../Cellar/python/2.7.11/bin/pip
After successful install I run pip install --upgrade pip.
Full output:
$ pip install --upgrade pip
Collecting pip
Using cached pip-8.1.0-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.0.2
You are using pip version 8.0.2, however version 8.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Why doesn't pip install the new version?
Update
I think it has something to do with my ~/.pydistutils.cfg file which fixes the DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both error when running pip. I followed these instructions
Related SO question

$ sudo pip install -U pip
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 335kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-9.0.3

Getting annoyed by things not working I created a new OSX profile. In the new profile everything was working fine so after investigating further I found a file ~/Library/Application\ Support/pip/pip.conf in my main profile containing:
[global]
target=/usr/local/lib/python2.7/site-packages
I don't know how it got there but removing it resolved the issue.
This also resolved the need for the ~/.pydistutils.cfg file.

Related

pip install ibm-db seems failed. keep "Getting requirements to build wheel" for minutes

my pip info
pip3 --version
pip 22.0.3 from /myPath/Python/3.8/lib/python/site-packages/pip (python 3.8)
while i install "ibm-db" for the lastest version, it shows
Defaulting to user installation because normal site-packages is not writeable
Collecting ibm-db
Using cached ibm_db-3.1.1.tar.gz (1.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... -
and nothing happened anymore.
what shoule I do?
thanks
Check that you have gcc and python-devel installed. If not (Assuming a Redhat derivative, something similar for others)
sudo dnf install gcc
sudo dnf install python3-devel
The pip installation seems to access some system files, despite being installed with --user, so you may have to:
sudo pip3 install --user ibm_db
You can find more info at: pypi

pip is showing that its upgraded but it's not?

I am trying to install pygame on my pc but the process was getting finished by exit code -1. So some people recommended to upgrade it (my old one was 7.1.0) After upgrading, I am still seeing 7.1.0
Command:
pip install --upgrade pip
What I got
You are using pip version 7.1.0, however version 21.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
Collecting pip
Using cached https://files.pythonhosted.org/packages/ac/cf/0cc542fc93de2f3b9b5
3cb979c7d1118cffb93204afb46299a9f858e113f/pip-21.1-py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-7.1.0
So I mean that pip is still stuck at 7.1.0 instead it should have jumped to the latest??*
Now when i try to see pip version by typing:
pip --version
it returns
pip 7.1.0 from c:\python34\lib\site-packages\pip-7.1.0-py3.4.egg (python 3.4)
Run the following command:
$ python -m pip install --upgrade pip

pip install --upgrade gives the same warning

Successfully installed pip-21.0.1
WARNING: You are using pip version 20.2.1; however, version 21.0.1 is available.
Full trace
$ /usr/bin/python3 -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 19.7 MB/s
Installing collected packages: pip
WARNING: The scripts pip, pip3 and pip3.6 are installed in '/home/ubuntu/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.0.1
WARNING: You are using pip version 20.2.1; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
Despite upgrading why does it give the warning?
You don't have write permission to do the site-package upgrade re site-packages is not writeable. You can run it with sudo if you wish, although for a Debian based distribution it would be more appropriate to leave package managed files alone.
And you are not using the local version you installed re `'/home/ubuntu/.local/bin' which is not on PATH`.
To do this,
export PATH=$PATH:/home/ubuntu/.local/bin
Use sudo /usr/bin/python3 -m pip install --upgrade pip

pip install --upgrade pip isnt upgrading pip

I'm trying to upgrade pip on Centos 7. I pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7) installed.
When I run pip install --upgrade pip --user I get the following output:
Collecting pip
Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.2
You are using pip version 8.1.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
What I've tried
I've tried the following, which have all resulted in the same output and result as above:
pip install --upgrade pip --user
pip install -U pip --user --ignore-installed
pip install -U pip --user --ignore-installed --no-cache-dir
sudo yum update pip which returns
No Match for argument: pip
No package pip available.
No packages marked for update
sudo yum update python-pip which returns No packages marked for update
Observations
python -m pip --version outputs:
pip 19.3.1 from /home/deploy/.local/lib/python2.7/site-packages/pip (python 2.7)
pip --version outputs:
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
You need to update your PATH to include /home/deploy/.local/lib/python2.7/bin before /usr/lib/python2.7/bin if you want pip to resolve to the same location as python. Otherwise, python -m pip is the more proper usage pattern
Otherwise, you're looking at two completely separate python installations and pip is indeed upgraded in one of them
Note: Python2 is end of life, so probably best to remove the one in your home folder, anyway, and switch to using something like Pipenv or pyenv

Can't upgrade or remove pip package "altgraph" on MacOs(Mojave)

I want to install PyInstaller package through pip, So I typed "pip install pyinstaller", but it occur errors
and I was trying to upgrade the alt graph to latest version.. but it occur same errors
how can I install the PyInstaller or how can I upgrade the package altgraph ?
Therefore, even I can't delete altgraph using
rm -rf /System/Library/Frameworks/Python.framework/.../altgraph
What I did in terminal
pip install pyinstall - not working
pip install --upgrade altgraph - not working
pip uninstall altgraph - not working
I found a solution from
http://marcelog.github.io/articles/mac_osx_python_pip_install_operation_not_permitted.html
install package under a user
pip install <package> --user

Categories