- Python 3.8 or higher.
- TensorFlow 2 if TensorFlow is used.
The OS X Command Line Tools are required.
These can be be installed with xcode-select --install
.
If you would like to update the Command Line Tools, delete /Library/Developer/CommandLineTools/
and run xcode-select --install
.
Then install gcc
and gfortran
.
Both are provided by brew
's gcc
:
brew install gcc
If you are using Anaconda, make and activate a new Anaconda environment:
conda create -n nameofenvironment python=3.8
conda activate nameofenvironment
Make sure that pip
and related packages are up to date:
pip install --upgrade pip setuptools Cython numpy
If you are not using Anaconda, make and activate a new virtual environment:
pip install virtualenv
virtualenv -p python3 venv
source venv/bin/activate
Finally, install the package:
pip install package
NOTE: It is highly discouraged to use macOS's system python
. If you are not using Anaconda, please use a python
installed with brew
.
Your Conda environment likely links an additional OpenMP, which is not necessary. You might be able to fix this with conda install nomkl
, but obviously that might not be desired.
Install the Python headers.
Replace in the following X
with your minor version number.
sudo apt-get install python3.X-dev
Install gfortran
.
sudo apt-get install gfortran
If you do not have sudo
rights, you can download gfortran
locally and set the environment variables LAB_GFORTRAN
and LAB_LIBGFORTRAN
:
mkdir _cache
for LIB in gfortran-7 libgfortran4;
do
apt-get download $LIB
mv *.deb _cache
dpkg -x _cache/*.deb _cache
rm _cache/*.deb
done
export LAB_GFORTRAN="`pwd`/$(find _cache | grep x86_64-linux-gnu-gfortran-7$)"
export LAB_LIBGFORTRAN="`pwd`/$(find _cache | grep libgfortran.so.4$)"
Finally, install the package.
pip install package
The package is not tested on Windows, although success has been reported with a simple pip install package
in Cygwin.
Should be
upgrade
-- this will make it easier to copy-paste ;)