Python troubleshooting

When BornAgain is installed on the system, its library directory is automatically added to the PYTHONPATH environment directory.

This enables the use of the import bornagain statement in any Python script and run this script using the Python interpreter installed on the system.

Sometimes this process can fail. The following checklist can be useful to tackle possible causes of the problem.


How many Pythons are installed on the system?

Please note that having more than one Python interpreter installed on the system is potentially error-prone and requires some skills from the user to be able to manage their co-existence. If you have more than one Python, please consider uninstalling all of them but one.


Does the Python interpreter version matches the BornAgain installation?

BornAgain is a 64-bit application and requires a 64-bit Python installed on the system. Additionally, you can’t use BornAgain intended for Python 3.7 together with an older Python 2.7. Please make sure that the Python version number, as specified in the BornAgain installer name (e.g. BornAgain-1.16.0-python3.7-win64.exe ), matches the Python installation on your system.


Are you using the Anaconda installation?

If you have installed Python using the Anaconda installer, please make sure that you are using the Anaconda Prompt, Anaconda Navigator and can run BornAgain scripts from the command line, as explained in Install Python with the Anaconda installer.


Are you using a native Python installation?

If you have installed Python manually using the installer from Python.org, try to run it from the Windows command prompt, as explained in Manual Python installation.