Bug 1420986 - python3 -m virtualenv venv3 failed with error code 2
Summary: python3 -m virtualenv venv3 failed with error code 2
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-10 04:29 UTC by William Moreno
Modified: 2017-02-10 19:36 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-10 19:36:59 UTC
Type: Bug


Attachments (Terms of Use)

Description William Moreno 2017-02-10 04:29:11 UTC
Description of problem:
I got a error creating a virtualenv with python3 -m virtualenv venv3

Version-Release number of selected component (if applicable):
python3-3.5.3-1.fc25.x86_64
python3-tools-3.5.3-1.fc25.x86_64

How reproducible:
Try to create a virtual with python3 -m virtualenv venv3

Steps to Reproduce:
1. python3 -m virtualenv venv3

Actual results:
Fails with a long traceback

Expected results:
Be able to create a virtualenv

Additional info:

Traceback:

python3 -m virtualenv venv3
Using base prefix '/usr'
New python executable in /home/wmoreno/Proyectos/venv3/bin/python3
Also creating executable in /home/wmoreno/Proyectos/venv3/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /home/wmoreno/Proyectos/venv3/bin/python3 - setuptools pip wheel:
  Collecting setuptools
  Using cached setuptools-34.1.1-py2.py3-none-any.whl
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/requests/packages/urllib3/response.py", line 228, in _error_catcher
    yield
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/requests/packages/urllib3/response.py", line 310, in read
    data = self._fp.read(amt)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/cachecontrol/filewrapper.py", line 49, in read
    data = self.__fp.read(amt)
  File "/usr/lib64/python3.5/http/client.py", line 448, in read
    n = self.readinto(b)
  File "/usr/lib64/python3.5/http/client.py", line 488, in readinto
    n = self.fp.readinto(b)
  File "/usr/lib64/python3.5/socket.py", line 576, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib64/python3.5/ssl.py", line 937, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib64/python3.5/ssl.py", line 799, in read
    return self._sslobj.read(len, buffer)
  File "/usr/lib64/python3.5/ssl.py", line 583, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/commands/install.py", line 299, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/req/req_set.py", line 370, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/req/req_set.py", line 587, in _prepare_file
    session=self.session, hashes=hashes)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/download.py", line 810, in unpack_url
    hashes=hashes
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/download.py", line 649, in unpack_http_url
    hashes)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/download.py", line 871, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/download.py", line 595, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/utils/hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/download.py", line 563, in written_chunks
    for chunk in chunks:
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/utils/ui.py", line 139, in iter
    for x in it:
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/download.py", line 552, in resp_read
    decode_content=False):
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/requests/packages/urllib3/response.py", line 353, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/requests/packages/urllib3/response.py", line 320, in read
    flush_decoder = True
  File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python3.5/site-packages/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl/pip/_vendor/requests/packages/urllib3/response.py", line 233, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.5/site-packages/virtualenv.py", line 2327, in <module>
    main()
  File "/usr/lib/python3.5/site-packages/virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "/usr/lib/python3.5/site-packages/virtualenv.py", line 944, in create_environment
    download=download,
  File "/usr/lib/python3.5/site-packages/virtualenv.py", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/lib/python3.5/site-packages/virtualenv.py", line 795, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/wmoreno/Proyectos/venv3/bin/python3 - setuptools pip wheel failed with error code 2

https://paste.fedoraproject.org/552047/48670013

Comment 1 Iryna Shcherbina 2017-02-10 12:35:29 UTC
Hi William,

I am not able to reproduce the error you are facing with virtualenv and it seems network related.

Also consider using venv[0] in favour of virtualenv.

[0] https://docs.python.org/3.5/library/venv.html

Comment 2 Petr Viktorin 2017-02-10 12:40:30 UTC
The difference is that virtualenv downloads pip and its dependencies from PyPI (so it's vulnerable to network issues), while venv installs bundled (or, in Fedora's case, system-installed) copies of these that are already available locally.

Comment 3 William Moreno 2017-02-10 19:36:59 UTC
pyenv works fine, thanks


Note You need to log in before you can comment on or make changes to this bug.