Hi Anton, 

I probably wasn't clear on this, but I was addressing different points, the "old" kwant py2 installation, can't be updated. 

A Mac related thing; if you installed python with brew, it's recommended that you install everything without sudo rights. 

Best, Bas 



On Mon, Aug 10, 2015 at 11:05 AM, Anton Akhmerov <anton.akhmerov@gmail.com> wrote:

Hi Bas,

I don't have a mac, but it appears that you executed the first command
without the superuser permissions. It also tries to modify the python
2.7 installation instead of 3.4, so you're definitely not doing what
you want. Probably replacing pip with pip3 or python with python3
would help (if it's pip that you're using).

As far as the second command goes, did you try following the
suggestion and using the fortran flags option?

Best,
Anton


On Sun, Aug 9, 2015 at 10:44 PM, Bas Nijholt <basnijholt@gmail.com> wrote:
> Hi all,
>
> Upon experimenting with Joe’s python3 version of kwant on OS X I found that
> mumps has a well maintained homebrew formula of its own in the
> homebrew/science tap:
> https://github.com/Homebrew/homebrew-science/blob/master/mumps.rb
>
> I think it might be useful to simplify the kwant installation on OS X.
>
> Also the tinyarray and kwant version are outdated on
> https://github.com/michaelwimmer/homebrew-kwant
>
> Updating tinyarray via pip doesn’t work:
>
> bnijholt:~> pip install tinyarray -U
> Collecting tinyarray
> Installing collected packages: tinyarray
> Found existing installation: tinyarray 1.0.2
> DEPRECATION: Uninstalling a distutils installed project (tinyarray) has
> been deprecated and will be removed in a future version. This is due to the
> fact that uninstalling a distutils project will only partially uninstall the
> project.
> Uninstalling tinyarray-1.0.2:
> Successfully uninstalled tinyarray-1.0.2
> Rolling back uninstall of tinyarray
> Exception:
> Traceback (most recent call last):
> File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line
> 223, in main
> status = self.run(options, args)
> File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py",
> line 299, in run
> root=options.root_path,
> File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line
> 646, in install
> **kwargs
> File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line
> 813, in install
> self.move_wheel_files(self.source_dir, root=root)
> File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line
> 1008, in move_wheel_files
> isolated=self.isolated,
> File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 339, in
> move_wheel_files
> clobber(source, lib_dir, True)
> File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 317, in
> clobber
> shutil.copyfile(srcfile, destfile)
> File
> "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
> line 83, in copyfile
> with open(dst, 'wb') as fdst:
> IOError: [Errno 13] Permission denied:
> '/usr/local/lib/python2.7/site-packages/tinyarray.so'
>
>
>
> Changing the kwant tarball to the 1.0.4 file on the brew formula also
> doesn’t work
> (https://github.com/basnijholt/homebrew-kwant/blob/master/kwant.rb):
>
> bnijholt:~> brew install kwant
> ==> Installing kwant from basnijholt/homebrew-kwant
> ==> Using Homebrew-provided fortran compiler.
> This may be changed by setting the FC environment variable.
> ==> Building with an alternative Fortran compiler
> This is unsupported.
> Warning: No Fortran optimization information was provided. You may want to
> consider
> setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
> `brew install` if your compiler is compatible with GCC.
>
> If you like the default optimization level of your compiler, ignore this
> warning.
> ==> Downloading pypi.python.org/packages/source/k/kwant/kwant-1.0.4.tar.gz
> Already downloaded: /Library/Caches/Homebrew/kwant-1.0.4.tar.gz
> ==> Patching
> patching file build.conf
> ==> python setup.py install --prefix=/usr/local/Cellar/kwant/1.0.4
> Build configuration was:
> User-configured LAPACK and BLAS
> User-configured MUMPS
> **********************************************************************
> error: command 'clang' failed with exit status 1
>
> READ THIS: https://git.io/brew-troubleshooting
> If reporting this issue please do so at (not Homebrew/homebrew):
> https://github.com/basnijholt/homebrew-kwant/issues
>
>
>
> Best Bas
>