MacOS advanced tips

If your prefer to install the BornAgain python libraries not to the site-packages folder of your Python interpreter, but to some custom folder, you can do this in a following way.

  • Run the script from application bundle:
$ python /Applications/
  • Choose the option ‘[0]’ - Generate bundle with BornAgain libraries, do not install it. You will get a message:
BornAgain Python bundle is successfully created in temporary directory 
  • Go to the specified directory. Pay attention that on your system the name of this directory may differ from the name in this instruction.
$ cd /var/folders/zt/0l4f_l_d46v5rkx668jqx0b4000lw7/T/bornagain_bundle
  • Set the environment variable PYTHONUSERBASE to the directory where you want the BornAgain libraries to be installed:
$ export PYTHONUSERBASE=/Users/me/my_python_extra
  • Run the script to install the BornAgain core libraries to the specified folder
$ python install --user
  • Check that the installation went successfully by typing
$ python -c "import bornagain"

If no error is displayed, the installation was successful.

You need to make sure that the PYTHONUSERBASE environment variable is always defined when you run your python scripts. You may also insert the corresponding export directive into your .profile configuration file:

$ export PYTHONUSERBASE=/Users/me/my_python_extra