- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在研究使用 pipenv 和此处的文档
https://pipenv.pypa.io/en/latest/basics/#importing-from-requirements-txt
它说(强调我的)
Note, that when importing a requirements file, they often have versionnumbers pinned, which you likely won’t want
这是为什么?
我知道 Pipfile.lock 文件将存储我安装的依赖项的特定版本和哈希值,但我不想看到 Pipfile 中安装的特定版本吗? (就像我使用 requirements.txt 一样?)
最佳答案
文档对您将版本固定在需求文件中的可能原因颇有意见:它可能来自 pip freeze > requirements.txt
。
当然你会想要在你的 Pipfile
中指定部分或所有版本范围,只是很多人将它们固定在 requirements.txt
中,因为他们使用将其视为一种 Pipfile.lock
,指定甚至不是直接依赖项的包版本。当然,如果您没有遵循这种做法,则不必担心该警告。
这很可能是 Kenneth Reitz(Pipenv 的创建者)自己之前这样做的结果,如他的博客文章 A Better Pip Workflow 中所述.此事他已经在官方问答了repository .
2018 年 6 月更新
该消息过去也被 pipenv
命令打印为警告,但已被替换为
requirements.txt found, instead of Pipfile! Converting…
Warning: Your Pipfile now contains pinned versions, if your requirements.txt did.
We recommend updating your Pipfile to specify the "*" version, instead.
更友好一 pip ,但我认为它仍然在暗示在 Pipfile 上固定版本并不理想,这是不正确的。完全没问题。
关于python - 为什么不应该将版本号固定在 Pipfile 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46452162/
是否有任何解析器可以读取 Pipfile 并返回 Pipfile 中使用的所有包的列表? 如果没有,怎么办?我在想一个正则表达式可以完成这项工作,但我对 Pipfiles 的结构还不够熟悉,无法确认是
在 Python 打包的上下文中,Pipfile/Pipfile.lock 似乎是 requirements.txt 的替代品。但是,关于这些实际工作原理的文档并不多。我在 Python 网站 h
当我尝试构建我的 Dockerfile 时遇到此错误。我该如何解决这个问题? 无法计算缓存键:“/Pipfile.lock”未找到:未找到 # Pull base image FROM python:
当我尝试使用 pip install 终端将包安装到 Django 时,显示包已安装并且我可以看到进度,但 Pipfile 或 Pipfile.lock 中没有显示任何内容。 我遵循的步骤: pip
(我认为[!])我了解pipenv(以及其他venvs)背后的原理并经常使用它们。但是,我从来没有真正理解为什么 pipenv 需要一个 Pipfile 和一个 Pipfile.lock 文件。 Th
可以在 Pipfile 中指定来自自定义 Git 存储库的包。但是我找不到关于如何指定具体分支或用于安装的提交的综合文档。 是否有关于如何在 pipenv 支持的 Pipfile 中为 python
要为 python 项目创建一个 pipenv,我首先创建一个项目文件夹并进入该文件夹以指示 pipenv 创建 Pipfile、Pipfile.lock 和关联的虚拟环境如下所示: $ mkdir
我可以按照说明 here 将我正在处理的源文件安装到可编辑的包目录中. 所以我的 Pipenv 看起来像 [dev-packages] pytest = "*" my-package= {editab
如何执行 Pipfile 中定义的脚本? 遵循找到的语法 here ,我在我的 pipfile 中定义了 scripts 部分,如下所示: [scripts] tests = "bash ./run-
这个问题已经有答案了: Pipfile.lock out of date (10 个回答) 已关闭 4 年前。 尝试将 python 脚本推送到 heroku,它提示我的 pipfile.lock 已
这个问题已经有答案了: Pipfile.lock out of date (10 个回答) 已关闭 4 年前。 尝试将 python 脚本推送到 heroku,它提示我的 pipfile.lock 已
我刚刚启动了一个新的 Django 项目并使用 Postgresql 作为我的数据库,所以我安装了 psycopg2 以使其正常工作。当我一开始部署该项目时,该应用程序无法运行,因为生产服务器上未安装
我正在我正在开发的一个新项目中使用pipenv。最初的 pipenv install 是 Django,Pipfile 显示: [packages] django = "*" 和Pipfile.loc
当我开始克隆一个使用 pipenv 的 git 项目时,问题就出现了,所以它有一个 Pipfile + Pipfile.lock。我想在项目中使用虚拟环境,所以我运行 pipenv shell .我现
我正在研究使用 pipenv 和此处的文档 https://pipenv.pypa.io/en/latest/basics/#importing-from-requirements-txt 它说(强调
我正在尝试将一个大型 django 项目部署到 heroku。我安装了 Heroku CLI,登录,创建了一个应用程序并运行: git push heroku master 我已经设置了 Pipfil
是否可以在 pipfile 中设置自定义部分? 默认情况下,我只看到 [packages]和 [dev-packages] ,但我对某些环境有额外的依赖。所以我想安装packages例如 [tests
我们使用内置的单元测试(或 Django 的包装器)来测试 Python 项目。 在其中一些测试中,我们使用了诸如 freezegun 或 mock 之类的库,这些库并未在生产代码库中的任何地方使用。
我的 Pipfile 看起来像 [[source]] url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" [p
我想切换到 pipenv ,但转换我当前的 requirements.txt 不是 1:1。 requirements.txt 包含: ... lxml==3.8.0 --no-binary :all
我是一名优秀的程序员,十分优秀!