Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if sqlite3 can't be found in CentOS 7?

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what to do if you can't find sqlite3 in CentOS 7". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn what to do if you can't find sqlite3 in CentOS 7.

The problem of nltk startup under Centos7

CentOS 7, Python 3.6,ipython 6.0.0

Problem description

Ipython

Start the ipython command

Import nltk

The following error message is exposed:

In [1]: import nltk----ModuleNotFoundError Traceback (most recent call last) in ()-> 1 import nltk/opt/python36env/lib/python3.6/site-packages/nltk/ _ _ init__.py in () 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 () 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 () 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 () 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 () 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 () 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 () 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 () 25 import collections.abc 26-> 27 from _ sqlite3 import * 28 29 paramstyle = "qmark" ModuleNotFoundError: No module named'_ sqlite3'

From the analysis of the error message, we can find that sqlite3 can't find it.

Problem analysis and solution

Then try to see if sqlite3 is already installed:

Yum search sqlite3

Yum search sqlite3Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile==== fastestmirrorLoading mirror speeds from cached hostfile==== S matched: sqlite3 = libsqlite3x.x86_64: a C++ Wrapper for the SQLite3 embeddable SQL database enginelibsqlite3x-devel.x86_64: Development files for libsqlite3xpreludedb-sqlite3.x86_64: Plugin to use prelude with a SQLite3 databaserubygem-sqlite3.x86_64: Allows Ruby scripts to interface with a SQLite3 databaserubygem-sqlite3-doc.noarch: Documentation for rubygem-sqlite3soci-sqlite3.x86_64: SQLite3 back-end for socisoci-sqlite3-devel.x86_64: SQLite3 back-end for sociuwsgi-plugin-sqlite3. X86'64: uWSGI-SQLite3 plugindspam-sqlite3.x86_64: SQLite v3.x storage driver for libdspamgolang-googlecode-sqlite-devel.i686: Trivial sqlite3 binding for Gogolang-googlecode-sqlite-devel.x86_64: Trivial sqlite3 binding for Golibsq3.x86_64: a C++ Wrapper for the SQLite3 embeddable SQL database enginelibsq3-devel.x86_64: Development files for libsqlite3xopendbx-sqlite.x86_64: SQLite3 backend-provides sqlite3 support in opendbxpython-sqlite3dbm.noarch: SQLite-backed dictionary conforming to the dbm interfacesqlite-devel.i686: Development tools for the sqlite3 embeddable SQL database enginesqlite-devel.x86_64: Development tools for the sqlite3 embeddable SQL database enginesqlite-tcl.x86_64: Tcl module for the sqlite3 embeddable SQL database enginesqlite3-dbf.x86_64: Converter of XBase / FoxPro tables to SQLitezabbix20-proxy-sqlite3.x86_64: Zabbix proxy compiled to use SQLitezabbix22-dbfiles-sqlite3.noarch: Zabbix database schemas and patcheszabbix22-proxy-sqlite3.x86_64: Zabbix proxy compiled to use SQLite

If you find the sqlite3-devel, you can install it.

Yum install sqlite-devel

Yum install sqlite-develLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileResolving Dependencies-- > Running transaction check--- > Package sqlite-devel.x86_64 0vir 3.7.17-8.el7 will be installed-- > Finished Dependency ResolutionDependencies Resolved= Package Arch Version Repository Size===Installing: sqlite-devel x86 / 64 3.7.17-8.el7 base 104 kTransaction Summary=Install 1 PackageTotal download size: 104 kInstalled size: 366 kIs This ok [y/d/N]: yDownloading packages:sqlite-devel-3.7.17-8.el7.x86_64.rpm | 104 kB 00:00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing: sqlite-devel-3.7.17-8.el7.x86_64 1 8.el7.x86_64 1 Verifying: sqlite-devel-3.7.17-8.el7.x86_64 1 Installed: sqlite-devel.x86_64 08.el7 Complete 3.7.17-8.el7 Complete!

The problem is not solved.

Restart ipython

Import nltk

But the problem still exists. Where did it go wrong?

The problem is finally solved.

Although sqlite3's database is installed, sqlite3 cannot be found for ipython's environment.

So I recompiled and installed python3.

Note: this is the runtime environment in which python is installed after the sqlite3 installation is successful.

So restart ipython, the problem goes away, everything is fine, which is essentially the installation of sqlite3 and the matching between sqlite3 and the python runtime environment.

These are all the contents of the article "what to do if sqlite3 can't be found in CentOS 7". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report