installation problem

Ryan Schmidt ryandesign at
Mon Jul 13 04:32:38 UTC 2020

Let's keep the discussion on the mailing list so others can benefit. Use the "Reply All" function in your mail reader. More info below.

On Jul 12, 2020, at 22:56, Carlos Yeager wrote:

> On Sun, Jul 12, 2020 at 2:11 PM Ryan Schmidt wrote:
>> On Jul 11, 2020, at 23:46, Carlos Yeager wrote:
>>> Hi, I've carefully read the install instructions on macports page, however I still get "command not found" when I test it out. I have Xcode installed, the version is 11.5 
>>> my purpose of installing macport is to install youtube-dl and I'm new to command line. 
>> Close the Terminal window and open a new one. Type:
>> sudo port install youtube-dl
>> If it installs youtube-dl, you're done.
>> But if it prints "port: command not found", then your shell's PATH variable didn't get set up correctly. The MacPorts pkg installer should have set it up for you, but it cannot anticipate 100% of scenarios so sometimes you have to set it up yourself. Instructions for doing so are here:
>> If you don't know what shell you're using, run this to find out:
>> echo $SHELL
>> What shell you use informs what shell startup file you need to modify.
>> This part of the guide appears not to have been updated for the fact that in macOS Catalina the default shell changed from bash to zsh, so if you are using the zsh shell, the name of the file in your home directory that you want to create or modify is: .zprofile
>> Once you've edited your shell startup file to set PATH, close the Terminal and open a new one.

> When I type echo $SHELL, it say /bin/zsh.
> But I still don't quite get how to "set up shell's PATH variable" or "create, modify the file"
> May I get more detailed steps?

First, let's touch the file .zprofile in your home directory, which will create an empty file if it does not already exist:

touch ~/.zprofile

Now edit that file, using whatever editor you like. For example, if you want to use TextEdit included with macOS, you could run:

open -e ~/.zprofile

If you have BBEdit from Bare Bones Software installed, you might run:

bbedit ~/.zprofile

If you're comfortable using vi, you might run:

vi ~/.zprofile

If you use another editor, consult its documentation to find out how to open files from the command line. Or enable the display of hidden files in macOS and then use the Finder or the Open dialog in any editor to locate and open the file.

Once you have the file open for editing, add the MacPorts paths to the PATH environment variable by adding this line to the end of the file:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Save and close the file, close the terminal window, and open a new one.

More information about the macports-users mailing list