python - 如何使用“pipenv”安装“python-firebase”
问题描述
简而言之, 不工作时如何使用 pipenv
安装最新版本的 pip 包?python-firebase
pipenv install python-firebase
完整的细节
为了让 firebase 使用 python 代码,按照 firebase homepage here的官方指导,我使用python-firebase
那里列出的库。
通过运行安装它pipenv install python-firebase
,我的代码导致以下错误。
Traceback (most recent call last):
File "/home/namgivu/code/namgivu/l/gcp/gcp_firebase_start/_.py", line 56, in <module>
from firebase import firebase
File "/home/namgivu/code/namgivu/l/gcp/gcp_firebase_start/.venv/lib/python3.10/site-packages/firebase/__init__.py", line 3
from .async import process_pool
^^^^^
SyntaxError: invalid syntax
解决方案是安装最新版本的 python-firebase,如此处所述,但直接通过 pip 而不是 pipenv
pip install git+https://github.com/ozgur/python-firebase
我用 pipenv inplaceof pip 试过了,但没有用
pipenv install git+https://github.com/ozgur/python-firebase
所以我的问题是在 Pipfile 中放入什么,以便我们可以通过简单的安装命令在我们的 python 代码中准备好 firebase 服务pipenv install
?
解决方案
根据这里的文档pipenv
pipenv install 完全兼容 pip install 语法
所以你可以试试
pipenv install \
git+https://github.com/ozgur/python-firebase@0d79d7609844569ea1cec4ac71cb9038e834c355#egg=python-firebase
正如您所链接的建议所建议的那样。#egg=python-firebase
附加注意事项,因为pipenv
需要#egg
版本控制依赖项的片段。
要回答您的问题,以下是由Pipfile
生成的pipenv
,尽管您应该依靠pipenv
为您生成此文件。
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
python-firebase = {ref = "0d79d7609844569ea1cec4ac71cb9038e834c355", git = "https://github.com/ozgur/python-firebase"}
[dev-packages]
[requires]
python_version = "3.9"
推荐阅读
- specflow - .net 核心中的 SpecFlow+ 配置文件转换替代方案?
- c# - C# .NET Core - 工厂方法与构造函数
- reactjs - 在 Material UI 中使用带有 AppBar 的菜单的正确方法是什么
- c# - asp.net webapp 的 Cron 或计划任务
- python - 有没有办法在jupyter记事本python中使用BeautifulSoup或Selenium从不同网站刮取LinkedIn链接
- mysql - 将 MsSql 存储过程转换为 MySql - WITH 树中的问题
- javascript - 当 Web 应用程序在 IOS 系统中的任何浏览器中运行时,jquery 中的 ajax post 使用 GET 方法而不是 POST 发送请求
- matlab - 有没有办法在matlab中将某些纬度更改为零?
- laravel - Laravel - 从另一个 sql 表中过滤结果
- sql - SQL Server 克隆树表