1

I have installed theano with python3.6 using pip install theano and Getting below error while importing theano even though I configured theano to run with cpu.

/usr/bin/ld: /usr/local/lib/libpython3.6m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libpython3.6m.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/theano/gof/lazylinker_c.py", line 75, in raise ImportError() ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/theano/gof/lazylinker_c.py", line 92, in raise ImportError() ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.6/site-packages/theano/init.py", line 66, in from theano.compile import ( File "/usr/local/lib/python3.6/site-packages/theano/compile/init.py", line 10, in from theano.compile.function_module import * File "/usr/local/lib/python3.6/site-packages/theano/compile/function_module.py", line 21, in import theano.compile.mode File "/usr/local/lib/python3.6/site-packages/theano/compile/mode.py", line 10, in import theano.gof.vm File "/usr/local/lib/python3.6/site-packages/theano/gof/vm.py", line 662, in from . import lazylinker_c File "/usr/local/lib/python3.6/site-packages/theano/gof/lazylinker_c.py", line 127, in preargs=args) File "/usr/local/lib/python3.6/site-packages/theano/gof/cmodule.py", line 2316, in compile_str (status, compile_stderr.replace('\n', '. '))) Exception: Compilation failed (return status=1): /usr/bin/ld: /usr/local/lib/libpython3.6m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC. /usr/local/lib/libpython3.6m.a: error adding symbols: Bad value. collect2: error: ld returned 1 exit status.

4
  • 1
    Possible duplicate of Python C binding error Commented May 17, 2018 at 7:07
  • If python c binding is the case there will be error while importing other python modules as well.I am having issues only in importing theano Commented May 18, 2018 at 3:41
  • The advice recompile with -fPIC is right on the screen, that's why the question is a dup. Commented May 18, 2018 at 4:56
  • got the solution,the problem raised due to partial installation of python3.6-dev and python3.6 Commented Jul 30, 2018 at 8:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.