I try to install distribute with python 3.3 on Ubuntu 12.04 to install pymongo.
I downloaded distribute_setup.py with
curl -O http://python-distribute.org/distribute_setup.py
Afterwards I tried
python3 distribute_setup.py install
But I recive
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Traceback (most recent call last):
File "distribute_setup.py", line 556, in <module>
sys.exit(main())
File "distribute_setup.py", line 552, in main
tarball = download_setuptools(download_base=options.download_base)
File "distribute_setup.py", line 211, in download_setuptools
src = urlopen(url)
File "/usr/local/lib/python3.3/urllib/request.py", line 156, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.3/urllib/request.py", line 475, in open
response = meth(req, response)
File "/usr/local/lib/python3.3/urllib/request.py", line 587, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.3/urllib/request.py", line 507, in error
result = self._call_chain(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 692, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/local/lib/python3.3/urllib/request.py", line 469, in open
response = self._open(req, data)
File "/usr/local/lib/python3.3/urllib/request.py", line 492, in _open
'unknown_open', req)
File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.3/urllib/request.py", line 1310, in unknown_open
raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>
Can someone please help me? It seems as if distribute uses code, that does not compile with python 3.3..
I installed Python 3.3.2 in my homefolder following these steps:
./configure
make
make test
sudo make install
If I try to install pymongo from source I recive:
Extracting in /tmp/tmpth91z4
Traceback (most recent call last):
File "setup.py", line 22, in <module>
from setuptools import setup, Feature
ImportError: No module named 'setuptools'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dev/pymongo/ez_setup.py", line 130, in use_setuptools
import pkg_resources
ImportError: No module named 'pkg_resources'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 25, in <module>
use_setuptools()
File "/home/dev/pymongo/ez_setup.py", line 132, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/home/dev/pymongo/ez_setup.py", line 111, in _do_download
_build_egg(egg, tarball, to_dir)
File "/home/dev/pymongo/ez_setup.py", line 83, in _build_egg
tar = tarfile.open(tarball)
File "/usr/local/lib/python3.3/tarfile.py", line 1571, in open
raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully
Thank you
Are you sure you installed openssl-devel before compiling Python? I have had the same issue, however I fixed it by previously installing openssl-devel and then compiling Python 3 + distribute.
Related
When I try to run speech_recognition, this happens:
C:\Users\CHERRY\WebOpener>python -m speech_recognition
Traceback (most recent call last):
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__init__.py", line 108, in get_pyaudio
import pyaudio
ModuleNotFoundError: No module named 'pyaudio'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__main__.py", line 4, in <module>
m = sr.Microphone()
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__init__.py", line 79, in __init__
self.pyaudio_module = self.get_pyaudio()
File "C:\Users\CHERRY\WebOpener\venv\lib\site-packages\speech_recognition\__init__.py", line 110, in get_pyaudio
raise AttributeError("Could not find PyAudio; check installation")
AttributeError: Could not find PyAudio; check installation
But when I try to install PyAudio from the pipwin method
pip install pipwin
pipwin install pyaudio
this happens:
C:\Users\CHERRY\WebOpener>pipwin install pyaudio
Package `pyaudio` found in cache
Downloading package . . .
https://download.lfd.uci.edu/pythonlibs/q4trcu4l/PyAudio-0.2.11-cp39-cp39-win_amd64.whl
PyAudio-0.2.11-cp39-cp39-win_amd64.whl
Traceback (most recent call last):
File "C:\Users\CHERRY\WebOpener\venv\Scripts\pipwin-script.py", line 33, in <module>
sys.exit(load_entry_point('pipwin==0.5.1', 'console_scripts', 'pipwin')())
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\command.py", line 103, in main
cache.install(package)
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\pipwin.py", line 300, in install
wheel_file = self.download(requirement)
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\pipwin.py", line 294, in download
return self._download(requirement, dest)
File "c:\users\cherry\webopener\venv\lib\site-packages\pipwin\pipwin.py", line 290, in _download
obj.start()
File "c:\users\cherry\webopener\venv\lib\site-packages\pySmartDL\pySmartDL.py", line 267, in start
urlObj = urllib.request.urlopen(req, timeout=self.timeout, context=self.context)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Users\CHERRY\AppData\Local\Programs\Python\Python39\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
I don't understand. PyAudio used to download from the pipwin method. But it is not downloading. Is there another method for downloading PyAudio?
Thanks.
I had the same problem as you. I used
python -m pipwin install pyaudio
My Case:
I have a isolated server(without internet and python 3.8.2) which as python virtual env at /apps/interface/usr/,
All my wheels are stored in https://my.private.org/
I am using pip 19.2.3 to install the packages.
Now,
I have pacakge named py, which has condition like "setup_requires=["setuptools-scm"]," (dependency).
py package is downloaded from https://my.private.org/
now, while trying to download setuptools-scm, its referring to https://files.pythonhosted.org/packages/... instead of https://my.private.org/
I have tried the below methods to redirect the pip to install wheels from https://my.private.org/ .
Point: The main package is getting installed from my personal repo, But the dependency packages is trying to download from public web which we don't have access to.
Method 1:
pip3.8 install py==1.8.1 --index-url https://user:psw#my.private.org/ --extra-index-url https://user:psw#my.private.org/ -v
Method 2:
updated /apps/interface/usr/lib/python3.8/distutils/distutils.cfg
[easy_install]
find_links = https://user:psw#my.private.org/
index-url = https://user:psw#my.private.org/
but no use.
Method 3:
updated below files (tried with each file)
/etc/xdg/pip/pip.conf
/etc/pip.conf
/root/.pip/pip.conf
/root/.config/pip/pip.conf
/apps/interface/usr/pip.conf
Below is the error I am getting
raise DistutilsError("Download error for %s: %s"
distutils.errors.DistutilsError: Download error for https://files.pythonhosted.org/packages/ad/d3/e54f8b4cde0f6fb4f231629f570c1a33ded18515411dee6df6fe363d976f/setuptools_scm-4.1.2-py2.py3-none-any.whl#sha256=69258e2eeba5f7ce1ed7a5f109519580fa3578250f8e4d6684859f86d1b15826: [Errno 101] Network is unreachable
Hoping to find what is the issue.
Note: Below is Error details
Downloading from URL https://my.private.org/py/py-1.8.1.tar.gz (from https://my.private.org/py/)
|████████████████████████████████| 215kB 74kB/s
Added py==1.8.1 from https://my.private.org/py/py-1.8.1.tar.gz to build tracker '/tmp/pip-req-tracker-gohcv4uc'
Running setup.py (path:/tmp/pip-install-xp37jgnc/py/setup.py) egg_info for package py
Running command python setup.py egg_info
Traceback (most recent call last):
File "/usr/local/lib/python3.8/urllib/request.py", line 1319, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/lib/python3.8/http/client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1004, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 944, in send
self.connect()
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/ssl_support.py", line 173, in connect
sock = socket.create_connection(
File "/usr/local/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/local/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 766, in open_url
return open_with_auth(url, self.opener)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 961, in _socket_timeout
return func(*args, **kwargs)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 1080, in open_with_auth
fp = opener(request)
File "/usr/local/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/local/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/ssl_support.py", line 160, in https_open
return self.do_open(
File "/usr/local/lib/python3.8/urllib/request.py", line 1322, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 101] Network is unreachable>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-xp37jgnc/py/setup.py", line 42, in <module>
main()
File "/tmp/pip-install-xp37jgnc/py/setup.py", line 5, in main
setup(
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/dist.py", line 716, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "/apps/interface/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "/apps/interface/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/apps/interface/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/dist.py", line 786, in fetch_build_egg
return cmd.easy_install(req)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 665, in easy_install
dist = self.package_index.fetch_distribution(
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 655, in fetch_distribution
dist = find(requirement)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 635, in find
loc = self.download(dist.location, tmpdir)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 579, in download
found = self._download_url(scheme.group(1), spec, tmpdir)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 824, in _download_url
return self._attempt_download(url, filename)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 830, in _attempt_download
headers = self._download_to(url, filename)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 729, in _download_to
fp = self.open_url(url)
File "/apps/interface/usr/lib/python3.8/site-packages/setuptools/package_index.py", line 779, in open_url
raise DistutilsError("Download error for %s: %s"
distutils.errors.DistutilsError: Download error for https://files.pythonhosted.org/packages/ad/d3/e54f8b4cde0f6fb4f231629f570c1a33ded18515411dee6df6fe363d976f/setuptools_scm-4.1.2-py2.py3-none-any.whl#sha256=69258e2eeba5f7ce1ed7a5f109519580fa3578250f8e4d6684859f86d1b15826: [Errno 101] Network is unreachable
Cleaning up...
Removing source in /tmp/pip-install-xp37jgnc/py
Removed py==1.8.1 from https://packages.zeomega.org/py/py-1.8.1.tar.gz from build tracker '/tmp/pip-req-tracker-gohcv4uc'
Removed build tracker '/tmp/pip-req-tracker-gohcv4uc'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Finally found the issue,
the easy_install was not honoring index_url configured. Thats main because of the hard coded url in easy_install.py. I changed the url as suggested in below link and its worked fine.
you can find the anwere here
As the title says, I'm trying to install pylint with the below command:
pip install pylint
But I get the below exception:
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2482, in _dep_map
return self.__dep_map
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2344, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python34\lib\site-packages\pip\req.py", line 1265, in prepare_files
req_to_install.extras):
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2508, in _compute_dependencies
parsed = next(parse_requirements(distvers))
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources.py", line 2583, in scan_list
"Expected ',' or end-of-list in",line,"at",line[p:]
ValueError: ("Expected ',' or end-of-list in", 'lazy-object-proxy ==1.4.*', 'at', '*')
Storing debug log for failure in C:\Users\Haiss\pip\pip.log
Anybody have any ideas what's causing it to fail? I have Python 3 installed using Anaconda. I checked the debug log but it doesn't provide any additional details.
try this:
easy_install --upgrade pip
I have a Scrapy spider written in python 3 and I want to run it as a cron job on my cloud Linux server (I have root access)
first, I couldn't install using pip3 install scrapy, I faced :
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/tarfile.py", line 1642, in bz2open
import bz2
File "/usr/local/lib/python3.4/bz2.py", line 20, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ImportError: No module named '_bz2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/site-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python3.4/site-packages/pip/req.py", line 1197, in prepare_files
do_download,
File "/usr/local/lib/python3.4/site-packages/pip/req.py", line 1375, in unpack_url
self.session,
File "/usr/local/lib/python3.4/site-packages/pip/download.py", line 582, in unpack_http_url
unpack_file(temp_location, location, content_type, link)
File "/usr/local/lib/python3.4/site-packages/pip/util.py", line 625, in unpack_file
untar_file(filename, location)
File "/usr/local/lib/python3.4/site-packages/pip/util.py", line 543, in untar_file
tar = tarfile.open(filename, mode)
File "/usr/local/lib/python3.4/tarfile.py", line 1567, in open
return func(name, filemode, fileobj, **kwargs)
File "/usr/local/lib/python3.4/tarfile.py", line 1644, in bz2open
raise CompressionError("bz2 module is not available")
tarfile.CompressionError: bz2 module is not available
then how can I run it as a cron job ?
$ virtualenv virtenv
Overwriting virtenv/lib/python2.7/site.py with new content
New python executable in virtenv/bin/python
Overwriting virtenv/lib/python2.7/distutils/__init__.py with new content
Installing setuptools, pip...
Complete output from command /virtenv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 245, in _get_queued_page
page = self._get_page(location, req)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 335, in _get_page
return HTMLPage.get_page(link, req, cache=self.cache)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 452, in get_page
resp = urlopen(url)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 85, in __call__
response = urllib2.urlopen(self.get_request(url))
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 396, in open
protocol = req.get_type()
File "/usr/lib/python2.7/urllib2.py", line 258, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /usr/lib/python2.7/dist-packages
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 245, in _get_queued_page
page = self._get_page(location, req)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 335, in _get_page
return HTMLPage.get_page(link, req, cache=self.cache)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 452, in get_page
resp = urlopen(url)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 85, in __call__
response = urllib2.urlopen(self.get_request(url))
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 396, in open
protocol = req.get_type()
File "/usr/lib/python2.7/urllib2.py", line 258, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /usr/share/python-virtualenv/
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 245, in _get_queued_page
page = self._get_page(location, req)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 335, in _get_page
return HTMLPage.get_page(link, req, cache=self.cache)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/index.py", line 452, in get_page
resp = urlopen(url)
File "/virtenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 85, in __call__
response = urllib2.urlopen(self.get_request(url))
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 396, in open
protocol = req.get_type()
File "/usr/lib/python2.7/urllib2.py", line 258, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: .
Ignoring indexes: http://pypi.python.org/simple/
Downloading/unpacking distribute
Could not find any downloads that satisfy the requirement distribute
No distributions at all found for distribute
Storing complete log in /home/collin/.pip/pip.log
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 3, in <module>
virtualenv.main()
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 825, in main
symlink=options.symlink)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 993, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 961, in install_wheel
'PIP_NO_INDEX': '1'
File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 903, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /virtenv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1
The version of pip in the existing virtualenv is outdated (version 1.1). upgrade it first:
./virtenv/bin/pip install --upgrade pip
or just delete it:
rm ./virtenv/bin/pip*
rm -r ./virtenv/lib/python*/site-packages/pip*
This seems to work for me:
virtualenv <venv> --no-{pip,wheel,setuptools}
<venv>/bin/pip install -U pip wheel setuptools
Recreating the venv first is necessary because I upgraded my system python from 2.7.3 (debian wheezy) to 2.7.9 (debian jessie), which broke the venv.