Pipenv: Pipenv take longer and instance hangs up

Created on 12 Jul 2019  ยท  5Comments  ยท  Source: pypa/pipenv

I'm using Pipenv for package management and configured Pipeline from Bitbucket to AWS EC2 instance via CodeDeploy.

While running the script

pipenv install

It takes longer and instance hangs up at

Installing dependencies from Pipfile.lock (a34ea0)โ€ฆ

The instance has to be restarted manually by stop-start to get it back to normal.

This is a weird scenario and Pipenv is not performing well.

Even though there is nothing updated in the package, I had to run the pipenv install script.

  1. Is there any way to optimize this?
  2. Is there any way to check if the hash is outdated and only then run the pipenv install using bash script?
Type

All 5 comments

  1. If the connection is very slow you probably need to use a pypi mirror that is fast on your server.

  2. pipenv install --deploy will first check whether the hash is outdated and abort if so. pipenv sync will do installation only, without checking the hashes.

I tried with --deploy flag but it still wait for installing the libraries even if they are not new.
Is there any faster way to speed up the installation?

The pipenv install is freezing the server and only way is to restart the server. This is really painful.
All memory is consumed by it on a low memory server.

I have AWS t2.micro instance with 1 GB RAM.

@anuj9196 "outdated" means the content of Pipfile doesn't match the Pipfile.lock, it doesn't mean there are some packages to be upgraded.

Did you try the pypi mirror?

@frostming what mirror_url to use?

I run the two commands. one with --deploy and another without it in local development PC with 8 GB RAM

user@pc:~/code/project/app$ time pipenv install
Installing dependencies from Pipfile.lock (1e8942)...
  ๐Ÿ   โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰ 103/103 โ€” 00:00:38
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

real    0m43.039s
user    1m39.556s
sys     0m9.872s

user@pc:~/code/project/pc$ time pipenv install --deploy
Installing dependencies from Pipfile.lock (1e8942)...
  ๐Ÿ   โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰โ–‰ 103/103 โ€” 00:00:28

real    0m31.107s
user    1m40.320s
sys     0m9.540s

The time is almost the same for both commands. There is no effect of adding --deploy

2284

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgjelstrup picture bgjelstrup  ยท  3Comments

AkiraSama picture AkiraSama  ยท  3Comments

fbender picture fbender  ยท  3Comments

jeyraof picture jeyraof  ยท  3Comments

jerzyk picture jerzyk  ยท  3Comments