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

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

问题描述

运行Python代码时出现以下错误:

I keep getting the following error while running Python code:


C:\Python26\lib\site-packages\pytz\__init__.py:32: 

UserWarning: Module pytz was already imported from 
  C:\Python26\lib\site-packages\pytz\__init__.pyc, 
    but c:\python26\lib\site-packages\pytz-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?

推荐答案

你已经在 pytz 中安装了软件包,还有 .egg 。删除 .egg ,您将不会收到警告。

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天全站免登陆