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.
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.
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.
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 ...
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With