【问题标题】:Pandas tests fail with "No module named discovery"Pandas 测试因“没有名为发现的模块”而失败
【发布时间】:2013-10-19 19:01:03
【问题描述】:

我正在尝试为 Pandas 项目贡献一些代码。当我在我的测试文件上运行鼻子测试时,我收到了这个错误:

import apiclient.discovery as gapi
ImportError: No module named discovery

我的测试代码是这样的:

import unittest
from pandas.io.ga import GAnalytics

class TestGoogleSegments(unittest.TestCase):
def test_v3_segment_query_creation(self):
    GAnalytics.format_query()
    assert False

我还看到在 io 模块中的其他测试上运行鼻子测试会导致许多跳过的测试。我假设这是由同样的问题引起的。

我在 iPython 中运行时遇到了同样的问题。

我怎样才能让它运行?

【问题讨论】:

    标签: python google-analytics pandas


    【解决方案1】:

    您正在使用较旧的 google API 库

    尝试手动删除所有 google API 安装(您可能需要 root 权限)

    然后重新安装apiclient

    【讨论】:

    • 谢谢!如何找到旧的安装?
    • 如果你在 linux 上,类似:/usr/local/lib/python2.7/site-packages/
    猜你喜欢
    • 2014-08-06
    • 2017-08-01
    • 1970-01-01
    • 2019-11-27
    • 1970-01-01
    • 2020-07-04
    • 2021-12-26
    • 2018-06-29
    • 2020-05-07
    相关资源
    最近更新 更多