Chinaunix首页 | 论坛 | 博客
  • 博客访问: 462645
  • 博文数量: 80
  • 博客积分: 2301
  • 博客等级: 大尉
  • 技术积分: 884
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-16 20:07
个人简介

I\'m interested in mathematics and Daoism. Welcome to talk about these subjects with me.

文章分类

全部博文(80)

文章存档

2017年(2)

2016年(16)

2015年(4)

2014年(6)

2013年(22)

2012年(2)

2011年(1)

2010年(4)

2009年(20)

2008年(2)

2007年(1)

我的朋友

分类: Python/Ruby

2017-07-07 15:40:55


      今天运行一个python3写的深度学习的程序。遇到了如下的问题

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 "./demo.py", line 4, in
    import training 
  File "/home/jdlu/2017/vector/training.py", line 9, in
    import keras
  File "/usr/local/lib/python3.6/site-packages/keras/__init__.py", line 3, in
    from . import activations
  File "/usr/local/lib/python3.6/site-packages/keras/activations.py", line 4, in
    from . import backend as K
  File "/usr/local/lib/python3.6/site-packages/keras/backend/__init__.py", line 80, in
    from .theano_backend import *
  File "/usr/local/lib/python3.6/site-packages/keras/backend/theano_backend.py", line 3, in
    import theano
  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: could not read symbols: Bad value. collect2: error: ld returned 1 exit status. 


解决方案:
1)官网下载Python3的代码
2)使用如下命令来生成Makefile
./configure --enable-shared CFLAGS=-fPIC --enable-optimizations
3)重新编译、安装
   make install
阅读(1578) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~