Running PYMC3 on Linux


#1

Hi I am trying to use PYMC3 on linux, but having the following error! Is this Theano installation issue? Any help will be appreciated.

import pymc3 as pm
print(‘Running on PyMC3 v{}’.format(pm.version))

You can find the C code in this temporary file: /tmp/theano_compilation_error_aegcukn5


ImportError Traceback (most recent call last)
/optsas/python35/lib/python3.5/site-packages/theano/gof/lazylinker_c.py in ()
80 version,
—> 81 actual_version, force_compile, _need_reload))
82 except ImportError:

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)
/optsas/python35/lib/python3.5/site-packages/theano/gof/lazylinker_c.py in ()
104 version,
–> 105 actual_version, force_compile, _need_reload))
106 except ImportError:

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None. Extra debug information: force_compile=False, _need_reload=True

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
in ()
----> 1 import pymc3 as pm
2 print(‘Running on PyMC3 v{}’.format(pm.version))

/optsas/python35/lib/python3.5/site-packages/pymc3/init.py in ()
3
4 from .blocking import *
----> 5 from .distributions import *
6 from .external import *
7 from .glm import *

/optsas/python35/lib/python3.5/site-packages/pymc3/distributions/init.py in ()
----> 1 from . import timeseries
2 from . import transforms
3
4 from .continuous import Uniform
5 from .continuous import Flat

/optsas/python35/lib/python3.5/site-packages/pymc3/distributions/timeseries.py in ()
----> 1 import theano.tensor as tt
2 from theano import scan
3
4 from pymc3.util import get_variable_name
5 from .continuous import get_tau_sd, Normal, Flat

/optsas/python35/lib/python3.5/site-packages/theano/init.py in ()
108 object2, utils)
109
–> 110 from theano.compile import (
111 SymbolicInput, In,
112 SymbolicOutput, Out,

/optsas/python35/lib/python3.5/site-packages/theano/compile/init.py in ()
10 from theano.compile.function_module import *
11
—> 12 from theano.compile.mode import *
13
14 from theano.compile.io import *

/optsas/python35/lib/python3.5/site-packages/theano/compile/mode.py in ()
9 import theano
10 from theano import gof
—> 11 import theano.gof.vm
12 from theano import config
13 from six import string_types

/optsas/python35/lib/python3.5/site-packages/theano/gof/vm.py in ()
672 if not theano.config.cxx:
673 raise theano.gof.cmodule.MissingGXX(‘lazylinker will not be imported if theano.config.cxx is not set.’)
–> 674 from . import lazylinker_c
675
676 class CVM(lazylinker_c.CLazyLinker, VM):

/optsas/python35/lib/python3.5/site-packages/theano/gof/lazylinker_c.py in ()
138 args = cmodule.GCC_compiler.compile_args()
139 cmodule.GCC_compiler.compile_str(dirname, code, location=loc,
–> 140 preargs=args)
141 # Save version into the init.py file.
142 init_py = os.path.join(loc, ‘init.py’)

/optsas/python35/lib/python3.5/site-packages/theano/gof/cmodule.py in compile_str(module_name, src_code, location, include_dirs, lib_dirs, libs, preargs, py_module, hide_symbols)
2386 # difficult to read.
2387 raise Exception(‘Compilation failed (return status=%s): %s’ %
-> 2388 (status, compile_stderr.replace(’\n’, '. ')))
2389 elif config.cmodule.compilation_warning and compile_stderr:
2390 # Print errors just below the command line.

Exception: Compilation failed (return status=1): /usr/bin/ld: /optsas/python35/lib/libpython3.5m.a(abstract.o): relocation R_X86_64_32S against `_PyObject_NextNotImplemented’ can not be used when making a shared object; recompile with -fPIC. /optsas/python35/lib/libpython3.5m.a: could not read symbols: Bad value. collect2: ld returned 1 exit status.


#2

Yep seems like a theano installation error - how did you install PyMC3?


#3

Apparently it was installed through PYMC3.


#4

I was told theano has been reinstalled on the grid using pip command. But I am still getting the same error message. Any idea?


#5

And I guess if you import theano alone you see the same error?


#6

Yes. PYMC3 is installed on the grid and the grid administrator told me that he reinstalled theano using pip.


#7

I have not seen this error (running pymc3 on Ubuntu 16.04). I don’t suppose you could try installing everything with conda?


#8

We have redhat, not ubuntu. Would that be a problem?


#9

I’m afraid I do not know enough about operating systems to know. My very vague guess is that Theano has more requirements to install than a pure python library, and I know conda recipes can install non-python requirements, which might help.