Importerror:无法导入名称' global_sdk_config'来自' aws_xray_sdk'

发布于 2025-01-31 19:18:43 字数 669 浏览 4 评论 0原文

通过TOX,我试图在本地进行单元测试。该测试似乎失败了,给我以下错误:

    from aws_xray_sdk import global_sdk_config
E   ImportError: cannot import name 'global_sdk_config' from 'aws_xray_sdk' 

​。

​inspection,我看到自己何时创建了虚拟环境(无毒物)并运行PIP install aws-xray-sdk,我还看到 sdk_config.py and version.py 在软件包中aws_sdk_xray中如下所示:

“在此处输入图像说明”

有人可以帮助我。

Through Tox i am trying to run a unit test in my local. The test seems to fail, giving me the following error:

    from aws_xray_sdk import global_sdk_config
E   ImportError: cannot import name 'global_sdk_config' from 'aws_xray_sdk' 

enter image description here

Looking at the package installed in virtaul environment created by tox, i see the following files in aws_sray_sdk :

enter image description here

Upon closer insepection, i see when i had created virtual environment myself (without tox) and run pip install aws-xray-sdk, i also see sdk_config.py
and version.py in package aws_sdk_xray as shown below:

enter image description here

Can someone please help me with this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑白记忆 2025-02-07 19:18:43

在屏幕截图中,您向我们展示了运行Python 3.7环境的Tox,在以下屏幕截图中,您向我们展示了Python 3.6的站点包装。

这些不匹配。

您需要确保检查正确的托克斯环境。

In the screenshot you show us tox running a Python 3.7 environment, and in the following screenshots you show us the site-packages of Python 3.6.

These do not match.

You need to make sure you inspect the correct tox environment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文