Python: Cannot import package VoigtFit in Jupyter Notebook

Viewed 33

I am running Juptyer Notebook through Anaconda3 and I want to use functions from the package VoigtFit. I have already installed the package successfully, but when I try to import the package:

import VoigtFit

I get this error:

OSError                                   Traceback (most recent call last)
<ipython-input-1-2c3125e579c8> in <module>
----> 1 import VoigtFit

~\anaconda3\lib\site-packages\VoigtFit\__init__.py in <module>
     21 
     22 from VoigtFit.container.components import Component
---> 23 from VoigtFit.container.dataset import DataSet
     24 from VoigtFit.container.lines import Line, show_transitions
     25 from VoigtFit.container.regions import Region

~\anaconda3\lib\site-packages\VoigtFit\container\dataset.py in <module>
     12 from lmfit import Parameters, Minimizer
     13 
---> 14 from VoigtFit.utils import Asplund
     15 from VoigtFit.container.components import Component
     16 from VoigtFit.io.fits_input import load_fits_spectrum, FormatError, MultipleSpectraWarning

~\anaconda3\lib\site-packages\VoigtFit\utils\Asplund.py in <module>
     11 
     12 dt = [('element', 'U2'), ('N', 'f4'), ('N_err', 'f4'), ('N_m', 'f4'), ('N_m_err', 'f4')]
---> 13 data = np.loadtxt(datafile, dtype=dt)
     14 
     15 fname = root_path + '/static/Lodders2009.dat'

~\anaconda3\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, like)
   1063             fname = os_fspath(fname)
   1064         if _is_string_like(fname):
-> 1065             fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
   1066             fencoding = getattr(fh, 'encoding', 'latin1')
   1067             fh = iter(fh)

~\anaconda3\lib\site-packages\numpy\lib\_datasource.py in open(path, mode, destpath, encoding, newline)
    192 
    193     ds = DataSource(destpath)
--> 194     return ds.open(path, mode, encoding=encoding, newline=newline)
    195 
    196 

~\anaconda3\lib\site-packages\numpy\lib\_datasource.py in open(self, path, mode, encoding, newline)
    529                                       encoding=encoding, newline=newline)
    530         else:
--> 531             raise IOError("%s not found." % path)
    532 
    533 

OSError: /static/Asplund2009.dat not found.

I was reading that OSError is a built-in exception in Python which is raised when an os specific system function returns a system-related error, including I/O failures such as “file not found” or “disk full”. I was wondering is it right to believe that I am supposed to download some file named Asplund.dat or if there is something else wrong here?

0 Answers
Related