Hi recently i installed setup tools module and google app engine gives me errors . Is there a way to uninstall setuptool? can any one tell me step by step because i tried hard
The answer depends on how it was installed.
If it was installed using the ubuntu (debian) package manager, try:
sudo apt-get remove --purge python-setuptools
[updated]
If you installed manually, probably the setuptools final location will be something like (adjust for your environment/python version):
/usr/local/lib/python2.6/dist-packages
Just delete the setuptools stuff there.
Lame, I know, but it is your burden for not using the excellent package manager provided by ubuntu: stick to dpkg unless you need bleeding edge stuff. For other python modules installed by setuptools, it provides no "uninstall" feature (but pip does, that is why there is a lot of enthusiasm around virtualenv, pip and yolk).
[2017 update]
It is 2017 and installing Python modules changed a bit:
pip is now the preferred installer program. Starting with Python 3.4, it is included by default with the Python binary installers.
venv is the standard tool for creating virtual environments (semi-isolated Python environments that allow packages to be installed for use by a particular application, rather than being installed system wide), and has been part of Python since Python 3.3. Starting with Python 3.4, it defaults to installing pip into all created virtual environments.
virtualenv is a third party alternative (and predecessor) to venv and if not official it is still very popular because it allows virtual environments to be used on versions of Python prior to 3.4, which either don’t provide venv at all, or aren’t able to automatically install pip into created environments.
easy_install pip
pip uninstall pip setuptools
(pip and setuptools both use the same package formats, but pip has uninstall support. kinda hilarious that installing something is the easiest way to uninstall.)
I was having trouble with the method below because my pip wasn't up to date.
easy_install pip
pip uninstall pip setuptools
After upgrading pip like this:
sudo -H pip install --upgrade pip
I was able to successfully uninstall setuptools like so:
pip uninstall setuptools
Related
During development I build and push feature branch versions of my package that look like: 1.2.3+mybranch.
So I'll have packages named 1.2.3, 1.2.3+mybranch and 1.2.4+mybranch, and 1.2.4.
The problem is it seems pip has no problem installing a package with a +suffix when doing a regular pip install --upgrade.
I don't want pip to do that.
Is there a way I can have only release versions installed with pip install --upgrade? I would think pip would do this by default.
I found the answer in a comment here: How to correctly create Python feature branch releases in development? (pip and PEP-440)
I just needed to include a proper pre-release version.
So 1.2.3+mybranch should be 1.2.3-dev0+mybranch. Now pip will ignore my feature branch versions by default because it knows they are pre-releases.
I have attempted to install biopython for python2.7 on a cluster of machines.
I have a tonne of scripts that are written in python2.7 and I need to use biopython, but the refactoring of the scripts is more hassle than it is worth - so I thought it would be easier to use an install workaround.
pip install python2 biopython
and
pip install python2.7 biopython
and all variations of these calls do nothing.
They tell me everything is satisfied because there is an installation of biopython for python3.4.
Does anyone know this installation command?
Since version 0.8 you can use the following:
$ pip-2.5 install package
$ pip-2.6 install package
$ pip-2.7 install package
Also see this question: pip: dealing with multiple Python versions?
I have some systemwide packages I've installed and I'm unclear whether I'm supposed to install another copy of them all for Python3 or if there is some way to 'point' Python3 at them. I'm on a Mac.
I still have Python 2.7.9 which has all the packages (most installed with either brew or pip and maybe one or two manually like pyqt). Do I basically have to redo the installation process for every single package again? Or is there some way to simply have Python3 'inherit' everything I've installed so far under 2.7.9?
Also, from what I understand, to install under Python3 with pip I would use pip3 install, is that correct? How would I do the same with ones installed with Homebrew? Is there a brew3 command? Or does Homebrew install to all versions of Python?
You do need to reinstall, but I would step away from systemwide installs in general and start using project-specific package installation.
Use pyenv for version switching and virtualenv for isolated environments.
pyvenv works rather well.
Install Python 3
python -m venv "my_virtual_env"
my_virtual_env\Scripts\activate
pip search lib
pip install ...
You will have to look up what the activate command is for osx. pip is the standard package manager now. You can search, install, and uninstall with pip. Pip is also moving towards wheels when installing packages. You probably don't have to worry about wheels too much though.
I have ubuntu 11.10. I apt-get installed pypy from this launchpad repository: https://launchpad.net/~pypy the computer already has python on it, and python has its own pip. How can I install pip for pypy and how can I use it differently from that of python?
Quoting (with minor changes) from here the pypy website:
If you want to install 3rd party libraries, the most convenient way is
to install pip:
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ ./pypy-2.1/bin/pypy get-pip.py
$ ./pypy-2.1/bin/pip install pygments # for example
In order to use it nicely, you might want to add an alias into e.g. ~/.bashrc:
alias pypy_pip='./pypy-2.1/bin/pip'
Where the actual pip executable is located has to be taken from the output of pypy get-pip.py
To keep a separate installation, you might want to create a virtualenv for PyPy. Within the virtualenv, you can then just run pip install whatever and it will install it for PyPy. When you create a virtualenv, it automatically installs pip for you.
Otherwise, you will need to work out where PyPy will import from and install distribute and pip in one of those locations. pip's installer should do this automatically when run with PyPy. Be careful with this option - if it decides to install in your system Python directories, it could break other things.
if you want to use pip with pypy:
pypy -m pip install [package]
pip is included with pypy so just target pip with the -m flag
The problem with pip installing from the pypy (at least when installing pypy via apt-get) is that it is installed into the system path:
$ whereis pip
pip: /usr/local/bin/pip /usr/bin/pip
So after such install, pypy pip is executed by default (/usr/local/bin/pip) instead of the python pip (/usr/bin/pip) which may break subsequent updates of the whole Ubuntu.
The problem with virtualenv is that you should remember where and what env you created.
Convenient alternative solution is conda (miniconda), which manages not only python deployments: http://conda.pydata.org/miniconda.html.
Comparison of conda, pip and virtualenv:
http://conda.pydata.org/docs/_downloads/conda-pip-virtualenv-translator.html
Seems kinda weird that they'd require a package manager to install a package manager. I'm on Windows BTW.
Pip does require setuptools. Pip is really just a wrapper around setuptools to provide a better installer than easy_install and some nicer installation behaviors, plus uninstall, requirements files, etc. Even if you somehow got pip installed without setuptools it still won't run without it.
You can use Distribute instead of setuptools: it installs a package called setuptools (it's a fork of the latter). You can install Distribute by downloading and running distribute_setup.py.
Update: As Gringo Suave says, the above is obsolete now - distribute and setuptools have now merged, and the merged project is called setuptools.
You can download setuptools package as Windows installer from pypi/setuptools and then install pip or easy_install
Solution for Windows Users
If you installed ActivePython on Windows, then you have pip by default, as well as PyPM (ActiveState's package manager). The following excerpt is from What's included in ActivePython 2.7:
Additional Packages
PyPM: Python Package Manager to download and install binary packages. Also included: virtualenv, Distribute, pip, SQLAlchemy.
Solution for OS X Users
Not sure if setuptools is required when installing pip using homebrew. You might try that.
To install homebrew:
ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
Then to install pip:
brew install pip
Sure, just grab the source from http://pypi.python.org/pypi/pip/0.8.2#downloads
unpack it, cd into it, and run python setup.py install