I solved the issue. It was a problem with how I built/installed Python. If you have similar issues, I made a blog post outlining my steps:
jsbeard.wordpress.com/2018/02/05/installing-opencv-3-4-in-a-python-3-6-virtual-environment/ Cheers! On Wednesday, January 31, 2018 at 5:17:05 PM UTC-5, Joshua Beard wrote: > > Hello, > > I am having trouble getting Theano up and running in a virtual environment > on my machine. I created a virtual environment with Python3.6 using > virtualenv, and since I'm working on a shared machine, I've been trying to > install everything as locally as possible (preferably in my virtual > environment itself). Thanks in advance for your help, and here's my process. > > It is worth noting that $VIRTUAL_ENV == > /home/joshuabeard/.virtualenvs/code > > I built libgpu from source in a custom directory, following the > instructions located HERE > <http://deeplearning.net/software/libgpuarray/installation.html>, with > the exception of the following cmake command (from Theano/libgpu/build): > cmake \ > -D CMAKE_BUILD_TYPE=RELEASE \ > -D CMAKE_INSTALL_PREFIX=/home/joshuabeard/.virtualenvs/code \ > /home/joshuabeard/.virtualenvs/code/lib/python3.6/site-packages \ > /home/joshuabeard/code/Theano/libgpuarra > > I also used the following command to specify my lib and include > directories: > python setup.py build_ext -L $VIRTUAL_ENV/lib -I $VIRTUAL_ENV/include > > From there, installed the developer version of Theano from the Theano > directory: > python setup.py install > > Now, when I try to import Theano: > python -c "import theano" > > It throws an error: > You can find the C code in this temporary file: > /tmp/theano_compilation_error_5qwsd9dv > Traceback (most recent call last): > File "/home/joshuabeard/code/Theano/theano/gof/lazylinker_c.py", line > 75, in <module> > raise ImportError() > ImportError > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/home/joshuabeard/code/Theano/theano/gof/lazylinker_c.py", line > 92, in <module> > raise ImportError() > ImportError > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "/home/joshuabeard/code/Theano/theano/__init__.py", line 110, in > <module> > from theano.compile import ( > File "/home/joshuabeard/code/Theano/theano/compile/__init__.py", line > 12, in <module> > from theano.compile.mode import * > File "/home/joshuabeard/code/Theano/theano/compile/mode.py", line 11, in > <module> > import theano.gof.vm > File "/home/joshuabeard/code/Theano/theano/gof/vm.py", line 673, in > <module> > from . import lazylinker_c > File "/home/joshuabeard/code/Theano/theano/gof/lazylinker_c.py", line > 127, in <module> > preargs=args) > File "/home/joshuabeard/code/Theano/theano/gof/cmodule.py", line 2359, > 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. > > > > > -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
