Ticket #1594 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Importing mantid into vanilla python without properties file

Reported by: Peter Peterson Owned by: Roman Tolchenov
Priority: major Milestone: Iteration 27
Component: Mantid Keywords:
Cc: doucetm@… Blocked By:
Blocking: Tester: Martyn Gigg

Description

Easy one to demonstrate. On a system without a Mantid.properties file:

$ python2.4 
Python 2.4.3 (#1, Jun 11 2009, 14:09:37) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from MantidFramework import mtd
Problem loading the configuration file /SNS/users/pf9/Mantid.properties Cannot open file in /SNS/users/pf9/Mantid.properties
Trouble configuring the logging framework Not found
Trouble configuring the logging framework Not found
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/opt/Mantid/bin/MantidFramework.py", line 959, in ?
    mtd = FrameworkSingleton()
  File "/opt/Mantid/bin/MantidFramework.py", line 956, in FrameworkSingleton
    setattr(__main__, '__mantid__', MantidPyFramework())
  File "/opt/Mantid/bin/MantidFramework.py", line 347, in __init__
    super(MantidPyFramework, self).__init__()
RuntimeError: Unable to parse file: in Facilities.xml

Which prevents Mantid from being initialized.

Change History

comment:1 Changed 10 years ago by Nick Draper

  • Status changed from new to assigned
  • Owner set to Roman Tolchenov

Convert this to a warning and therefore allow mantid to ignore and continue without a file

comment:2 Changed 10 years ago by Mathieu Doucet

(In [6551]) Long overdue one-liner that will make life in pythonland much easier (MANTIDPATH environment variable). Re #1594

comment:3 Changed 10 years ago by Mathieu Doucet

(In [6552]) Added installer that allows importing mantid into vanilla python. Set MANTIDPATH first. Re #1594

comment:4 Changed 10 years ago by Mathieu Doucet

  • Component set to Mantid

From your release directory, execute:

python setup.py install

Then make sure your LD_LIBRARY_PATH contains your release directory and that MANTIDPATH is set to your release directory.

comment:5 Changed 10 years ago by Mathieu Doucet

(In [6588]) Added MANTIDPATH to the PYTHONPATH so that Mantid finds mantidsimple.py on Windows (TODO: write mantidsimple.py in a reasonable place...). Re #1594

comment:6 Changed 10 years ago by Mathieu Doucet

(In [6589]) Added trailing slash to release dir in ConfigService. Adding it to MANTIDPATH is both non-standard and makes other parts of the code break. Re #1594

comment:7 Changed 10 years ago by Mathieu Doucet

  • Cc doucetm@… added

comment:8 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 26 to Iteration 27

Bulk move of tickets to iteration 27, if your ticket is essential for Iteration 26 then move it back.

comment:9 Changed 10 years ago by Roman Tolchenov

(In [8244]) Fixed the particular issue of python crashing, but it is not clear for me why Mantid should work at all without Mantid.properties file. re #1594

comment:10 Changed 10 years ago by Roman Tolchenov

  • Status changed from assigned to accepted

comment:11 Changed 10 years ago by Roman Tolchenov

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:12 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:13 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to closed

In 1.1.9493:

  • MantidPlot starts and finds the Facilities.xml file;
  • MantidFramework can be imported from vanilla python both in the bin directory and elsewhere
  • As far as I am aware the VATES plugins can also find the correct Mantid location.

Signing off as passed.

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2441

Note: See TracTickets for help on using tickets.