2015-04-05 82 views
3

我使用的是Ubuntu Server 14.04。 我需要爲我的新Django項目python ./configure --enable-unicode = ucs4選項。我用ucs4重新安裝了python。重新安裝Python --enable-unicode = ucs4和lxml未定義符號:PyUnicodeUCS2_DecodeLatin1

現在,當我試圖運行scrapy蜘蛛,我得到這樣一個錯誤:

ImportError: /usr/local/lib/python2.7/site-packages/lxml-3.4.2-py2.7-linux-x86_64.egg/lxml/etree.so: undefined symbol: PyUnicodeUCS2_DecodeLatin1 

然後我試圖重新安裝蟒蛇,但得到了一個錯誤:

Compiling /usr/local/lib/python2.7/zipfile.py ... 
make: *** [libinstall] Error 1 

然後我試圖重新安裝libxml,但也有en錯誤:

/usr/bin/ld: /usr/local/lib/python2.7/config/libpython2.7.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/python2.7/config/libpython2.7.a: error adding symbols: Bad value 
collect2: error: ld returned 1 exit status 

Scrapy重新安裝不起作用。

請幫忙!

回答

5

我解決了它。 也許這對別人有用。 我用sudo rm -R /usr/local/lib/python2.7文件夾手動刪除導致錯誤的python dist。 然後我從源手動重新安裝python,scrapy和django。

+1

刪除/usr/local/lib/python2.7沒有其他的工作。謝謝! – 2017-08-09 19:11:05

相關問題