在运行代码时,Astropy的Modulenotfound错误

发布于 2025-01-30 08:28:32 字数 671 浏览 3 评论 0原文

我正在尝试在Spyder中运行一些涉及Astropy的代码。我安装了模块,但仍然说找不到模块:每当我运行它时Astropy。我不知道为什么它会继续返回此错误。这是代码(已修改以保护信息):

import numpy as np
import matplotlib.pyplot as plt 
from astropy.io import ascii
from astropy import table
import astropy.io.fits as pyfits
from astropy.coordinates import SkyCoord
from astropy import units as u
import os
from function_file import *
import emcee
from scipy import stats
from scipy import ndimage
import mpfit
import re
import time
import pyfits
from matplotlib.patches import Ellipse
import corner
import sys
import os
sys.path.append(os.path.abspath('/Users/myname/Desktop/Code/importantfunction.py'))
import importantfunction

I am trying to run some code in Spyder involving astropy. I installed the module, but it still says module not found: astropy whenever I run it. I don't know why it keeps returning this error. Here is the code (modified to protect information):

import numpy as np
import matplotlib.pyplot as plt 
from astropy.io import ascii
from astropy import table
import astropy.io.fits as pyfits
from astropy.coordinates import SkyCoord
from astropy import units as u
import os
from function_file import *
import emcee
from scipy import stats
from scipy import ndimage
import mpfit
import re
import time
import pyfits
from matplotlib.patches import Ellipse
import corner
import sys
import os
sys.path.append(os.path.abspath('/Users/myname/Desktop/Code/importantfunction.py'))
import importantfunction

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文