'Command Line zsh bad assignment error when setting an Alias

In my mac terminal, I am running the following command and getting the following error.

(base) jgeorge ~ % alias pip = 'python3 -m pip'
>>> zsh: bad assignment

When i try editing my .zshrc file with the same line of code, I get the same error when I refresh my terminal. Not really sure what is going wrong here. I tried changing the alias to a different word but the error persists



Solution 1:[1]

  1. Open the file /Users/me/.zshrc [this is the file where you were trying to add the path for Python]

  2. Look for the line that is missing a '', and add that ''. [most likely it's going to be the line you added with Python], so look there first.

  3. Save your file and exit.

  4. then in your terminal, run this command: source ~/.zshrc this will refresh your .zshrc file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Syscall