Wednesday, August 24, 2011

Getting error "couldn't load file "/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib" while installing MacPort

Installed MacPorts from the DMG package at http://www.macports.org/install.php
After installing it, when tried to check the port version or install ImageMagick displaying error:

:restaurant ror$ sudo port install ImageMagick
couldn't load file "/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib": dlopen(/opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib, 10): no suitable image found.  Did find:
    /opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib: unknown required load command 0x80000022
    while executing
"load /opt/local/share/macports/Tcl/macports1.0/MacPorts.dylib"
    ("package ifneeded" script)
    invoked from within
"package require macports"
    (file "/opt/local/bin/port" line 38)


Solution to fix this problem:
Installed it from source

tar xjvf MacPorts-2.0.1.tar.bz2
cd MacPorts-2.0.1
./configure && make && sudo make install
sudo port -v selfupdate

Now you can check port version by command:
              port version
which will give you
             Version: 2.0.1

2 comments:

  1. Thank you for this. When I got this error the first thing I did was a google search and found this solution. You saved me $TIME.

    ReplyDelete
  2. Remember to cd /Users/YOURNAME/Downloads (depending on where your MacPorts source file is at) first

    ReplyDelete