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.
pipenv install
using bash script?If the connection is very slow you probably need to use a pypi mirror that is fast on your server.
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