简体   繁体   English

安装包 googleclient 和 fastavro 时遇到问题

[英]Trouble installing packages googleclient and fastavro

I'm trying to write the file names of my GDrive into an Avro-file.我正在尝试将 GDrive 的文件名写入 Avro 文件。

To connect to the GDrive I used these instructions.为了连接到 GDrive,我使用了这些说明。

https://developers.google.com/drive/api/v3/quickstart/pythonhttps://developers.google.com/drive/api/v3/quickstart/python

and for the output I use the writer from fastavro对于 output,我使用来自 fastavro 的编写器

While using the Virtualenv Python 3.8 the googleapiclient works fine, but fastavro can't be installed (See Installation error fastavro ) And while using Conda 3.8 the installation of fastavro works fine, but it doesn't find the googleapiclient (See Doesn't find googleapiclient ).使用 Virtualenv Python 3.8 时,googleapiclient 工作正常,但无法安装 fastavro(请参阅安装错误 fastavro )而使用 Conda 3.8 时安装 fastavro 工作正常,但找不到 googleapiclient(请参阅未找到谷歌API客户端)。

''' '''

from googleapiclient.discovery import build从 googleapiclient.discovery 导入构建

from fastavro import writer来自 fastavro 进口作家

''' '''

I've already updated both interpreters both 3.8.2.我已经更新了两个解释器 3.8.2。

I already Visual Studio but the installation isn't working (the file opens and closes immidiately).我已经使用 Visual Studio,但安装不工作(文件立即打开和关闭)。

My development environment is PyCharm.我的开发环境是PyCharm。

Any help would be highly appreciated.任何帮助将不胜感激。

tl;dr Installing version 0.21.4 of fastavro, separately and first might fix some google package installs. tl;博士分别安装 0.21.4 版的 fastavro,首先可能会修复一些谷歌 package 安装。

I had a related issue, installing a google package (apache-beam[gcp]) for Python3.8 fails due to the fastavro dependency (fastavro<=0.22, >0.21.4), but I found a workaround.我有一个相关的问题,由于fastavro依赖(fastavro <= 0.22,> 0.21.4),为Python3.8安装google package(apache-beam [gcp])失败,但我找到了解决方法。 I'm wondering if the root cause might be the same, so I'll post this here (and hopefully others like me come across it too).我想知道根本原因是否相同,所以我会在这里发布(希望像我这样的其他人也能遇到它)。

After reproducing the issue in both MacOS and an Ubuntu-based Docker image, I tried installing fastavro separately.在 MacOS 和基于 Ubuntu 的 Docker 映像中重现该问题后,我尝试单独安装 fastavro。 The latest version (0.23.2) succeeds, however apache-beam has a dependency version cap at 0.22.最新版本 (0.23.2) 成功,但是 apache-beam 的依赖版本上限为 0.22。 Installing version 0.22.0 failed, and I didn't dig into why that is.安装 0.22.0 版本失败,我没有深入研究为什么会这样。 However, pip3 install fastavro==0.21.4 succeeds, and if you separately install this before apache-beam everything is peachy.但是, pip3 install fastavro==0.21.4成功,如果你在 apache-beam 之前单独安装它,一切都很好。

I found the issue.我发现了这个问题。 To use the google-api-python-client instead of the googleapiclient, I needed to install the google-api-core.要使用 google-api-python-client 而不是 googleapiclient,我需要安装 google-api-core。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM