【发布时间】:2016-03-14 01:53:01
【问题描述】:
我安装了一个名为 lts_fits 的模块,这是它的路径:
~/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/lts_fits
所以它显然在站点包文件夹中。在这个文件夹中,有一个 python 脚本:
lts_linefit.py
当我的脚本中有这行代码时:
from lts_fits import lts_linefit
我收到此错误:
ImportError: 没有名为 lts_fits 的模块
怎么样?它显然在那里,我已经用其他随机脚本尝试了相同的语法,它们导入得很好。例如,当我有from sympy import abc 行时,位于文件夹~/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sympy 中的文件abc.py 可以正常导入。可能出了什么问题?
【问题讨论】:
-
如果你有 enthought 发行版,当你得到
ImportError时你有多确定你正在使用 Enthought Python 配置? -
你在
lts_fits中有__init__.py吗?
标签: python importerror lts