一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Linux|Centos|Ubuntu|系統進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務器之家 - 服務器系統 - Centos - 關于CentOS 7下sqlite3找不到的問題解決

關于CentOS 7下sqlite3找不到的問題解決

2022-01-25 17:04bladestone Centos

這篇文章主要給大家介紹了關于CentOS 7下sqlite3找不到問題的解決方法,文中介紹的非常詳細,對大家具有一定的參考學習價值,需要的朋友們下面跟著小編一起來學習學習吧。

本文主要給大家介紹的關于CentOS 7下sqlite3找不到問題的解決方法,分享出來供大家參考學習,下面來一起看看詳細的介紹:

Centos7下的nltk啟動問題

CentOS 7, Python 3.6,ipython 6.0.0

問題描述

ipython

啟動ipython命令

import nltk

爆出以下的錯誤信息:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
In [1]: import nltk
---------------------------------------------------------------------------
ModuleNotFoundError      Traceback (most recent call last)
<ipython-input-1-b06499430ee0> in <module>()
----> 1 import nltk
 
/opt/python36env/lib/python3.6/site-packages/nltk/__init__.py in <module>()
 135 from nltk.translate import *
 136 from nltk.sem import *
--> 137 from nltk.stem import *
 138
 139 # Packages which can be lazily imported
 
/opt/python36env/lib/python3.6/site-packages/nltk/stem/__init__.py in <module>()
  27 from nltk.stem.isri import ISRIStemmer
  28 from nltk.stem.porter import PorterStemmer
---> 29 from nltk.stem.snowball import SnowballStemmer
  30 from nltk.stem.wordnet import WordNetLemmatizer
  31 from nltk.stem.rslp import RSLPStemmer
 
/opt/python36env/lib/python3.6/site-packages/nltk/stem/snowball.py in <module>()
  24
  25 from nltk import compat
---> 26 from nltk.corpus import stopwords
  27 from nltk.stem import porter
  28 from nltk.stem.util import suffix_replace
 
/opt/python36env/lib/python3.6/site-packages/nltk/corpus/__init__.py in <module>()
  64 from nltk.tokenize import RegexpTokenizer
  65 from nltk.corpus.util import LazyCorpusLoader
