当通过pip()安装时pip install pipenv
,在zsh shell上找不到该命令pipenv
。
如果通过brew
:安装brew install pipenv
,然后运行pipenv shell
,出现错误
Loading .env environment variables...
Launching subshell in virtual environment...
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2020.11.15/libexec/bin/pipenv", line 8, in <module>
sys.exit(cli())
File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 610, in invoke …
Run Code Online (Sandbox Code Playgroud) 我在pipenv
docker 容器内使用。我尝试安装一个包,发现安装成功(被添加到 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 …
Run Code Online (Sandbox Code Playgroud) 我\xe2\x80\x99m 试图运行我的python 项目,该项目似乎在我的Mac 上运行良好(在pycharm 中最好,不太好,但可以在VSCode 中运行),但在VSCode 中的树莓派上运行得很糟糕。每当我运行 apipenv shell
然后运行 a 时,pipenv install
它都会抱怨以下错误:
Pipfile.lock (e9a11d) out of date, updating to (47943b)...\nLocking [dev-packages] dependencies...\nLocking [packages] dependencies...\nBuilding requirements...\nResolving dependencies...\n\xe2\x9c\x98 Locking Failed! \n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 741, in _main\n[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 709, in resolve_packages\n[ResolutionFailure]: requirements_dir=requirements_dir,\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 692, in resolve\n[ResolutionFailure]: req_dir=requirements_dir\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1403, in resolve_deps\n[ResolutionFailure]: req_dir=req_dir,\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1108, in actually_resolve_deps\n[ResolutionFailure]: resolver.resolve()\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 833, …
Run Code Online (Sandbox Code Playgroud) 我正在运行pipenv install --dev
,这给了我以下错误
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (2df4c1)…
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file or directory
Output:
Failed to load paths: /bin/sh: /Users/XXXX/.local/share/virtualenvs/my-service-enGYxXYk/bin/python: No such file …
Run Code Online (Sandbox Code Playgroud) 该文档“的Pipenv高级用法”,在“指定基本上什么”一节中,介绍了如何包括包装的要求,有条件的操作系统平台,在Pipfile
,如:
pywinusb = {version = "*", sys_platform = "== 'win32'"}
Run Code Online (Sandbox Code Playgroud)
根据平台的不同,当想要为包指定不同的版本或选项时,不清楚该怎么做。
具体来说,我有这个要求:
faust = {version=">=1.10.1", extras=["aiodns", "ciso8601", "cython"]}
Run Code Online (Sandbox Code Playgroud)
我想排除ciso8601
Windows 中的可选附加项。
如果我写
faust = {version=">=1.10.1", extras=["aiodns", "ciso8601", "cython"], platform_system = "!= 'Windows'"}
faust = {version=">=1.10.1", extras=["aiodns", "cython"], platform_system = "== 'Windows'"}
Run Code Online (Sandbox Code Playgroud)
我收到错误: tomlkit.exceptions.KeyAlreadyPresent: Key "faust " already exists.
另外,我想在setup.py
(install_requires
部分) 中做同样的事情。
pipenv lock
工作成功。但是,pipenv install
还是pipenv sync -d
会抛出错误。
File "/Users/kkannar/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pipenv/routines/install.py", line 651, in _cleanup_procs
dep.use_pep517 = True
^^^^^^^^^^^^^^
File "/Users/kkannar/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/common.py", line 18, in __setattr__
raise ValueError(f'"{self.__class__.__name__}" object has no field "{name}"')
ValueError: "Requirement" object has no field "use_pep517"
Run Code Online (Sandbox Code Playgroud)
我尝试将 pyyaml 设置为 6.0.1 或 5.3.1 但没有帮助。
系统详细信息:Apple M1
罗塞塔模式 (i386)
由于某种原因,我在使用最近刚开始使用的 Pipenv 时遇到了问题。似乎每次我尝试从 Pipfile 创建/安装虚拟环境时,pipenv install
我都会收到锁定失败错误,然后是大量输出错误消息。我一直在努力解决这个问题,更新setuptools
和其他各种软件包,试图找到问题所在,但到目前为止我在网上找到的类似问题的解决方案没有运气。
系统规格:2019 iMac Big Sur 11.1
文件:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
fastapi = "*"
fastapi-utils = "*"
uvicorn = {extras = ["standard"], version = "*"}
sqlalchemy = "*"
pytesseract = "*"
pdf2image = "*"
pillow = "*"
cmake = "*"
pandas = "*"
python-multipart = "*"
dataclasses = "*"
psycopg2-binary = "*"
python-dotenv = "*"
pypdf2 = "*"
pipx = "*"
spacy = …
Run Code Online (Sandbox Code Playgroud) 我跑去在当前目录中pipenv install
创建一个Pipfile
没有Pipfile
. 它给出了以下输出,但没有创建Pipfile
. 为什么不?
Installing dependencies from Pipfile.lock (639627)\xe2\x80\xa6\n \xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89\xe2\x96\x89 0/0 \xe2\x80\x94 00:00:00\nTo activate this project's virtualenv, run pipenv shell.\nAlternatively, run a command inside the virtualenv with pipenv run.\n
Run Code Online (Sandbox Code Playgroud)\n看起来像是找到了Pipfile.lock
某个地方并使用了它?(类似git
行为)
我正在使用 python 3.10.6,并且安装了 pipelinev,版本 2022.12.19,我计划使用 runway 运行一个项目,因此为此我创建了一个文件夹,执行了命令,pipenv --python 3.10
然后在 pipfile 中更新以包含 runway、pip文件如下:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
runway = "== 2.6.3"
[dev-packages]
[requires]
python_version = "3.10"
python_full_version = "3.10.6"
Run Code Online (Sandbox Code Playgroud)
然后我运行命令pipenv install
,我期望跑道在那里,但每次我尝试使用跑道运行命令时,我都会收到此错误:
ImportError: cannot import name 'LegacyVersion' from 'packaging.version'
任何想法?