aburgasser / splat

SpeX Prism Spectral Analysis Toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileNotFoundError: [Errno 2] No such file or directory: splat-2023.5.27-py3.11.egg\\db\\source_data.txt

rodriguezvaniac opened this issue · comments

Hello,

I have tried to install splat on Windows, using the anaconda software, where I created an environment in python 3.11.4.

Using conda and pip I installed what was necessary indicated on the splat website.

Download splat directly by creating splat-main in my Documents. Within splat-main I ran "python setup.py install" but I had the error of not finding the sphinx module, so I used "conda install sphinx" and then I was able to install splat.

The problem is that when calling splat in my jupyter notebook in the same anaconda environment, I get an error:

import splat


FileNotFoundError Traceback (most recent call last)
Cell In[3], line 1
----> 1 import splat

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\splat-2023.5.27-py3.11.egg\splat_init_.py:7
1 """
2 This subpackage contains modules and packages for running the SPLAT code
3 """
5 from future import absolute_import, division, print_function, unicode_literals
----> 7 from .core import *
8 from .initialize import *
9 from .utilities import *

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\splat-2023.5.27-py3.11.egg\splat\core.py:57
51 STDS_INTG_SPEX = {}
53 # databases - using the .txt files for now, will need to change to SQL at a future date
54 # these are now done using pandas
55 #DB_SOURCES = ascii.read(SPLAT_PATH+DB_FOLDER+DB_SOURCES_FILE)
56 #DB_SPECTRA = ascii.read(SPLAT_PATH+DB_FOLDER+DB_SPECTRA_FILE)
---> 57 DB_SOURCES = pandas.read_csv(os.path.normpath(SPLAT_PATH+DB_FOLDER+DB_SOURCES_FILE),delimiter='\t')
58 DB_SPECTRA = pandas.read_csv(os.path.normpath(SPLAT_PATH+DB_FOLDER+DB_SPECTRA_FILE),delimiter='\t')
60 # suppress warnings - probably not an entirely safe approach!

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\pandas\io\parsers\readers.py:912, in read_csv(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)
899 kwds_defaults = _refine_defaults_read(
900 dialect,
901 delimiter,
(...)
908 dtype_backend=dtype_backend,
909 )
910 kwds.update(kwds_defaults)
--> 912 return _read(filepath_or_buffer, kwds)

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\pandas\io\parsers\readers.py:577, in _read(filepath_or_buffer, kwds)
574 _validate_names(kwds.get("names", None))
576 # Create the parser.
--> 577 parser = TextFileReader(filepath_or_buffer, **kwds)
579 if chunksize or iterator:
580 return parser

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\pandas\io\parsers\readers.py:1407, in TextFileReader.init(self, f, engine, **kwds)
1404 self.options["has_index_names"] = kwds["has_index_names"]
1406 self.handles: IOHandles | None = None
-> 1407 self._engine = self._make_engine(f, self.engine)

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\pandas\io\parsers\readers.py:1661, in TextFileReader._make_engine(self, f, engine)
1659 if "b" not in mode:
1660 mode += "b"
-> 1661 self.handles = get_handle(
1662 f,
1663 mode,
1664 encoding=self.options.get("encoding", None),
1665 compression=self.options.get("compression", None),
1666 memory_map=self.options.get("memory_map", False),
1667 is_text=is_text,
1668 errors=self.options.get("encoding_errors", "strict"),
1669 storage_options=self.options.get("storage_options", None),
1670 )
1671 assert self.handles is not None
1672 f = self.handles.handle

File ~\anaconda3\envs\SpectrumPy3114\Lib\site-packages\pandas\io\common.py:859, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
854 elif isinstance(handle, str):
855 # Check whether the filename is to be opened in binary mode.
856 # Binary mode does not support 'encoding' and 'newline'.
857 if ioargs.encoding and "b" not in ioargs.mode:
858 # Encoding
--> 859 handle = open(
860 handle,
861 ioargs.mode,
862 encoding=ioargs.encoding,
863 errors=errors,
864 newline="",
865 )
866 else:
867 # Binary mode
868 handle = open(handle, ioargs.mode)

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\MyUser\anaconda3\envs\SpectrumPy3114\Lib\site-packages\splat-2023.5.27-py3.11.egg\db\source_data.txt'

I checked my docs and splat-2023.5.27-py3.11.egg appears in said location. Also in splat-main there is source_data, just not as source_data.txt

I need your help please,

Best Regards,
Vania Rodríguez

commented

I'm also getting this error since trying to update my version of splat on both Windows and Linux

Hello, were you able to install it correctly?

Unfortunately Windows is often a tough install for SPLAT (mostly due to my lack of a windows machine). if folks have figured out successfully how to do this, please send me a note and I will make sure it is in the README at the front. Meanwhile, I think what will help is to run the install as follows:

python -m setup.py install

this seems to move things into the right places.