Posts

Showing posts with the label pip

Python package setup: setup.py with customisation to handle wrapped fortran

Image
Clash Royale CLAN TAG #URR8PPP Python package setup: setup.py with customisation to handle wrapped fortran I have a python package i would like to distribute. I have the package set-up and am able to download the tarball, unzip and install it using: python setup.py install which works fine. I would also like to upload the package to PyPi, and enable it to be installed using pip. However, the package contains f2py wrapped fortran, and which needs to be compiled on build with the resulting .so files moved to the eventual installation folder. I am confused as to how to do this using: python3 setup.py sdist followed by: pip3 install pkg_name_here.tar.gz The reason being that when I run python3 setup.py sdist the custom commands are being run, part of which is trying to move the compiled *so files to the installation folder, which has not yet been created. An example of the code outline i have used is in this example here: from setuptools.command.install import install from setuptools.comma...

Tried to update matplotlib; lost it completely

Image
Clash Royale CLAN TAG #URR8PPP Tried to update matplotlib; lost it completely On my Mac OSX machine, I am unable to import mpl_toolkits with python2-7. I thought I would fix this by upgrading matplotib. I tried sudo pip install --U matplotlib It was a no-go with a very long error message that I will show at the end of this question. Then, on a lark, I tried dropping the sudo: pip install --U matplotlib It failed with error Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/kiwisolver.so' Consider using the `--user` option or check the permissions. What the heck? I think. I'll give sudo one more try. It fails with a new error: Found existing installation: six 1.4.1 Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. Now here's real kicker: I can no longer import matplotli...