question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pipenv install times out while creating virtualenv

See original GitHub issue

Running pipenv --three install fails at Creating a virtualenv for this project with the output:

Creating a virtualenv for this project...
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/pexpect/expect.py", line 97, in expect_loop
    return self.timeout()
  File "/usr/lib/python3.4/site-packages/pexpect/expect.py", line 70, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7fe6f4e65f28>
searcher: searcher_re:
    0: EOF

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pipenv", line 9, in <module>
    load_entry_point('pipenv==0.2.8', 'console_scripts', 'pipenv')()
  File "/usr/lib/python3.4/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.4/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/pipenv/cli.py", line 393, in install
    ensure_project(dev=dev, three=three)
  File "/usr/lib/python3.4/site-packages/pipenv/cli.py", line 76, in ensure_project
    ensure_virtualenv(three=three)
  File "/usr/lib/python3.4/site-packages/pipenv/cli.py", line 57, in ensure_virtualenv
    do_create_virtualenv(three=three)
  File "/usr/lib/python3.4/site-packages/pipenv/cli.py", line 166, in do_create_virtualenv
    click.echo(crayons.blue(c.out))
  File "/usr/lib/python3.4/site-packages/delegator.py", line 78, in out
    self.__out = self._pexpect_out
  File "/usr/lib/python3.4/site-packages/delegator.py", line 66, in _pexpect_out
    result += self.subprocess.read().decode('utf-8')
  File "/usr/lib/python3.4/site-packages/pexpect/spawnbase.py", line 413, in read
    self.expect(self.delimiter)
  File "/usr/lib/python3.4/site-packages/pexpect/spawnbase.py", line 321, in expect
    timeout, searchwindowsize, async)
  File "/usr/lib/python3.4/site-packages/pexpect/spawnbase.py", line 345, in expect_list
    return exp.expect_loop(timeout)
  File "/usr/lib/python3.4/site-packages/pexpect/expect.py", line 107, in expect_loop
    return self.timeout(e)
  File "/usr/lib/python3.4/site-packages/pexpect/expect.py", line 70, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7fe6f4e65f28>
searcher: searcher_re:
    0: EOF
<pexpect.popen_spawn.PopenSpawn object at 0x7fe6f4e65f28>
searcher: searcher_re:
    0: EOF

The .venv directory is created and subsequent use of pipenv install [package] work correctly.

Relevant package versions:

delegator.py==0.0.7
pexpect==4.2.1
pipenv==0.2.8
virtualenv==15.1.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:25 (9 by maintainers)

github_iconTop GitHub Comments

10reactions
nuno-andrecommented, May 12, 2018

It would be good to make a reference to PIPENV_TIMEOUT environment variable in that exception.

4reactions
positron96commented, Nov 10, 2019

Got similar problem with timeout. It waited for around 20 minutes, then failed:

positron@ubox:~/Documents$ pipenv install mesa
Creating a virtualenv for this project…
Pipfile: /home/positron/Documents/Pipfile
Using /usr/bin/python3 (3.5.2) to create virtualenv…
⠏ Creating virtual environment...Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/positron/.local/share/virtualenvs/Documents-rjeAWyrt/bin/python3
Also creating executable in /home/positron/.local/share/virtualenvs/Documents-rjeAWyrt/bin/python
Installing setuptools, pip, wheel...
done.

✔ Successfully created virtual environment! 
Virtualenv location: /home/positron/.local/share/virtualenvs/Documents-rjeAWyrt
Creating a Pipfile for this project…
Installing mesa…
Adding mesa to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
⠇ Locking...
⠙ Locking...
⠸ Locking...
Traceback (most recent call last):
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/pexpect/expect.py", line 109, in expect_loop
    return self.timeout()
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/pexpect/expect.py", line 82, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f870d98f1d0>
searcher: searcher_re:
    0: re.compile('\n')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/positron/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/cli/command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/core.py", line 1992, in do_install
    skip_lock=skip_lock,
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/core.py", line 1244, in do_init
    pypi_mirror=pypi_mirror,
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/core.py", line 1068, in do_lock
    lockfile=lockfile
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps
    c = resolve(cmd, sp)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/utils.py", line 517, in resolve
    result = c.expect(u"\n", timeout=environments.PIPENV_INSTALL_TIMEOUT)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/delegator.py", line 215, in expect
    self.subprocess.expect(pattern=pattern, timeout=timeout)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 341, in expect
    timeout, searchwindowsize, async_)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 369, in expect_list
    return exp.expect_loop(timeout)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/pexpect/expect.py", line 119, in expect_loop
    return self.timeout(e)
  File "/home/positron/.local/lib/python3.5/site-packages/pipenv/vendor/pexpect/expect.py", line 82, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f870d98f1d0>
searcher: searcher_re:
    0: re.compile('\n')
<pexpect.popen_spawn.PopenSpawn object at 0x7f870d98f1d0>
searcher: searcher_re:
    0: re.compile('\n')

Pipenv is 2018.11.26 OS is xubuntu 16.04.3 x64

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - pipenv install failing due to timeout
First step is to increasing the TIMEOUT value in: PIPENV_TIMEOUT ... After go to your project to create again your virtualenv
Read more >
pipenv Documentation
Automatically creates a virtualenv in a standard customizable location. • Automatically adds/removes packages to a Pipfile when they are installed or ...
Read more >
Advanced Usage of Pipenv - Python Packaging Authority
This will fail a build if the Pipfile.lock is out–of–date, instead of generating a new one. Or you can install packages exactly as...
Read more >
Common Pipenv Errors and How to Solve Them
Pipenv is essentially pip and virtualenv wrapped together into a single product. When you begin a project with Pipenv, the tool automatically creates...
Read more >
pipenv Documentation
It automatically creates and manages a virtualenv for your projects, ... While pip can install Python packages, Pipenv is recommended as it's a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found