- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 pipenv
在码头容器内。我尝试安装一个包,发现安装成功(被添加到 Pipfile 中),但锁定一直失败。一切都很好,直到昨天。这是错误:
(app) root@7284b7892266:/usr/src/app# pipenv install scrapy-djangoitem
Installing scrapy-djangoitem…
Adding scrapy-djangoitem to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock (6d808e) out of date, updating to (27ac89)…
Locking [dev-packages] dependencies…
Building requirements...
Resolving dependencies...
✘ Locking Failed!
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pipenv/resolver.py", line 807, in <module>
main()
File "/usr/local/lib/python3.7/site-packages/pipenv/resolver.py", line 803, in main
parsed.requirements_dir, parsed.packages, parse_only=parsed.parse_only)
File "/usr/local/lib/python3.7/site-packages/pipenv/resolver.py", line 785, in _main
resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
File "/usr/local/lib/python3.7/site-packages/pipenv/resolver.py", line 758, in resolve_packages
results = clean_results(results, resolver, project)
File "/usr/local/lib/python3.7/site-packages/pipenv/resolver.py", line 634, in clean_results
reverse_deps = project.environment.reverse_dependencies()
File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 376, in environment
self._environment = self.get_environment(allow_global=allow_global)
File "/usr/local/lib/python3.7/site-packages/pipenv/project.py", line 366, in get_environment
environment.extend_dists(pipenv_dist)
File "/usr/local/lib/python3.7/site-packages/pipenv/environment.py", line 127, in extend_dists
extras = self.resolve_dist(dist, self.base_working_set)
File "/usr/local/lib/python3.7/site-packages/pipenv/environment.py", line 122, in resolve_dist
deps |= cls.resolve_dist(dist, working_set)
File "/usr/local/lib/python3.7/site-packages/pipenv/environment.py", line 121, in resolve_dist
dist = working_set.find(req)
File "/root/.local/share/virtualenvs/app-lp47FrbD/lib/python3.7/site-packages/pkg_resources/__init__.py", line 642, in find
raise VersionConflict(dist, req)
pkg_resources.VersionConflict: (importlib-metadata 2.0.0 (/root/.local/share/virtualenvs/app-lp47FrbD/lib/python3.7/site-packages), Requirement.parse('importlib-metadata<2,>=0.12; python_version < "3.8"'))
(app) root@7284b7892266:/usr/src/app#
可能有什么问题?
Pipfile.lock
并尝试安装一个软件包,我得到:
(app) root@ef80787b5c42:/usr/src/app# pipenv install httpx
Installing httpx…
Adding httpx to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Building requirements...
Resolving dependencies...
✔ Success!
Locking [packages] dependencies…
Building requirements...
⠏ Locking...Resolving dependencies...
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 252, in install
site_packages=state.site_packages
File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 2202, in do_install
skip_lock=skip_lock,
File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1303, in do_init
pypi_mirror=pypi_mirror,
File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1113, in do_lock
keep_outdated=keep_outdated
File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 1323, in venv_resolve_deps
c = resolve(cmd, sp)
File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 1136, in resolve
result = c.expect(u"\n", timeout=environments.PIPENV_INSTALL_TIMEOUT)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/delegator.py", line 215, in expect
self.subprocess.expect(pattern=pattern, timeout=timeout)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 344, in expect
timeout, searchwindowsize, async_)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 372, in expect_list
return exp.expect_loop(timeout)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/expect.py", line 181, in expect_loop
return self.timeout(e)
File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/expect.py", line 144, in timeout
raise exc
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f81e99bec90>
searcher: searcher_re:
0: re.compile('\n')
<pexpect.popen_spawn.PopenSpawn object at 0x7f81e99bec90>
searcher: searcher_re:
0: re.compile('\n')
(app) root@ef80787b5c42:/usr/src/app#
最佳答案
这是我的调试笔记。仍然不确定是哪个软件包导致了问题,但这似乎确实可以解决问题。
第一次运行时遇到的错误 pipenv install
使用 pipenv 版本 2020.8.13
.
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/pipenv/cli/command.py", line 252, in install
site_packages=state.site_packages
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1928, in do_install
site_packages=site_packages,
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 580, in ensure_project
pypi_mirror=pypi_mirror,
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 512, in ensure_virtualenv
python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 999, in do_create_virtualenv
project._environment.add_dist("pipenv")
File "/usr/local/lib/python3.6/site-packages/pipenv/environment.py", line 135, in add_dist
self.extend_dists(dist)
File "/usr/local/lib/python3.6/site-packages/pipenv/environment.py", line 127, in extend_dists
extras = self.resolve_dist(dist, self.base_working_set)
File "/usr/local/lib/python3.6/site-packages/pipenv/environment.py", line 122, in resolve_dist
deps |= cls.resolve_dist(dist, working_set)
File "/usr/local/lib/python3.6/site-packages/pipenv/environment.py", line 121, in resolve_dist
dist = working_set.find(req)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 642, in find
raise VersionConflict(dist, req)
pkg_resources.VersionConflict: (importlib-metadata 2.0.0 (/usr/local/lib/python3.6/site-packages), Requirement.parse('importlib-metadata<2,>=0.12; python_version < "3.8"'))
如果您运行
pip install -U pipenv
它似乎改变了
importlib-metadata
版本:
Installing collected packages: importlib-metadata
Attempting uninstall: importlib-metadata
Found existing installation: importlib-metadata 2.0.0
Uninstalling importlib-metadata-2.0.0:
Successfully uninstalled importlib-metadata-2.0.0
Successfully installed importlib-metadata-1.7.0
现在,如果您运行
pipenv install -d --skip-lock
它会完成。似乎图书馆需要一个版本
>= importlib-metadata 2.0
.
pipenv lock
时起初不起作用,但是,如果我删除了锁定文件(
rm Pipenv.lock
),那么当我运行
pipenv lock
时它就起作用了再次。
virtualenv = "==20.0.31"
importlib-metadata = "==1.7.0"
关于python - 如何修复pipenv中的锁定失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64124931/
Pipfile.lock 中的哈希有什么用? 我做什么 我用 pipenv 创建了一个 Pipfile + Pipfile.lock 我将它们复制到一个新位置 我更改哈希值(例如,将第一个字符替换为“
我正在学习Python虚拟环境。在我运行的一个小项目中 pipenv run python myproject.py 它在C:\Users\USERNAME\.virtualenvs中为我创建了一个v
管道: 我在https://realpython.com/pipenv-guide/找到为了将项目转移到开发中,我必须运行 pipenv lock (更新/创建 Pipfile.lock 文件) 根据
我使用的是 pipelinev 版本“2018.7.1”以及 pip 18.0。 我有一个Pipfile并运行pipenv install 。 它失败了: Could not find a versi
我正在使用 Python 3.8.1: $ python -V Python 3.8.1 我已经安装了 pipenv: $ pip list | grep pipenv pipenv
我有一个在 PyCharm 中使用 Pipenv 的 Python 项目,我已将其删除,现在当我尝试在同一位置创建一个新项目时,出现以下错误: Pipenv interpreter has alrea
我正在 VSCode Bash 终端上设置 pipenv 虚拟环境,但没有显示 (pipenv) ,这使它非常困惑。 当我使用Pycharm并让它配置pipenv环境时,它会自动显示(pipenv)在
WARNING: The scripts pipenv and pipenv-resolver are installed in '/Library/Frameworks/Python.framewo
有两个包提供了名为 jsonfield 的模块: django-jsonfield jsonfield 不幸的是,我们有依赖于这两个包的依赖项,这两个包虽然可以互换,但以不同的方式将数据存储到数据库中
鉴于 Pipfile 存在,似乎两者都会从 Pipfile 安装所有依赖项,并更新 Pipfile.lock。那么,有什么区别呢? 最佳答案 pipenv lock 从 Pipfile 生成一组一致的
Pipenv 已安装,我可以运行 $ pipenv --version pipenv, version 2018.11.26 但是,如果在 VSCode 中打开一个包含 Pipfile 的项目文件夹,
我正在使用 pipenv 来管理我的 python 包,在我的存储库中,我有 Pipfile 和 Pipfile.lock 版本。我想在我的实时服务器上安装所有 python 包。我应该使用 pipe
pipenv install命令引用 here . -i, --index Target PyPI-compatible package index url. --pypi-mirror Specif
我是 python 和 pipenv 的新手。当我运行 pipenv lock 时,出现以下错误,我重新安装了 pipenv 并在 google 上搜索错误,但仍然无法修复错误。上次用pipenv打开
如果有人不小心使用 pip install而不是 pipenv install在 pipenv 环境中,该包不会反射(reflect)在 Pipfile 上的包列表中,也不会反射(reflect)在
我正在尝试使用 pipenv 从 Pipfile 安装包,但我一直收到错误,我不知道如何调试。 pip --version pip 18.1 pipenv --version version 2018
我通过 Pharo/GToolkit 的 PythonBridge 使用 Python ,它在底层使用了 pipenv。 事情是通过这个内置的 PythonBridge 脚本 (install_env
所以这个错误发生在我为较新的 Python 3.8.3 卸载 Python 3.7.4 之后。我尝试使用 pipenv install,这是它的输出: PS C:\Users\enoch\Docume
我想在 pipenv 中为面部识别应用程序安装以下软件包。几乎所有这些软件包的安装过程都失败了。 唯一正确安装的软件包是 opencv-python 和 numpy cmake 人脸识别 NumPy
由于某种原因,我在使用最近才开始使用的 Pipenv 时遇到问题。似乎始终如一,每当我尝试使用 pipenv install 从 Pipfile 创建/安装虚拟环境时,我都会收到 Locking Fa
我是一名优秀的程序员,十分优秀!