0

I tried to set Python path in .zshrc and save it. But after saving it, the terminal is not working anymore.

For all commands giving command not found and every time, I can see the path file in the terminal as I open it.

Please guide how to fix it.

/Users/bulu/.zshrc:export:6: not valid in this context: “/opt/homebrew/opt/[email protected]/libexec/bin:/Users/bulu/.bin:/Users/bulu/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/bulu/Library/Android/sdk/platform-tools”
bulu@Bulu-MacBook-Pro ~ % clear

enter image description here

1
  • From the error message, it looks like there's a problem with an export command on line 6 of /Users/bulu/.zshrc. Commented Apr 9 at 18:54

1 Answer 1

0

The core problem is shown in the error message:

/Users/bulu/.zshrc:export:6: not valid in this context: …

You should open up your ~/.zshrc in a text editor and look for what is causing the error on line 6 or just delete whatever is on line 6.

Or you should just be able to get your user’s .zshrc regenerated by running this command and restarting your machine:

rm -f ~/.zshrc

Better yet, if you want to play it safe, you can just move the file by running this command and then restart your machine:

mv ~/.zshrc ~/.zshrc.damaged
1
  • Yes, I am able to find out the .zshrc files under Users and after removing that line, it is working now. Thank you so much for the solution everyone. Commented Apr 9 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .