Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locate MacPorts package?

I just installed the py27-numpy package via MacPorts and python will not find the module when I use this command: import scipy

I used the help('modules') command and the scipy port did not come up.

Clearly the path is not configured correctly or MacPorts is not installing in the correct place, but either way, it would solve my problem to know where this package is being installed.

Where can I find the path to MacPorts-installed package, py27-scipy?

Output of echo $PATH command:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:directory/bin

I cannot find the package in any of those locations.

Thanks for the help.

like image 954
Andrew Avatar asked May 27 '11 01:05

Andrew


People also ask

Where is port installed?

The port is usually placed under your skin about 2 to 3 centimetres below your collar bone. You may feel a round or triangle shaped bump on your skin where the port is.

What is MacPorts user Mac?

Macports is a tool for installing applications and command line tools on your Mac, with a huge library of “ports” (the Macports term for something that can be installed). You use it in Terminal.app like this: $ sudo port install nmap.

How do I install MacPorts on High Sierra?

The easiest way to install MacPorts on a Mac is by downloading the pkg or dmg for Monterey, Big Sur, Catalina, Mojave, High Sierra, Sierra, El Capitan, Yosemite, Mavericks, Mountain Lion, Lion, Snow Leopard, Leopard or Tiger and running the system's Installer by double-clicking on the pkg contained therein, following ...


2 Answers

To find the location of installed components, use the contents subcommand:

port contents py27-numpy

As for getting python to find the package, see @fardjad's response.

like image 157
Jeremy W. Sherman Avatar answered Sep 20 '22 09:09

Jeremy W. Sherman


Your PATH is incorrect. It appears to be picking up another Python 2.7, likely one installed using a binary installer from python.org or elsewhere, and not the MacPorts installed one. Try removing the the /Library/Frameworks/Python.framework/Versions/2.7/bin from PATH or just invoke the MacPorts Python directly:

/opt/local/bin/python2.7
like image 39
Ned Deily Avatar answered Sep 20 '22 09:09

Ned Deily