installing scipy on mac 10.6.8 - macos

I try to install scipy on my mac 10.6.8 but always have problem with it. I've installed ipython (sudo /usr/bin/easy_install-2.6 ipython) and numpy (python setup.py build/install), but when I installed scipy by the same way, I got always this error message:
RuntimeError: Running cythonize failed!
Could someone tell me how to solve this problem?

Have you tried using the binaries provided for OSX? That should ensure everything works.
EDIT
The easiest way I've found to keep package dependencies under control is to use MacPorts as much as possible because unlike Homebrew, the packages are designed to work together and dependencies are (almost always) automagically installed when you try to install something.
So, first, install MacPorts using the installer for Snow Leopard. Choose the option to install ports in a unique directory like /opt/local, so they don't conflict with whatever built-in versions the OS depends on. Also, ensure that /opt/local/bin and /opt/local/sbin are added to your $PATH before the system directories like /usr/bin, /bin, /sbin etc. so that when you run python from the command prompt you get the version you want. Your ~/.profile should have something like export PATH="/opt/local/bin:/opt/local/sbin:$PATH as its last line.
After MacPorts has been installed, you may want to restart just for fun to ensure that all of your environment variable are set up properly. Start Terminal.app (or your favorite replacement) and enter which port, which should return /opt/local/bin/port if everything worked correctly. Next, run sudo port selfupdate just to make sure everything is synced properly. Once that is done, we can install python and some modules. port allows you to pass a list of ports to be installed, so a command like sudo port install foo bar baz will install the latest versions of the foo, bar, and baz ports, along with any dependencies they may require, in the correct order. Some ports have binary distributions, and others are compiled as needed, so the first time you run it there may be a lot of dependencies to install. A nice feature of MacPorts is that you can have multiple versions of some packages installed at the same time, and you can switch between them if needed. Also, if port search is giving too many results, the online search engine can help you find what you're looking for.
To get a decent IPython-based Python 2 development environment going, you'll need the following:
python27
py27-ipython
py27-numpy
py27-scipy
py27-matplotlib (if you like drawing pretty pictures, but mainly so you can get pylab)
py27-pandas (DataFrames are your friend!)
and perhaps py27-pyqt4 if you run ipython via the qtconsole option
I'd also install py-pip and py27-distribute so you can install modules on your own if there is no MacPort version.
Finally, if you're a forward-looking person and want to use numpy et al. on Python 3, MacPorts has you covered! There are py32- and py33-based versions of all of the above packages except scipy, which is only py32 for now. However, I was able to install it just fine with pip, although I have a whole bunch of other devel tools on my machine, and I'm running 10.8.2, so YMMV.
Good luck!

Related

macOS Package Managers: Using Nix alongside Homebrew?

