在运行代码时,Astropy的Modulenotfound错误
我正在尝试在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论