Troubleshoot using macports

I am new to programming and trying to import scipy.

Problem:

When I try to import scipy in the python interpreter in the terminal, it looks like this:

[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import scipy Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named scipy >>> 

I seem to have installed macports correctly. I can successfully import numpy in the same way as above.

I originally installed scipy according to the "macports" instructions at http://www.scipy.org/install.html

t

 sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose 

I also followed this post: Python will not recognize installed MacPorts packages

but seemed unable to get an answer for himself

To clarify:

When I run "what python" I get

 /usr/bin/python 

When I run the contents of the py27-packagename port, I get

 Port py27-packagename is not installed. 

Thanks in advance

+4
source share
1 answer

MacPorts does not touch system python when installing python modules. He installs these modules for his own version of python, which is by default located in /opt/local/bin/python2.7 . You can make it the default python that will be launched when python entered in your shell using sudo port select --set python python27 .

+12
source

Source: https://habr.com/ru/post/1497535/


All Articles