---> 66 from nltk.corpus.reader import *
  67
  68 abc = LazyCorpusLoader(
 
/opt/python36env/lib/python3.6/site-packages/nltk/corpus/reader/__init__.py in <module>()
 103 from nltk.corpus.reader.categorized_sents import *
 104 from nltk.corpus.reader.comparative_sents import *
--> 105 from nltk.corpus.reader.panlex_lite import *
 106
 107 # Make sure that nltk.corpus.reader.bracket_parse gives the module, not
 
/opt/python36env/lib/python3.6/site-packages/nltk/corpus/reader/panlex_lite.py in <module>()
  13
  14 import os
---> 15 import sqlite3
  16
  17 from nltk.corpus.reader.api import CorpusReader
 
/usr/local/lib/python3.6/sqlite3/__init__.py in <module>()
  21 # 3. This notice may not be removed or altered from any source distribution.
  22
---> 23 from sqlite3.dbapi2 import *
 
/usr/local/lib/python3.6/sqlite3/dbapi2.py in <module>()
  25 import collections.abc
  26
---> 27 from _sqlite3 import *
  28
  29 paramstyle = "qmark"
 
ModuleNotFoundError: No module named '_sqlite3'

從錯誤信息來分析,可以發現,就是sqlite3找不到而已。

問題分析與解決

那就嘗試看看sqlite3是否已經安裝:

yum search sqlite3

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
yum search sqlite3
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
=============================================================================== N/S matched: sqlite3 ================================================================================
libsqlite3x.x86_64 : A C++ Wrapper for the SQLite3 embeddable SQL database engine
libsqlite3x-devel.x86_64 : Development files for libsqlite3x
preludedb-sqlite3.x86_64 : Plugin to use prelude with a SQLite3 database
rubygem-sqlite3.x86_64 : Allows Ruby scripts to interface with a SQLite3 database
rubygem-sqlite3-doc.noarch : Documentation for rubygem-sqlite3
soci-sqlite3.x86_64 : SQLite3 back-end for soci
soci-sqlite3-devel.x86_64 : SQLite3 back-end for soci
uwsgi-plugin-sqlite3.x86_64 : uWSGI - SQLite3 plugin
dspam-sqlite3.x86_64 : SQLite v3.x storage driver for libdspam
golang-googlecode-sqlite-devel.i686 : Trivial sqlite3 binding for Go
golang-googlecode-sqlite-devel.x86_64 : Trivial sqlite3 binding for Go
libsq3.x86_64 : A C++ Wrapper for the SQLite3 embeddable SQL database engine
libsq3-devel.x86_64 : Development files for libsqlite3x
opendbx-sqlite.x86_64 : SQLite 3 backend - provides sqlite3 support in opendbx
python-sqlite3dbm.noarch : SQLite-backed dictionary conforming to the dbm interface
sqlite-devel.i686 : Development tools for the sqlite3 embeddable SQL database engine
sqlite-devel.x86_64 : Development tools for the sqlite3 embeddable SQL database engine
sqlite-tcl.x86_64 : Tcl module for the sqlite3 embeddable SQL database engine
sqlite3-dbf.x86_64 : Converter of XBase / FoxPro tables to SQLite
zabbix20-proxy-sqlite3.x86_64 : Zabbix proxy compiled to use SQLite
zabbix22-dbfiles-sqlite3.noarch : Zabbix database schemas and patches
zabbix22-proxy-sqlite3.x86_64 : Zabbix proxy compiled to use SQLite

找到了sqlite3-devel,那就安裝好了

yum install sqlite-devel

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
yum install sqlite-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package sqlite-devel.x86_64 0:3.7.17-8.el7 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=====================================================================================================================================================================================
 Package          Arch          Version          Repository        Size
=====================================================================================================================================================================================
Installing:
 sqlite-devel         x86_64         3.7.17-8.el7         base         104 k
 
Transaction Summary
=====================================================================================================================================================================================
Install 1 Package
 
Total download size: 104 k
Installed size: 366 k
Is this ok [y/d/N]: y
Downloading packages:
sqlite-devel-3.7.17-8.el7.x86_64.rpm                               | 104 kB 00:00:00 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : sqlite-devel-3.7.17-8.el7.x86_64                                 1/1
 Verifying : sqlite-devel-3.7.17-8.el7.x86_64                                 1/1
 
Installed:
 sqlite-devel.x86_64 0:3.7.17-8.el7                                    
 
Complete!

問題沒有解決

重新啟動ipython

import nltk

但是問題依然存在,哪里出的問題呢?

問題最終解決

雖然安裝了sqlite3的數據庫,但是對于ipython的環境來說,確實無法找到sqlite3。

于是,我重新編譯,并且安裝了一下python3。

注意: 這個是在sqlite3安裝成功之后,在安裝python的運行環境。

于是重新啟動ipython,問題消逝,一切正常,本質上就是sqlite3的安裝,以及sqlite3與python運行環境之間的匹配的問題。

總結

以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對服務器之家的支持。

原文鏈接:http://blog.csdn.net/blueheart20/article/details/72829675

延伸 · 閱讀

精彩推薦
  • Centoscentos不小心刪除/root目錄該如何解決?

    centos不小心刪除/root目錄該如何解決?

    一些朋友最近在問小編centos不小心刪除/root目錄該如何解決?今天小編就為大家分享centos不小心刪除/root目錄解決辦法;希望對大家會有幫助,有需要的朋友...

    腳本之家8022019-05-29
  • CentosCentos7運用/dev/shm進行網站優化

    Centos7運用/dev/shm進行網站優化

    這篇文章主要介紹了LINUX中Centos7運用/dev/shm進行網站優化相關知識點,對此有興趣的朋友參考學習下。...

    彬菌9912022-03-02
  • CentosCentos 7開啟網卡自動獲取IP的詳細方法

    Centos 7開啟網卡自動獲取IP的詳細方法

    本篇文章主要介紹了Centos 7開啟網卡自動獲取IP的詳細方法,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧...

    凌鋒8972021-12-29
  • CentosCentOS下Uptime命令詳解

    CentOS下Uptime命令詳解

    在Linux下,我們可以使用uptime命令,而且此命令不必使用root權限。uptime命令在系統中已經默認安裝了。今天小編為大家帶來的是CentOS下Uptime命令詳解;希望...

    CentOS之家11482019-06-19
  • CentosCentOS6.5下Redis安裝與配置詳細步驟

    CentOS6.5下Redis安裝與配置詳細步驟

    本篇文章主要介紹了CentOS6.5下Redis安裝與配置詳細步驟,詳細介紹redis單機單實例安裝與配置,服務及開機自啟動。有興趣的可以了解一下。...

    飛流11452021-12-24
  • CentosCentOS7設置日期和時間方法以及基本概念介紹

    CentOS7設置日期和時間方法以及基本概念介紹

    這篇文章主要介紹了CentOS7設置日期和時間方法以及基本概念介紹,本文講解使用CentOS7中的新命令timedatectl設置日期時間方法,需要的朋友可以參考下 ...

    CentOS之家6522019-09-19
  • CentosCentOS 6.6實現永久修改DNS地址的方法

    CentOS 6.6實現永久修改DNS地址的方法

    這篇文章主要介紹了CentOS 6.6實現永久修改DNS地址的方法,涉及針對CentOS配置文件的相關設置技巧,具有一定參考借鑒價值,需要的朋友可以參考下 ...

    Linux社區4472020-08-21
  • Centoscentos 安裝與操作方法

    centos 安裝與操作方法

    這篇文章主要介紹了centos 安裝與操作方法,需要的朋友可以參考下...

    centos之家5272019-07-11
主站蜘蛛池模板: 国产精品免费 | 国产卡一卡二卡三卡四 | 国产私拍精品88福利视频 | 亚洲国产精品一区二区首页 | 手机国产乱子伦精品视频 | 四虎精品永久在线网址 | 美女被躁了在线观看视频 | 2022最新国产在线 | 色成人综合网 | 久久国产精品人妻中文 | 欧美日韩国产一区二区三区在线观看 | 日本高清视频一区二区 | 天天狠天天透天干天天怕处 | 成人影音先锋 | 倩女还魂在线观看完整版免费 | 91伊人网| 成人免费公开视频 | 2018生活片性色生活片 | 日本午夜影院 | 免费看日本 | 东京干福利 | 久久精品热只有精品 | 亚洲天堂2016| 变态人shou交小说 | 国产福利片在线 | 亚洲日本在线观看网址 | 亚洲高清无码在线 视频 | 双子母性本能在线观看 | 好大好硬快点好爽公 | 日韩精品免费一区二区三区 | 乳环调教| 91私密保健女子养生spa | 本站只有精品 | 欧美特黄aaaaaa| 911精品国产亚洲日本美国韩国 | 国产深夜视频 | 1024国产精品视频观看 | 日日视频 | 美女尿口照片 | 国产在线欧美日韩精品一区二区 | 精品四虎国产在免费观看 |