I was wondering if there would be any issues with installing Nix and Homebrew on the same system?
I know Homebrew tends to install things all over different directories, but from what I have read, Nix is very clean. If I understand this correctly, Nix installs it's packages all within one single directory.
So if this is the case, could I try running them both side-by-side? I would be careful not to install too many of the same packages from both places in (ie. I wouldn't install grep, htop, or whatever else from both Homebrew and Nix and if I did I would take precautions).
Side-note: This would not be permanent. I am thinking about switching from Homebrew to Nix (just to mix things up a bit), and I wanted to try Nix on my main machine before taking the leap (if at all). I know I could just try Nix on a VM, but I would not get the same experience unless I tried it on my main system. So it would be nice to install it along Homebrew and give it a shot before going through the pains of removing Homebrew and replacing all my Homebrew packages with Nix packages.
Yes, you can install Nix along side Homebrew.
Nix will install all it's packages within /nix/store For example, on my NixOS system vim is currently installed in /nix/store/j6nrk9h1rpxrzmccm0yq520ik625gd1q-vim-8.1.0578
Your shell will choose whether to use a package from Nix or Homebrew, according to how $PATH is set up. For example, if it so happens that the Nix paths are first, then they will take precedence.
Note
A common source of confusion is that install means something different on Nix. When you install a package, such as Python, it becomes part of a Nix environment, and as such can be executed without specifying the full path; Just as you'd expect from any package manager.
However, if you install a package which has, say, Python, as a dependency, Python would get installed, but more likely than not it would not be included in the environment. Hence it can only be executed via the absolute path.
On a related note, due to a similar reason, if you install a library with Nix and then try to compile against it outside of Nix, it will not work; The build tools will not find the library.

Installing gnu plot for macOS High Sierra

How does one install a runnable version of gnu plot in macOS high Sierra?
I am looking for a way to make this work with the GUI, but even just getting the terminal script to run would be a success.
Thanks!
The Brew implementation of gnuplot is not really usable because it no longer supports the necessary terminals (e.g., you can no longer provide --with-aquaterm or --with-x11 during installation).
However, the MacPorts package manager has a usable install for gnuplot (it's safe to have both Brew and MacPorts installed). https://www.macports.org/
After intalling AquaTerm, I used the following to install gnuplot, and all is working as expected:
sudo port install gnuplot +aquaterm
I'm using macOS Mojave 10.14.4.
It's easy enough with homebrew.
First, install Xcode command line tools:
xcode-select --install
Then install homebrew by going to homebrew website and copying and pasting the one-liner installation script. I don't want to paste that line here in case it changes down the line, so get the latest from the homebrew website.
Now you have a full package manager that allows you to find, install, update and delete thousands of packages. So you can easily find gnuplot or anything else with:
brew search gnuplot
Once you have found your package, check the avaiable options with:
brew options gnuplot
Sample Output
--with-aquaterm
Build with AquaTerm support
--with-cairo
Build the Cairo based terminals
--with-qt
Build with qt support
--with-wxmac
Build wxmac support. Need with-cairo to build wxt terminal
--with-x11
Build with x11 support
Now install with some sensible options for graphical plots:
brew install gnuplot --with-qt --with-x11
Always ensure your PATH starts with /usr/local/bin for homebrew since that is where it installs programs. I put the following in $HOME/.profile. And I also set the GNUTERM environment variable:
export PATH=/usr/local/bin:$PATH
export GNUTERM=qt
Now run gnuplot:
gnuplot
Sample Run
Check out many useful packages, a nice new Python not Apple's old v2.7, a nice Linux-compatible sed not Apple's BSD version, a nice grep, a nice find, the brilliant GNU awk, ImageMagick, tmux, GNU Parallel, jhead, Poppler, exiftool, Mosquitto, pdfgrep, pngcrush, ZeroMQ... the list goes on...
#David Atri: gnuplot is not as standalone as you might think. Try to compile it from source and you will see how many options and dependencies it has.The main challenge in MacOSX is to get the PDF drivers running. The fact that you see many things as standalone is the good integration work made by the developers
brew is no longer support options.
You can still do "brew install gnuplot", but it will install with just the terminals that the person who wrote the homebrew formula wanted, not necessarily the ones you want.
Compiling gnuplot from the sources is still a nightmare, so you live with the brew-formula writer's choices, write your own brew formula (not completely trivial), or you struggle with huge pile of dependencies and try to compile from the sources.

Python 3.6 Mac OS X - How do you get PIP install?

In various educational guides, I have been guided to install Python modules with an easy one-line command entered in the terminal: pip install whatever
Well, when I type "pip install" it is not found.
Elsewhere in Stack Overflow the following instructions have been given:
Use apt-get -- but I am not using linux
Use easy-install pip -- but
it also produces command not found.
Use easy-install3 pip -- same problem: command not found.
Does PIP not install when you install Python 3.6?
Do I really have to edit the path myself - it seems to me, if necessary, the developers who created the installer would have done this and the path would have been updated when Python was installed.
Poking around the hidden system folders in OS X, I see that there is an alias called pip3.6 in usr/local/bin that was created a week ago when I installed Python 3.6.
I would try:
pip3.6 install whatever
Right, worked it out now.
Pip is installed when Python 3.6 is installed - but instead of typing "pip install", you type:
pip3.6 install <ModuleYouWant>
I guess this is so people can run Python 2.7 and 3.6 simultaneously.. it'd be nice if it were a little more intuitive though, or there were some instructions, or it just worked as pip gave you the option "2.7 or 3.6?"
For those OS X users in the dark like I was, please note that system files like the usr folder can be seen in Finder if you press Command+Shift+G then in the dialog box that pops up type /usr (There are other ways to see hidden folders too).

IPython3 for Mac OSX

I have Ipython installed but it runs on python 2.7.5 , I also have python 3.3 installed. How can I make changes such that Ipython runs on python 3.3 not 2.7.5?
You need to install pip for Python 3 - it's as easy as going to the pip-installer.org Installation page and following the instructions. Briefly, download get-pip.py and save it someplace, like your Downloads folder. Navigate there in Terminal, and run
sudo python3 get-pip.py
and you should soon have either a pip3 or pip-3.3 command (maybe both, I don't remember). You should now be able to run
sudo pip3 install ipython[all]
and hopefully all the dependencies will be installed as well. If installation chokes, use pip3 to install pyzmq, tornado, pyreadline, jinja2, pygments, and maybe a few others. Make sure you read the docs before you start, so you have an idea of what you're trying to achieve. IPython is large and quite complex, with many moving parts, so in the absence of a package manager (see below) it can take a bit of time before everything is up and running.
The Package Manager Way
There are other options, too. You can install Anaconda, a "Completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing" with over 100 packages, including IPython and its dependencies. By default, the Anaconda installer gives you Python 2.7, but you can use the conda command to install Python 3.
My personal favorite is to install Python 3 and IPython using MacPorts. Yes, it'll install Py3 all over again, but unless you're really starving for disk space (in which case you probably don't want to be installing large packages like IPython) it's no big deal. Using the port command, once the base MacPorts installation has been put in place, you can just run
sudo port install py33-ipython +pyqt4
and all the other dependencies will be taken care of, (hopefully) flawlessly, without your having to do anything else except wait for a long time while things like PyQt are compiled. You may also need to run sudo port install py33-ipython +notebook if you want the notebook, I don't recall if it's installed otherwise. BTW, you do need X11, Xcode, and the Xcode command-line tools for MacPorts, but they would likely be required if you do the first option as not all packages have binaries available for OS X. The excellent documentation walks you through everything, from installation to using the port command to maintaining your system. I would highly recommend modifying your ~/.profile (or ~/.bash_profile, ~/.bashrc, or equivalent for your shell) to add the MacPorts install directories (/opt/local/bin and /opt/local/sbin, by default) to the front of your path. Just add export PATH='/opt/local/bin:/opt/local/sbin:$PATH' to the end of the file.
A third alternative option is to use Homebrew. It's similar to MacPorts, in that the brew command is a type of package manager like port and conda, but in my experience it doesn't have as many packages, and doesn't quite work as seamlessly as port. However, my observations on StackOverflow, Ask Different and other fora seem to indicate that about 50% of people have great experiences with brew and don't like port, while the other half loves port over brew. YMMV.
I hope this helps. Good luck with your installation!

How do I install ack on OS X (10.8.4)?

I am new to OS X and I am unable to figure out how to install ack. The instructions here didn't help, because the command "install" is failing. Please guide me proper commands.
So far, I have downloaded ack 2.04 and placed it in the /usr/bin folder and then ran perl Makefile.PL successfully. The next command install isn't working for me.
If you use Homebrew you can simply do:
$ brew install ack
If you are new to OSX I highly recommend this approach because it makes installation of stuff like this MUCH easier. It is a package manager for OSX.
Homebrew link: http://brew.sh/
You can also use the MacPorts installer for OSX:
sudo port install p5.<nn>-app-ack
where <nn> is the version of your Perl installation (Ack is written in Perl). If you don't know the version of Perl you have installed, just type:
perl --version
and you'll know what you need for the port command. The Ack installation page has the information you need for this. More information about MacPorts can be found here.
Searching the web, you'll find LOTS of opinions about Homebrew versus MacPorts. I've used both; they both work (and both fail occasionally - installation of this kind is complex). You'll need to pick one or the other and stick with it as Homebrew doesn't play nicely with MacPorts (or vice versa, depending on your POV). Overriding choice for me is MacPorts as it has many more packages than Homebrew and it puts its stuff in /opt/local to stay out of the way of other programs. YMMV

Resources