模块 pytz 已经导入 [英] Module pytz was already imported

查看:19
本文介绍了模块 pytz 已经导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行 Python 代码时不断收到以下错误:

<前>C:Python26libsite-packagespytz\__init__.py:32:用户警告:模块 pytz 已经从C:Python26libsite-packagespytz\__init__.pyc,但是 c:python26libsite-packagespytz-2011h-py2.6.egg正在添加到 sys.path从 pkg_resources 导入 resource_stream

这是什么意思,我该如何解决?

解决方案

您已经将包安装在 pytz 中,同时也作为 .egg 安装.删除 .egg,您将不会收到警告.

但是,请注意,它被称为虚假警告"——这实际上不是问题,尽管如果两者不同,它可能会成为一个问题.

I keep getting the following error while running Python code:

C:Python26libsite-packagespytz\__init__.py:32: 

UserWarning: Module pytz was already imported from 
  C:Python26libsite-packagespytz\__init__.pyc, 
    but c:python26libsite-packagespytz-2011h-py2.6.egg 
      is being added to sys.path

from pkg_resources import resource_stream

What does it mean and how can I solve it?

解决方案

You've got the package installed in pytz and also as a .egg. Remove the .egg and you won't get the warning.

However, note that it's referred to as a "spurious warning" -- this isn't actually a problem, though it could become one if the two were different.

这篇关于模块 pytz 已经导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