gpt4 book ai didi

python - 删除 Python 用户警告

转载 作者:IT老高 更新时间:2023-10-28 21:36:35 26 4
gpt4 key购买 nike

我刚刚为 Python 2.6 安装了我的 MySQLdb 包,现在当我使用 import MySQLdb 导入它时,会出现用户警告

/usr/lib/python2.6/site-packages/setuptools-0.8-py2.6.egg/pkg_resources.py:1054:
UserWarning: /home/sgpromot/.python-eggs is writable by group/others and vulnerable
to attack when used with get_resource_filename. Consider a more secure location
(set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
warnings.warn(msg, UserWarning)

有什么办法可以解决这个问题吗?

最佳答案

您可以将 ~/.python-eggs 更改为不可被组/每个人写入。我认为这可行:

chmod g-wx,o-wx ~/.python-eggs

关于python - 删除 Python 用户警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17626694/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com