-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pipenv install times out while creating virtualenv #65
Comments
interesting, cannot reproduce locally |
@jstutters did you by any chance have any networking problems at the moment that could potentially lead to packages needed for the initial virtualenv to take too long to download. How to reproduce:
@kennethreitz Are you using the default timeout of 30 seconds for pexpect in delegator? Does that make sense in this case? Shouldn't it probably have a very larger timeout to accommodate slow connections or even not have a timeout at all and let the user stop it if he thinks its stuck somewhere? |
I am, but there's no reason creating a virtualenv should take more than 30s. I suspect a setup issue is at hand. |
@jstutters can you time the creation of a new virtualenv by hand? |
@kennethreitz It's on a networked home directory which is certainly a potential source of the slowness (sorry- should have said this in the original report). Execution time for making the virtualenv manually is 49 seconds so I guess a timeout increase would help. I had a look at doing this myself but it didn't seem from the docs that delegator exposes the pexpect timeout argument.
|
Okay, so right off the bat I do think we should leave the timeout by default at 30 seconds, because as @kennethreitz mentioned there's not many cases in which this is not enough time. However, there are use cases when it may be useful (or even necessary). In the If we go take a look at delegator/delegator.py, it makes the call def __init__(self, cmd, timeout=30, maxread=2000, searchwindowsize=None, logfile=None,
cwd=None, codec_errors='strict') So if we're wanting to set a custom timeout for |
I think 30s is reasonable too. |
It would be awesome if there was a fix for this issue. For me creating a virtualenv takes 40 seconds when I have my antivirus running. Disabling it drops the time to 2 seconds and then |
@Randati, can you confirm for me if creating a new environment with the virtualenv command or pew new command takes the same amount of time as pipenv --three? |
Yes, they all take about the same time: |
So I'm a bit confused what it is about the virtualenv creation that's being delayed so drastically by your AV. This feels like more of an issue with virtualenv, but we could implement a "fix" in Delegator.py. That's a separate project of @kennethreitz, so I'm going to tag him in to see if he has thoughts here. Bumping the timeout makes for a worse experience for people with a legitimate failure, but will increase tolerance for cases like this. Given that we've only had two users encounter this though, I'm not sure how common it really is. |
I am having this problem as well, also with a slow network home directory. A way of overriding the default timeout or specifying where the venvs are created would be very useful. It takes around 30s to create the venv normally so it only fails sometimes. A hugely useful script otherwise. Thanks. |
I ran into this problem too. pipenv times out if I have an intensive process running in the backround, but works fine if I kill the background process. Would prefer an option to override the default timeout. |
This happens for me on AWS t2.x instances types, and likely will continue to happen inside containers as well where limitations are exaggerated. While 30s is reasonable, not allowing configuration through something as easy as an env variable is pretty unflexible |
Don't know why it takes so long normally:
|
@kennethreitz and I had previously discussed adding a timeout option, or bumping the timeout on delegator.py. If he still feels that's a good way to go, we can look into a patch for this. |
I am having this problem as well |
I'm experiencing the same issue as well but I solved it. I tried switching wifi networks because the problem is somehow related to the firewall setup. Didn't bother to ask IT as it will take time. |
It was a networking problem for me. VPN was blocking it somehow. Better error message would be handy |
Contributions on better error messages would be welcomed! |
It would be good to make a reference to |
I was on my phone's internet, and when I got back on the good wifi, this error went away. |
This solution solved my problem: #2681 (comment) (i.e. "using |
Got similar problem with timeout. It waited for around 20 minutes, then failed:
Pipenv is 2018.11.26 |
@positron96 I had the same problem with u. Could u tell me how to solve the problem? |
Running
pipenv --three install
fails atCreating a virtualenv for this project
with the output:The .venv directory is created and subsequent use of
pipenv install [package]
work correctly.Relevant package versions:
The text was updated successfully, but these errors were encountered: