gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

怎么更新

Open liulang915871 opened this issue 1 year ago • 1 comments

liulang915871 avatar Mar 26 '23 15:03 liulang915871

没有涉及config.py更新的话,最简单的可以删掉重新拉取,再替换config.py

ifyz avatar Mar 26 '23 17:03 ifyz

cp config.py config_private.py  # 复制配置文件
git pull --force # 更新代码
# p.s. 更新完之后,config_private.py的读取顺序会比config.py高,所以不需要再把config_private.py的内容写回去

binary-husky avatar Mar 27 '23 02:03 binary-husky

更新后, 代理失效,报错如下: 代理配置 127.0.0.1:7890 , 代理所在地查询超时,代理可能无效 截屏2023-03-27 12 09 51

liulang915871 avatar Mar 27 '23 04:03 liulang915871

@liulang915871 那可能是代理失效了,以下是测试代理的代码,是很简单的:

def check_proxy(proxies):
    import requests
    proxies_https = proxies['https'] if proxies is not None else '无'
    try:
        response = requests.get("https://ipapi.co/json/", proxies=proxies, timeout=4)
        data = response.json()
        print(f'查询代理的地理位置,返回的结果是{data}')
        country = data['country_name']
        result = f"代理配置 {proxies_https}, 代理所在地:{country}"
        print(result)
        return result
    except:
        result = f"代理配置 {proxies_https}, 代理所在地查询超时,代理可能无效"
        print(result)
        return result


if __name__ == '__main__':
    try: from config_private import proxies # 放自己的秘密如API和代理网址 os.path.exists('config_private.py')
    except: from config import proxies
    check_proxy(proxies)

如果是飞机场,有可能是ip太多人共用?

binary-husky avatar Mar 27 '23 05:03 binary-husky

@binary-husky 谢谢您的帮助,终于搞定了。 我不是代理的问题,更新后config.py其实变了,我又将原来的储存为了config_private.py。最后我将所有的都删了,重新安装配置,就成功了。

liulang915871 avatar Mar 27 '23 07:03 liulang915871

更新后, 代理失效,报错如下: 代理配置 127.0.0.1:7890 , 代理所在地查询超时,代理可能无效 截屏2023-03-27 12 09 51

同出现问题,求详细解决步骤 … 感谢

xeeloij avatar Mar 29 '23 03:03 xeeloij