python - docker环境下pipenv sync和pipenv install --system --ignore-pipfile

标签 python docker pip pipenv

根据 pipenv official documentation :

sync

pipenv sync [OPTIONS]

Installs all packages specified in Pipfile.lock.

install

pipenv install [OPTIONS] [PACKAGES]...

Installs provided packages and adds them to Pipfile, or (if no packages are given), installs all packages from Pipfile.

--ignore-pipfile Ignore Pipfile when installing, using the Pipfile.lock.

可以安全地假设 pipenv syncpipenv install --ignore-pipfile 是相同的,没有任何隐藏的缺 pip 吗​​?

更多背景:我使用 --system 标志将 python 包安装到系统,因为我不关心 docker 容器中的隔离环境。但是 --system 标志对于 pipenv sync 不可用(参见 github issue ),所以我认为 pipenv install --system --ignore-pipfile 可能是一个可行的 hack。

最佳答案

可以看到Advanced usage of pipenv中的注释

pipenv install --ignore-pipfile is nearly equivalent to pipenv sync, but pipenv sync will never attempt to re-lock your dependencies as it is considered an atomic operation. pipenv install by default does attempt to re-lock unless using the --deploy flag.

所以也许 pipenv install --ignore-pipfile --deploy 等于 pipenv sync

关于python - docker环境下pipenv sync和pipenv install --system --ignore-pipfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52922688/

相关文章:

python - 关于 python 日志记录中的 NOTSET

python - 如何使用数组输入调用 python scipy quad

docker compose容器无法访问互联网

docker - GitLab Runner Docker Executor 中的缓存层 - Long Time DinD Container

pip - 为什么 "pip help"没有列出 --upgrade?

python - 如何使用 Boto3 按上次修改日期过滤 s3 对象

Python tryexcept 用于用 "-"进行分割

linux - 如何设置在 Docker 容器中运行的文件夹内存限制

python - 安装和使用无法通过 pip 或 tarball 发行版获得的 python 库的最佳实践

python - 更改pip和pip3的路径