Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacPort installed but commands are giving errors

I've been trying to install python via MacPort. It seemed to work initially and there was an icon in my applications for me to click, although for some reason the IDLE would't open. So I thought it may be worth doing another install.

Now, when I try to do anything on MacPort I get error messages. I think this may be something to do with the shell I'm using but I don't really understand what I'm doing with that side of things. When I type in 'port', it does seem to start as following, but then any commands do not correctly work:

Samuels-MacBook-Pro:~ sampeka$ port
MacPorts 2.2.1
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/sampeka] > sudo port install python_27
Error: Unrecognized action "port sudo"
[Users/sampeka] > port
Can't map the URL 'file://.' to a port description file ("Could not find Portfile in /Users/sampeka").
Please verify that the directory and portfile syntax are correct.
To use the current port, you must be in a port's directory.
[Users/sampeka] > port selfupdate
Error: Port selfupdate not found
[Users/sampeka] > selfupdate
--->  Updating MacPorts base sources using rsync
Error: Error synchronizing MacPorts sources: command execution failed
Please run `port -v selfupdate' for details.
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

So a couple of questions:

1) Why does starting a command with 'port' not seem to work (the website I'm following a guide on seems to suggest all commands start with 'port')?

2) Why am I getting error messages?

Thanks very much for your help.

like image 412
Isaac Avatar asked Dec 05 '25 13:12

Isaac


1 Answers

When you run the port command without any arguments it starts in interactive mode (it says so itself: Entering interactive mode...):

$ port

However, the guide you're following is suggesting the non-interactive version of the commands, which means running the port command with added arguments, and which you need to run from your shell prompt (so not from the interactive mode, like you were trying):

$ sudo port install python_27

The sudo ('superuser, do...') is used to run the command with root privileges, which usually is required to install software.

like image 82
robertklep Avatar answered Dec 07 '25 13:12

robertklep