17
C:\Users\danie01\fox\test\robotframework>pipenv install --python 3.5
Creating a virtualenv for this project...
Pipfile: C:\Users\danie01\fox\test\robotframework\Pipfile
Using C:\Users\danie01\AppData\Local\Programs\Python\Python35\python.exe (3.5.0) to create virtualenv...
Traceback (most recent call last):
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\expect.py", line 109, in expect_loop
    return self.timeout()
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\expect.py", line 82, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x05020630>
searcher: searcher_re:
    0: EOF

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\danie01\AppData\Local\Programs\Python\Python36-32\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\cli.py", line 435, in install
    selective_upgrade=selective_upgrade,
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\core.py", line 1759, in do_install
    pypi_mirror=pypi_mirror,
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\core.py", line 609, in ensure_project
    three=three, python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\core.py", line 556, in ensure_virtualenv
    do_create_virtualenv(python=python, site_packages=site_packages, pypi_mirror=pypi_mirror)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\core.py", line 934, in do_create_virtualenv
    click.echo(crayons.blue(c.out), err=True)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\delegator.py", line 99, in out
    self.__out = self._pexpect_out
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\delegator.py", line 87, in _pexpect_out
    result += self.subprocess.read()
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\spawnbase.py", line 441, in read
    self.expect(self.delimiter)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\spawnbase.py", line 341, in expect
    timeout, searchwindowsize, async_)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\spawnbase.py", line 369, in expect_list
    return exp.expect_loop(timeout)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\expect.py", line 119, in expect_loop
    return self.timeout(e)
  File "c:\users\danie01\appdata\local\programs\python\python36-32\lib\site-packages\pipenv\vendor\pexpect\expect.py", line 82, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x05020630>
searcher: searcher_re:
    0: EOF
<pexpect.popen_spawn.PopenSpawn object at 0x05020630>
searcher: searcher_re:
    0: EOF

It seems like the issue might be that I want it to install the pipenv with python 3.5, but it's using python 3.6? I have both installed and in PATH. I'm not sure why an installer would be timing out.

I had previously installed a pipenv with 3.6 and removed it with some difficulty (I had to manually delete the virutalenv), so that may be part of the cause.

EDIT:

On a second attempt, it just hangs forever at Using C:\Users\danie01\AppData\Local\Programs\Python\Python35\python.exe (3.5.0) to create virtualenv...

Daniel Paczuski Bak
  • 3,720
  • 8
  • 32
  • 78

7 Answers7

11

pipenv ran a subprocess, and that process took longer than the default 15 minutes, then expect.py was told to wait for a newline but it hit the timeout and here you are. First step is to increasing the TIMEOUT value in:

PIPENV_TIMEOUT 

https://pipenv.readthedocs.io/en/latest/advanced/#configuration-with-environment-variables

PIPENV_INSTALL_TIMEOUT
    Max number of seconds to wait for package installation.
    Defaults to 900 (15 minutes), a very long arbitrary time.

If it's hanging forever, then the question becomes: What was pipenv told to do that results in a block? Use the --verbose flag to tell pipenv to tell you what it's doing that results in a hang.

#try
export PIPENV_INSTALL_TIMEOUT=9000
amucunguzi
  • 1,203
  • 1
  • 12
  • 16
Deron Lee
  • 379
  • 1
  • 3
  • 8
7

This helped me when installing on Raspberry Pi 3B+ on Raspbian.

# if actual install steps fail (installing X/X .. )
# default 900 seconds, 15 minutes, long time
export PIPENV_INSTALL_TIMEOUT=9999

# if creation of virtual env fails (very first step, first time)
# default 120 seconds, 2 minutes, not so long
export PIPENV_TIMEOUT=999

pipenv install requests

See https://pipenv.pypa.io/en/latest/advanced/#configuration-with-environment-variables for full definition of both values.

Eddie
  • 9,696
  • 4
  • 45
  • 58
Jiří Rája
  • 71
  • 1
  • 5
  • 3
    Setting both PIPENV_TIMEOUT and PIPENV_INSTALL_TIMEOUT to 9999 did the trick for me (https://pipenv.readthedocs.io/en/latest/advanced/#configuration-with-environment-variables). – amucunguzi Nov 05 '19 at 09:17
3

On Windows, turning off Windows Defender worked for me. I experienced no timeouts and the installations were much faster.

  • For Windows 10, I searched and opened "Windows Defender", clicked on "Firewall and network protection", a Public network connection was active so I clicked "Public network", then turned "Windows Defender firewall" to off. – talkingtoaj Nov 05 '18 at 09:10
2

Depending on where you're running the pipenv install command, set env variable PIP_NO_CACHE_DIR to off. In my case, I set this in my Dockerfile by having a line ENV PIP_NO_CACHE_DIR=false before RUN pipenv install

HaMi
  • 455
  • 5
  • 13
0

Can you delete your old virtualenv C:\Users\danie01\.virtualenvs

Check the version of python inside Pipfile

[requires]
python_version = "3.5"

After go to your project to create again your virtualenv

cd C:\Users\danie01\fox\test\robotframework
pipenv install
general03
  • 855
  • 1
  • 10
  • 33
0

I was using the url = "https://pypi.tuna.tsinghua.edu.cn/simple", and for each dependence installed, I would have a timeout error. When I changed the url to simple worked.

[[source]]
name = "pypi"
url = "https://pypi.python.org/simple"
verify_ssl = true
Angelo Mendes
  • 905
  • 13
  • 24
0

try doing pipenv --rm - removes virtual environment

then pipenv shell - this will again initiate virtual env

then pipenv install again

worked for me

Safnas
  • 144
  • 1
  • 11