How can I uninstall setuptools? - python

I can't uninstall setuptools. How come?
$ sudo pip uninstall setuptools
Can't uninstall 'setuptools'. No files were found to uninstall.
$ sudo pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/dist-packages
Cleaning up...
How can I uninstall setuptools?

Considering that current Python versions are shipped with setuptools, pretty sure you shouldn't remove it.
And since pip uninstall setuptools doesn't work (thankfully), you could try just deleting the C:\Python27\Lib\site-packages\setuptools, or equivalent, folder. (On *nix systems: /usr/lib/python2.7/dist-packages.)
Disclaimer: this is a very bad idea, pip may not work at all afterwards.

Related

`pip install --upgrade -r requirements.txt` vs frozen module versions

How are module versions resolved when both specifying specific module version numbers in the requirements.txt file and passing the --upgrade option to pip install?
Example of specifying the module version number in the requirements.txt file:
numpy==1.18.1
Example of specifying the the --upgrade flag:
python -m pip install --upgrade -r requirements.txt
Is there a best practice for avoiding this ambiguity when making releases (e.g. Docker images)?
pip install --upgrade is used to upgrade to the latest available version. When a particular version is specified --upgrade is ignored and could be omitted.

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 says it is up to date when I try to update it but then it is not

How can I fix this issue? This makes no sense, i guess i have two different python path so python gets confused how can i fix this issue as well?
C:\Users\user>pip install pip
Requirement already satisfied: pip in c:\users\user\appdata\local\programs\python\python38-32\lib\site-packages (19.3.1)
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\user>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (20.0.2)
You have 2 different versions of Python (hence 2 different versions of pip) installed.
pip in c:\users\user\appdata\local\programs\python\python38-32
and
pip in c:\users\user\appdata\local\programs\python\python37-32
In the first example you did pip install pip but in the second python -m pip install --upgrade pip (The help text gave you a bad advice in this case).
If you want to upgrade the Python 3.8 pip, do pip install --upgrade pip or with the full path c:\users\kayra\appdata\local\programs\python\python38-32\python.exe -m pip install --upgrade pip.

GoogleScraper Installation error - setuptools must be installed

I have virtualenv-13.1.2 set up with python 3.4 (global python is python-2.7) in ubuntu 14.04. When I try to install GoogleScraper using coammandpip install GoogleScraper it gives an error
setuptools must be installed to install from a source distribution
If I do pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./env/lib/python3.4/site-packages
If I do pip install setuptools --upgrade
Requirement already up-to-date: setuptools in ./env/lib/python3.4/site-packages
How can I successfully install GoogleScraper?
I was missing python3-dev tools. I did sudo apt-get install python3-dev and it worked like a charm.
After upgrading the python3.4 package in Ubuntu 14.04 I get the same error.
A quick solution is to delete and re-create the virtualenv.

Can't pip install virtualenv on Mac 10.9 Mavericks with brewed python

I am trying to setup virtualenv to keep my python env clean and organized.
Well, actually I'm trying to install scrapy as I wrote about here which opened this can of python worms that I'm now trying cleanup after will virtualenv.
The final verdict was to install virtualenv (which is failing) and hence this post. This is where I'm at:
$ virtualenv test
-bash: virtualenv: command not found
I understand that this means wherever virtualenv installed via pip install virtualenv isn't in my path but it should be after following these:
Can't pip install virtualenv in OS X 10.8 with brewed python 2.7
http://hackercodex.com/guide/python-development-environment-on-mac-osx/
https://github.com/Homebrew/homebrew/issues/12667#issuecomment-6257342
http://www.lowindata.com/2013/installing-scientific-python-on-mac-os-x/
Delete all virtualenv and start from scratch
brew doctor returns ready to brew.
My guess is that my system python and my brew python aren't playing nicely but I'm out of ideas as to what else I can do to fix this.
At this point I'm willing to do a clean install of just about everything (even mac os x) if that's what it takes. I'm pretty sure I sudo pip install'd something(s) a while ago and I'm paying the price for it now.
More details of the install:
~ ∮ pip install virtualenv
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages
Cleaning up...
~ ∮ pip install virtualenvwrapper
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): stevedore in /usr/local/lib/python2.7/site-packages (from virtualenvwrapper)
Cleaning up...
I tried both
brew install python --with-brewed-openssl AND brew install python --framework (after uninstalling the previous when it wasn't working) (and all the other suggestions in the above links)
thanks in advance!
virtualenv looks to be in the wrong place. On Mac 10.9 it should be in /usr/local/bin/virtualenv.
Try a pip uninstall on virtualenv and then reinstall again with pip, see if it puts it in the right location.

Categories