Did you read the docs? ie:
Answer from BPL on Stack OverflowDo I need to install pip? pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.
Installing with get-pip.py To install pip, securely download get-pip.py. [1]:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
If you can install the latest Python (2.7.9 and up) Pip is now bundled with it.
See: https://docs.python.org/2.7//installing/index.html
If not :
Update (from the release notes):
Beginning with v1.5.1, pip does not require setuptools prior to running get-pip.py. Additionally, if setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.
I now run the regular:
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python
Here are the official installation instructions: http://pip.readthedocs.org/en/latest/installing.html#install-pip
EDIT 25-Jul-2013:
Changed URL for setuptools install.
EDIT 10-Feb-2014:
Removed setuptools install (thanks @Ciantic)
EDIT 26-Jun-2014:
Updated URL again (thanks @LarsH)
EDIT 1-Mar-2015:
Pip is now bundled with Python
http://www.pip-installer.org/en/latest/installing.html is really the canonical answer to this question.
Specifically, the systemwide instructions are:
$ curl -O http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py
The section quoted in the question is the virtualenv instructions rather than the systemwide ones. The easy_install instructions have been around for longer, but it isn't necessary to do it that way any more.
» pip install wget
Instead of install wget from python is not something I have heard of before, honestly. Perhaps the wget module you are installing is a python remake or something. Either way, run it as python module with the -m flag:
python(3) -m wget.
Or just install it the way any other person would. I am pretty sure that the link you tried to install it from is not official. The official link, at least for windows, is here. Download the setup package and run it. Then try running wget from cmd.exe (or terminal, choose your windows version). If you are downloading from the website, note your windows version. That might be the reason you couldn't install it from the link you provided. Happy coding!
It looks like you're using Windows. I recommend that you check UnxUtils which, according to themselves, are "native Win32 ports of some GNU utilities", including wget.
Once you download it (from SourceForge, for instance), extract UnxUtils.zip\usr\local\wbin\wget.exe to some folder and add such folder to PATH environment variable (or extract wget.exe to C:\Windows\System32 directly). Then, you should be able to use wget.exe from any new terminal window.
Note that wget is a command-line application, so if you just double-click it, it will mostly just open and close a terminal real quick, informing that you have not provided the necessary arguments.
There is also a nice Python module named wget that is pretty easy to use. Keep in mind that the package has not been updated since 2015 and has not implemented a number of important features, so it may be better to use other methods. It depends entirely on your use case. For simple downloading, this module is the ticket. If you need to do more, there are other solutions out there.
>>> import wget
>>> url = 'http://www.futurecrew.com/skaven/song_files/mp3/razorback.mp3'
>>> filename = wget.download(url)
100% [................................................] 3841532 / 3841532>
>> filename
'razorback.mp3'
Enjoy.
However, if wget doesn't work (I've had trouble with certain PDF files), try this solution.
Edit: You can also use the out parameter to use a custom output directory instead of current working directory.
>>> output_directory = <directory_name>
>>> filename = wget.download(url, out=output_directory)
>>> filename
'razorback.mp3'
urllib.request should work. Just set it up in a while(not done) loop, check if a localfile already exists, if it does send a GET with a RANGE header, specifying how far you got in downloading the localfile. Be sure to use read() to append to the localfile until an error occurs.
This is also potentially a duplicate of Python urllib2 resume download doesn't work when network reconnects
Installing with source
Go to this link: https://bootstrap.pypa.io/get-pip.py
Copy the contents of this file onto another new file and save it as get-pip.py (when it asks you what you want to do with the file, click Save, then copy the contents of the file onto another new file), and open your Windows Command Prompt as an admin and go to the file path and then enter (you need Internet for this) the following command,
python get-pip.py install
For help on installing with different operating systems
Refer to this link: http://www.pip-installer.org/en/latest/installing.html
Installing with an exe file
Click here to get the file, and install it and you need to set a path to the pip directory, you will find a source folder in the C drive and you can find the pip file, then set the folder path.
You can use these binaries to install pip or any other packages of your interest.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
TARGET="https://pypi.python.org/simple/virtualenv/"
PATTERN="virtualenv-15.1.0.tar.gz"
wget --recursive --no-directories --accept=$PATTERN $TARGET
Yes, curl and wget are equivalent for what you're trying.
No, you can download from anywhere. From PyPI, e.g.
There is no functional difference between
pip install virtualenvand what you're trying to do but the former is simpler and less error-prone so why bother with manual labour?
edit: Manual installation and use of setuptools is not the standard process anymore.
If you're running Python 2.7.9+ or Python 3.4+
Congrats, you should already have pip installed. If you do not, read onward.
If you're running a Unix-like System
You can usually install the package for pip through your package manager if your version of Python is older than 2.7.9 or 3.4, or if your system did not include it for whatever reason.
Instructions for some of the more common distros follow.
Installing on Debian (Wheezy and newer) and Ubuntu (Trusty Tahr and newer) for Python 2.x
Run the following command from a terminal:
sudo apt-get install python-pip
Installing on Debian (Wheezy and newer) and Ubuntu (Trusty Tahr and newer) for Python 3.x
Run the following command from a terminal:
sudo apt-get install python3-pip
Note:
On a fresh Debian/Ubuntu install, the package may not be found until you do:
sudo apt-get update
Installing pip on CentOS 7 for Python 2.x
On CentOS 7, you have to install setup tools first, and then use that to install pip, as there is no direct package for it.
sudo yum install python-setuptools
sudo easy_install pip
Installing pip on CentOS 7 for Python 3.x
Assuming you installed Python 3.4 from EPEL, you can install Python 3's setup tools and use it to install pip.
# First command requires you to have enabled EPEL for CentOS7
sudo yum install python34-setuptools
sudo easy_install pip
If your Unix/Linux distro doesn't have it in package repos
Install using the manual way detailed below.
The manual way
If you want to do it the manual way, the now-recommended method is to install using the get-pip.py script from pip's installation instructions.
Install pip
To install pip, securely download
get-pip.pyThen run the following (which may require administrator access):
python get-pip.pyIf
setuptoolsis not already installed,get-pip.pywill install setuptools for you.
I was able to install pip for python 3 on Ubuntu just by running sudo apt-get install python3-pip.