Astropy can't download files after changing usernameHow do I change my username?Problem with installing a python moduleckan 500 error, cant find solr, ubuntu 14.04Failed to apply network settings, connect to the Bluetooth network via this machinepip install gives “Command ”python setup.py egg_info“ failed with error code 1”TypeError when running update-manager on ubuntu 17.10How to remove requests from python and install in pip

Famous conjecture or unsolved problem that could be plausibly proven/solved by freshman mathematician?

What is a good way to challenge an Agonizing Blast Warlock?

Best way to clean car carpet?

How do I obtain the debian-installer for Ubuntu Server 18.04.3 LTS?

How many 1/day spells can a Warlock monster cast?

Can dual US-Canadian citizens travel to the US with an expired US passport but valid Canadian passport?

How do I most effectively serve as group treasurer?

Printing Command Line Unicode Chess Board

In Fischer-Petrosian 1971 game 7, why did Fischer give up his good knight for a bad bishop?

Why is it “Cat in the Hat”?

Why was Wouter Basson never charged with crimes against humanity for Project Coast?

Effects of quantum computing on parallel universes

Weird spacing in aligned environment

Fantasy story about a knife that can cut holes to other dimensions

What is the most efficient algorithm to compute polynomial coefficients from its roots?

Did medieval stores have names?

Multiple processes redirecting to the same file with >

Draw circle using characters

Pi to the power y, for small y's

Why did Leia not want to tell Han about Luke being her twin brother?

Everybody knows how to make magical items. What about magical "places"?

Is it unsafe to remove one stud from a load bearing wall?

Is the NOLOCK hint completely safe to use on a table that's guaranteed not to change?

Will a nuclear country use nuclear weapons if attacked by conventional means by another nuclear country?



Astropy can't download files after changing username


How do I change my username?Problem with installing a python moduleckan 500 error, cant find solr, ubuntu 14.04Failed to apply network settings, connect to the Bluetooth network via this machinepip install gives “Command ”python setup.py egg_info“ failed with error code 1”TypeError when running update-manager on ubuntu 17.10How to remove requests from python and install in pip






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2

















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









share|improve this question




























  • If there is no other jill on the system, why not make a symbolic link from /home/jill to /home/jpsotka?

    – Jos
    Jul 16 at 14:04












  • @Jos That worked, thanks!

    – jpsotka
    Jul 16 at 14:22











  • Related: github.com/astropy/astropy/issues/4427

    – Nathaniel M. Beaver
    Jul 18 at 13:22











  • Might work, depending on version? from astropy.utils import data; data.clear_download_cache()

    – Nathaniel M. Beaver
    Jul 18 at 13:31

















2

















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









share|improve this question




























  • If there is no other jill on the system, why not make a symbolic link from /home/jill to /home/jpsotka?

    – Jos
    Jul 16 at 14:04












  • @Jos That worked, thanks!

    – jpsotka
    Jul 16 at 14:22











  • Related: github.com/astropy/astropy/issues/4427

    – Nathaniel M. Beaver
    Jul 18 at 13:22











  • Might work, depending on version? from astropy.utils import data; data.clear_download_cache()

    – Nathaniel M. Beaver
    Jul 18 at 13:31













2












2








2








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









share|improve this question

















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






python username






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited Jul 16 at 14:02









Jos

15.9k5 gold badges46 silver badges57 bronze badges




15.9k5 gold badges46 silver badges57 bronze badges










asked Jul 16 at 13:56









jpsotkajpsotka

132 bronze badges




132 bronze badges















  • If there is no other jill on the system, why not make a symbolic link from /home/jill to /home/jpsotka?

    – Jos
    Jul 16 at 14:04












  • @Jos That worked, thanks!

    – jpsotka
    Jul 16 at 14:22











  • Related: github.com/astropy/astropy/issues/4427

    – Nathaniel M. Beaver
    Jul 18 at 13:22











  • Might work, depending on version? from astropy.utils import data; data.clear_download_cache()

    – Nathaniel M. Beaver
    Jul 18 at 13:31

















  • If there is no other jill on the system, why not make a symbolic link from /home/jill to /home/jpsotka?

    – Jos
    Jul 16 at 14:04












  • @Jos That worked, thanks!

    – jpsotka
    Jul 16 at 14:22











  • Related: github.com/astropy/astropy/issues/4427

    – Nathaniel M. Beaver
    Jul 18 at 13:22











  • Might work, depending on version? from astropy.utils import data; data.clear_download_cache()

    – Nathaniel M. Beaver
    Jul 18 at 13:31
















