How do you correct Module already loaded UserWarnings in Python?

后端 未结 5 581
星月不相逢
星月不相逢 2021-01-01 16:48

Getting the following kinds of warnings when running most python scripts in the command line:

/Library/Python/2.6/site-packages/virtualenvwrapper/hook_loader         


        
5条回答
  •  借酒劲吻你
    2021-01-01 16:57

    If the warning shows in a program you are modifying, try it this way (examply with pytz):

    try:  
        import pytz  
    except ImportError:  
        from pkg_resources import require  
        require('pytz')  
    

提交回复
热议问题