I changed my username by following this thread: How do I change my username?
This was a few weeks ago and I have just encountered my first problem, Astropy (for python 2.7) is having trouble downloading files because it is looking in the wrong cache folder. Error message: IOError: [Errno 2] No such file or directory: u'/home/jill/.astropy/cache/download/py2/bf6211066f3d9a9b058d46183baba6ab' . (my old username was jill, and I can see that this file exists in my new home folder).
After debugging line by line, it seems as if the error is coming from the 'Shelve' module. As in, that is where /home/jill is first introduced in the url.
I have tried reinstalling python (sudo apt-get install --reinstall python2.7) and reinstalling astropy (pip2 uninstall astropy, pip2 install astropy).
*Full error message on Pycharm:
File "/home/jpsotka/Dropbox/Colibri/Simulation/corrections.py", line 74, in get_zenith
elginfield_altaz = ecliptic(lat=elat*u.degree, lon=elon*u.degree).transform_to(AltAz(obstime=time, location=elginfield))
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/coordinates/baseframe.py", line 934, in transform_to
return trans(self, new_frame)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/coordinates/transformations.py", line 1314, in __call__
curr_coord = t(curr_coord, curr_toframe)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/coordinates/transformations.py", line 914, in __call__
return supcall(fromcoord, toframe)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/coordinates/builtin_frames/cirs_observed_transforms.py", line 53, in cirs_to_altaz
xp, yp = get_polar_motion(obstime)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/coordinates/builtin_frames/utils.py", line 43, in get_polar_motion
xp, yp, status = iers.IERS_Auto.open().pm_xy(time, return_status=True)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/utils/iers/iers.py", line 600, in open
cls.iers_table = cls.read(file=filename)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/utils/iers/iers.py", line 456, in read
iers_a = Table.read(file, format='cds', readme=readme)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/table/table.py", line 2521, in read
out = io_registry.read(cls, *args, **kwargs)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/io/registry.py", line 531, in read
data = reader(*args, **kwargs)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/io/ascii/connect.py", line 39, in io_read
return read(filename, format=format, **kwargs)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/io/ascii/ui.py", line 353, in read
dat = reader.read(table)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/io/ascii/cds.py", line 322, in read
return super(Cds, self).read(table)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/io/ascii/core.py", line 1159, in read
self.lines = self.inputter.get_lines(table)
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/io/ascii/core.py", line 296, in get_lines
encoding=self.encoding) as fileobj:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/home/jpsotka/.local/lib/python2.7/site-packages/astropy/utils/data.py", line 206, in get_readable_fileobj
fileobj = open(name_or_obj, 'rb')
IOError: [Errno 2] No such file or directory: u'/home/jill/.astropy/cache/download/py2/bf6211066f3d9a9b058d46183baba6ab'
Process finished with exit code 1
jill
on the system, why not make a symbolic link from/home/jill
to/home/jpsotka
? – Jos Jul 16 '19 at 14:04from astropy.utils import data; data.clear_download_cache()
– Nathaniel M. Beaver Jul 18 '19 at 13:31