执行python cgi scrip时出现“504网关超时”

2024-09-30 03:24:35 发布

您现在位置:Python中文网/ 问答频道 /正文

以下示例代码:

#!/usr/bin/python3
from astropy.time import Time
from astropy.coordinates import solar_system_ephemeris, EarthLocation, get_body

print('Content-Type:text/html;charset=utf-8\n')

t = Time("2014-09-22 23:22")
loc = EarthLocation.of_site('greenwich') 
with solar_system_ephemeris.set('builtin'):
    jup = get_body('jupiter', t, loc) 
print('<h2>',jup.ra.deg,'</h2>')  

当脚本在本地运行时工作正常(=136.9111620895066)。但是如果我尝试从服务器执行它,就会出现“504网关超时”Nginx错误。你知道吗

也许astropy保存星历表数据的文件有问题?其他astropy、matplotlib等脚本可以在服务器上正常工作。每次脚本需要星历表flles(jpl,esa…)时都会出现错误。你知道吗


Tags: fromimport脚本gettimebodyh2system
1条回答
网友
1楼 · 发布于 2024-09-30 03:24:35

确保您有最新的astropy错误修复版本(v3.2.3,http://docs.astropy.org/en/latest/changelog.html#id153),因为它修复了IERS URL的一个问题,我很可能是您“504网关超时”错误的原因。你知道吗

相关问题 更多 >

    热门问题