If there is no other jill on the system, why not make a symbolic link from /home/jill to /home/jpsotka?

– Jos
Jul 16 at 14:04






If there is no other jill on the system, why not make a symbolic link from /home/jill to /home/jpsotka?

– Jos
Jul 16 at 14:04














@Jos That worked, thanks!

– jpsotka
Jul 16 at 14:22





@Jos That worked, thanks!

– jpsotka
Jul 16 at 14:22













Related: github.com/astropy/astropy/issues/4427

– Nathaniel M. Beaver
Jul 18 at 13:22





Related: github.com/astropy/astropy/issues/4427

– Nathaniel M. Beaver
Jul 18 at 13:22













Might work, depending on version? from astropy.utils import data; data.clear_download_cache()

– Nathaniel M. Beaver
Jul 18 at 13:31





Might work, depending on version? from astropy.utils import data; data.clear_download_cache()

– Nathaniel M. Beaver
Jul 18 at 13:31










2 Answers
2






active

oldest

votes


















1


















If you are using
astropy 1.0.10 or later,
this should clear the cache without issue:



#! /usr/bin/env python
from astropy.utils import data
data.clear_download_cache()


Link to documentation:




astropy.utils.data.clear_download_cache(hashorurl=None)


[source]



Clears the data file cache by deleting the local file(s).



Parameters: hashorurl : str or None



If None, the whole cache is cleared. Otherwise, either specifies a hash for
the cached file that is supposed to be deleted, or a URL that should be
removed from the cache if present.




https://docs.astropy.org/en/stable/api/astropy.utils.data.clear_download_cache.html



Link to related bug and pull request:



https://github.com/astropy/astropy/issues/4427



https://github.com/astropy/astropy/pull/4810






share|improve this answer



































    1


















    I know of no way to completely avoid this, i.e. to make Python skip the nonexistant cache. However, there is one simple way to get your programs working again, and that is to make it appear that there is a cache (or whatever resource) in the /home/jill folder. You do this by creating a symbolic link called /home/jill to the (real) /home/jpsotka:



    sudo ln -s /home/jpsotka /home/jill


    That's all. Of course, if there is another user jill on the system, the directory /home/jill will already exist, and so the link can't be created.



    I suppose that after a while, the files in the cache will be completely replaced, and you can remove the link:



    sudo rm /home/jill 


    Notice that this does not remove the folder that the link points to, just the link itself.






    share|improve this answer



























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "89"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1158681%2fastropy-cant-download-files-after-changing-username%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown


























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1


















      If you are using
      astropy 1.0.10 or later,
      this should clear the cache without issue:



      #! /usr/bin/env python
      from astropy.utils import data
      data.clear_download_cache()


      Link to documentation:




      astropy.utils.data.clear_download_cache(hashorurl=None)


      [source]



      Clears the data file cache by deleting the local file(s).



      Parameters: hashorurl : str or None



      If None, the whole cache is cleared. Otherwise, either specifies a hash for
      the cached file that is supposed to be deleted, or a URL that should be
      removed from the cache if present.




      https://docs.astropy.org/en/stable/api/astropy.utils.data.clear_download_cache.html



      Link to related bug and pull request:



      https://github.com/astropy/astropy/issues/4427



      https://github.com/astropy/astropy/pull/4810






      share|improve this answer
































        1


















        If you are using
        astropy 1.0.10 or later,
        this should clear the cache without issue:



        #! /usr/bin/env python
        from astropy.utils import data
        data.clear_download_cache()


        Link to documentation:




        astropy.utils.data.clear_download_cache(hashorurl=None)


        [source]



        Clears the data file cache by deleting the local file(s).



        Parameters: hashorurl : str or None



        If None, the whole cache is cleared. Otherwise, either specifies a hash for
        the cached file that is supposed to be deleted, or a URL that should be
        removed from the cache if present.




        https://docs.astropy.org/en/stable/api/astropy.utils.data.clear_download_cache.html



        Link to related bug and pull request:



        https://github.com/astropy/astropy/issues/4427



        https://github.com/astropy/astropy/pull/4810






        share|improve this answer






























          1














          1










          1









          If you are using
          astropy 1.0.10 or later,
          this should clear the cache without issue:



          #! /usr/bin/env python
          from astropy.utils import data
          data.clear_download_cache()


          Link to documentation:




          astropy.utils.data.clear_download_cache(hashorurl=None)


          [source]



          Clears the data file cache by deleting the local file(s).



          Parameters: hashorurl : str or None



          If None, the whole cache is cleared. Otherwise, either specifies a hash for
          the cached file that is supposed to be deleted, or a URL that should be
          removed from the cache if present.




          https://docs.astropy.org/en/stable/api/astropy.utils.data.clear_download_cache.html



          Link to related bug and pull request:



          https://github.com/astropy/astropy/issues/4427



          https://github.com/astropy/astropy/pull/4810






          share|improve this answer
















          If you are using
          astropy 1.0.10 or later,
          this should clear the cache without issue:



          #! /usr/bin/env python
          from astropy.utils import data
          data.clear_download_cache()


          Link to documentation:




          astropy.utils.data.clear_download_cache(hashorurl=None)


          [source]



          Clears the data file cache by deleting the local file(s).



          Parameters: hashorurl : str or None



          If None, the whole cache is cleared. Otherwise, either specifies a hash for
          the cached file that is supposed to be deleted, or a URL that should be
          removed from the cache if present.




          https://docs.astropy.org/en/stable/api/astropy.utils.data.clear_download_cache.html



          Link to related bug and pull request:



          https://github.com/astropy/astropy/issues/4427



          https://github.com/astropy/astropy/pull/4810







          share|improve this answer















          share|improve this answer




          share|improve this answer








          edited Jul 18 at 14:05

























          answered Jul 18 at 13:48









          Nathaniel M. BeaverNathaniel M. Beaver

          4403 silver badges13 bronze badges




          4403 silver badges13 bronze badges


























              1


















              I know of no way to completely avoid this, i.e. to make Python skip the nonexistant cache. However, there is one simple way to get your programs working again, and that is to make it appear that there is a cache (or whatever resource) in the /home/jill folder. You do this by creating a symbolic link called /home/jill to the (real) /home/jpsotka:



              sudo ln -s /home/jpsotka /home/jill


              That's all. Of course, if there is another user jill on the system, the directory /home/jill will already exist, and so the link can't be created.



              I suppose that after a while, the files in the cache will be completely replaced, and you can remove the link:



              sudo rm /home/jill 


              Notice that this does not remove the folder that the link points to, just the link itself.






              share|improve this answer






























                1


















                I know of no way to completely avoid this, i.e. to make Python skip the nonexistant cache. However, there is one simple way to get your programs working again, and that is to make it appear that there is a cache (or whatever resource) in the /home/jill folder. You do this by creating a symbolic link called /home/jill to the (real) /home/jpsotka:



                sudo ln -s /home/jpsotka /home/jill


                That's all. Of course, if there is another user jill on the system, the directory /home/jill will already exist, and so the link can't be created.



                I suppose that after a while, the files in the cache will be completely replaced, and you can remove the link:



                sudo rm /home/jill 


                Notice that this does not remove the folder that the link points to, just the link itself.






                share|improve this answer




























                  1














                  1










                  1









                  I know of no way to completely avoid this, i.e. to make Python skip the nonexistant cache. However, there is one simple way to get your programs working again, and that is to make it appear that there is a cache (or whatever resource) in the /home/jill folder. You do this by creating a symbolic link called /home/jill to the (real) /home/jpsotka:



                  sudo ln -s /home/jpsotka /home/jill


                  That's all. Of course, if there is another user jill on the system, the directory /home/jill will already exist, and so the link can't be created.



                  I suppose that after a while, the files in the cache will be completely replaced, and you can remove the link:



                  sudo rm /home/jill 


                  Notice that this does not remove the folder that the link points to, just the link itself.






                  share|improve this answer














                  I know of no way to completely avoid this, i.e. to make Python skip the nonexistant cache. However, there is one simple way to get your programs working again, and that is to make it appear that there is a cache (or whatever resource) in the /home/jill folder. You do this by creating a symbolic link called /home/jill to the (real) /home/jpsotka:



                  sudo ln -s /home/jpsotka /home/jill


                  That's all. Of course, if there is another user jill on the system, the directory /home/jill will already exist, and so the link can't be created.



                  I suppose that after a while, the files in the cache will be completely replaced, and you can remove the link:



                  sudo rm /home/jill 


                  Notice that this does not remove the folder that the link points to, just the link itself.







                  share|improve this answer













                  share|improve this answer




                  share|improve this answer










                  answered Jul 18 at 10:05









                  JosJos

                  15.9k5 gold badges46 silver badges57 bronze badges




                  15.9k5 gold badges46 silver badges57 bronze badges































                      draft saved

                      draft discarded















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1158681%2fastropy-cant-download-files-after-changing-username%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown









                      Popular posts from this blog

                      Tamil (spriik) Luke uk diar | Nawigatjuun

                      Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                      Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?