hatch icon indicating copy to clipboard operation
hatch copied to clipboard

How can I go back to 1.9.x from 1.14 on MacOS?

Open wolfch-elsevier opened this issue 8 months ago • 2 comments

I made a mistake - I tried upgrading from hatch-1.9.x on MacOS to the latest 1.14 - now I'm screwed - now all command line attempts result in:

$ hatch env create hatch-static-analysis
/Users/wolf2/Library/Application Support/pyapp/hatch/3310880318363010370/1.14.0/python/bin/hatch: line 2: /Users/wolf2/Library
Support/pyapp/hatch/3310880318363010370/1.14.0/python/bin/python3.12: No such file or directory
/Users/wolf2/Library/Application Support/pyapp/hatch/3310880318363010370/1.14.0/python/bin/hatch: line 2: exec: /Users/wolf2/Library
Support/pyapp/hatch/3310880318363010370/1.14.0/python/bin/python3.12: cannot execute: No such file or directory

...this may be due to MacOS design choice to have the config base dir include a space character, "Application Support" and not using the UNIX standard XDG Base Directory Spec ...but whatever, ok, I made the mistake, but now I can't seem to roll back the the last known working hatch which was 1.9. I think it's related to pyapp but not certain.

Before I ran the installer for 1.14, I backed up /usr/local/bin/hatch to '/usr/local/bin/hatch-1.9- then after installing release1.14, it was obvious this release can't handle MacOS horrible non-XDG config standard, so I removed the 1.14and put back the1.9' but now I still get the same errors as 1.14 - is there a way to fix this? Thanks

wolfch-elsevier avatar Apr 04 '25 03:04 wolfch-elsevier

I tried :

rm -rf /usr/local/hatch
rm -rf $HOME/Application\ Support/hatch
rm -rf $HOME/Library/Caches/hatch
rm -rf $HOME/Application\ Support/pyapp

Then I reinstalled hatch-1.9, but now when I try to run hatch, it seems like left-overs from hatch-1.14 are still present:

$ hatch env show
bash: /Users/wolf2/Library/Application Support/pyapp/hatch/3310880318363010370/1.14.0/python/bin/hatch: No such file or directory

wolfch-elsevier avatar Apr 04 '25 14:04 wolfch-elsevier

Seems like there maybe a symlink left over even after deleting the install directories. Try running which -a hatch and see what comes up. Pick the first one and do (change the last argument) ls -ltr ~/.local/bin/hatch and see if it is a symlink and what it is pointing to and if it exist. If it doesnt exist, delete it. If you reinstalled it, check the other ones being listed and execute it directly.

I find this video in understanding how PATH works. https://www.youtube.com/watch?v=ZpOoRSkm-dQ

FlavioAmurrioCS avatar Apr 14 '25 02:04 FlavioAmurrioCS