-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileNotFound Error when importing splat.Splat #147
Comments
same issue here at 2021 lol!!! How did you solve it? |
Sorry for the not-quite-one-year response ;) It looks like you may have imported splat from pip (i.e., pip splat install); unfortunately that version won't work because pip won't store the accessory data - catalog of spectra. Hence it's not finding that file. Try installing directly from github (which is also more up to date) and see if that resolves the issue. Alternately (and possibly additionally!) it looks like you haven't set the SPLAT_PATH, so it's looking in your home directory for the splat code (the "./" in the './/splat/db/source_data.txt' in the last line). You want to set that as an environment variable; see http://pono.ucsd.edu/~adam/browndwarfs/splat/installation.html, and if that doesn't make sense (or fix the problem), let me know. |
I found a way to solve that and make it work!! It is a relative path and absolute path problem, at least for mine. Here's what I searched that helped me: |
Sadly I can't use gitclone because I'm in China and the downloading will be interruped (its too slow and stops automatically) |
I am trying to import splat and am having some issues
I currently have from splat.SPLAT import SPLAT and I am receiving this error
importing SPLAT...
Traceback (most recent call last):
File "blather.py", line 2, in
from splat.SPLAT import SPLAT # splat is 'SPLAT-library' in PyPI
File "/usr/local/lib/python3.7/site-packages/splat/init.py", line 7, in
from .core import *
File "/usr/local/lib/python3.7/site-packages/splat/core.py", line 67, in
DB_SOURCES = ascii.read(SPLAT_PATH+DB_FOLDER+DB_SOURCES_FILE)
File "/usr/local/lib/python3.7/site-packages/astropy/io/ascii/ui.py", line 373, in read
dat = _guess(table, new_kwargs, format, fast_reader)
File "/usr/local/lib/python3.7/site-packages/astropy/io/ascii/ui.py", line 530, in _guess
dat = reader.read(table)
File "/usr/local/lib/python3.7/site-packages/astropy/io/ascii/core.py", line 1154, in read
self.lines = self.inputter.get_lines(table)
File "/usr/local/lib/python3.7/site-packages/astropy/io/ascii/core.py", line 303, in get_lines
encoding=self.encoding) as fileobj:
File "/usr/local/lib/python3.7/contextlib.py", line 112, in enter
return next(self.gen)
File "/usr/local/lib/python3.7/site-packages/astropy/utils/data.py", line 192, in get_readable_fileobj
fileobj = io.FileIO(name_or_obj, 'r')
FileNotFoundError: [Errno 2] No such file or directory: './/splat/db/source_data.txt'
I can confirm that source_data.txt exists
The text was updated successfully, but these errors were encountered: