简体   繁体   English

尝试使用 Python 导入 Googleads 时收到错误消息

[英]Receiving Error Message When Attempting to Import Googleads with Python

Attempting to use the googleads adwords api尝试使用 googleads adwords api

from googleads import adwords

and get并得到

ModuleNotFoundError: No module named 'googleads'

I had previous done the我以前做过

python -m pip install google-ads

and am running on a macbook pro我在 macbook pro 上运行

How do I resolve this?我该如何解决这个问题?

Edit编辑

I didn't set up an active virtual environment first, could that be the issue?我没有先设置一个活动的虚拟环境,这可能是问题所在吗? And as an aside, why is that necessary?顺便说一句,为什么这是必要的?

The new version of the Python Library changed the name of the module. Python Library的新版本更改了模块的名称。

https://github.com/googleads/google-ads-python/issues/475 https://github.com/googleads/google-ads-python/issues/475

the module path changed from google_ads to googleads, removing the underscore (_).模块路径从 google_ads 更改为 googleads,删除了下划线 (_)。 For all usage of v10 and onward, you should use import google.ads.googleads对于 v10 及更高版本的所有使用,您应该使用 import google.ads.googleads

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

相关问题 尝试运行/启动 Flask 应用程序时出现 python 导入错误 - python import error when attempting to run / launch Flask application 尝试使用 SQLAlchemy 导入和创建数据库时收到“TypeError” - Receiving 'TypeError' when attempting to import and create a db using SQLAlchemy 使用导入时的Python错误消息 - Python error message when using import 为什么我在尝试使用 Python Flask 时收到“内部服务器错误”? - Why am I receiving 'Internal Server Error' - when attempting to use Python Flask? 为什么我收到错误 404 - 尝试使用 Python Flask 时 - Why am I receiving ERROR 404 - when attempting to use Python Flask 尝试在 Python 中运行 RPY2 并接收错误 0X7e - Attempting to run RPY2 in Python and receiving error 0X7e 在尝试创建窗口时,我一直在Pygame中收到属性错误 - I keep receiving an attribute error in Pygame when attempting to create a window 尝试在 python (Ubuntu 18.04) 中导入 cv2 时收到并导入错误 - I am receiving and import error when trying to import cv2 in python (Ubuntu 18.04) 尝试导入已安装接收错误的 python 模块 - Trying to import a python module that is installed receiving error 尝试使用python-magic识别Windows上的文件类型时获取错误消息 - Getting error message when attempting to use python-magic to identify file types on windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM