Error during importing Paddle: "undefined symbol: sqlite3_enable_shared_cache"
Created by: JiayiFeng
After Installing Paddle with the one-click install script, I tried to run import paddle.v2 as paddle
in Python. But an error occurred:
Python 2.7.13+ (default, May 15 2017, 13:52:06)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle.v2 as paddle
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/paddle/v2/__init__.py", line 26, in <module>
from . import dataset
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/paddle/v2/dataset/__init__.py", line 25, in <module>
import sentiment
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/paddle/v2/dataset/sentiment.py", line 26, in <module>
import nltk
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/nltk/__init__.py", line 137, in <module>
from nltk.stem import *
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/nltk/stem/__init__.py", line 29, in <module>
from nltk.stem.snowball import SnowballStemmer
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/nltk/stem/snowball.py", line 26, in <module>
from nltk.corpus import stopwords
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/nltk/corpus/__init__.py", line 66, in <module>
from nltk.corpus.reader import *
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/nltk/corpus/reader/__init__.py", line 105, in <module>
from nltk.corpus.reader.panlex_lite import *
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in <module>
import sqlite3
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/home/work/fengjiayi/tmp_test/python27/lib/python2.7/sqlite3/dbapi2.py", line 28, in <module>
from _sqlite3 import *
ImportError: /home/work/fengjiayi/tmp_test/python27/lib/python2.7/lib-dynload/_sqlite3.so: undefined symbol: sqlite3_enable_shared_cache
So far this error only occurs on machines of Baidu's internal network.
We have found a trick to solve this problem:
There is a file named _sqlite3.so
in {paddle_install_folder}/python27/lib/python2.7/lib-dynload
, find and replace it with another available _sqlite3.so
. You can find one in Jumbo's folder if you have installed Sqlite3 with Jumbo.
However, that's not a normal practice. The fundamental reason still needs to be found out.