Calling Mantid from Standalone Python

Hi all

I am trying to call Mantid from a standalone version of python and running into errors. Please see details below:

On running ‘from mantid.simpleapi import *’ I am getting:

###############################################################################
—> 14 from ._kernel import *
15
16 ###############################################################################

ImportError: DLL load failed: The specified module could not be found.

or sometimes…

###############################################################################
—> 25 from . import pyversion
26
27 ###############################################################################

ImportError: cannot import name pyversion

OS: Windows 10 - 64bit
Mantid version : 3.10
Python version : 2.7.13 (Anaconda package 4.3.1)

Any ideas?

Saurabh

Hi Saurabh,

Mantid ships with its on version of Python on Windows and so needs a bit of setup to get running.

There is a script in the MantidInstall\bin called mantidpython.bat that wraps the python exe. Calling this instead of python should allow the import to work.

Does this help?

Martyn

Hi Martyn

Thanks for the reply. Actually I did try using the mantid version of python (using notebook). Unfortunately, I am trying to call another software which seems to work with my standalone python but not the mantid version.

Cheers
Saurabh

Hi Saurabh,

Is your other package installable via pip?

If so are you able to try installing it using MantidInstall\bin\Scripts\pip and then trying the notebook again?

Martyn