Installed python 3.7.0 by pyenv
on macOS.
sqlite3
has been installed:
which sqlite3
/usr/bin/sqlite3
Also tried to install pysqlite3
by pip:
pip install pysqlite3
But can't find module when import sqlite3
:
In [1]: import sqlite3
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-5239c6be4108> in <module>
----> 1 import sqlite3
~/.pyenv/versions/3.7.0/lib/python3.7/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 *
~/.pyenv/versions/3.7.0/lib/python3.7/sqlite3/dbapi2.py in <module>
25 import collections.abc
26
---> 27 from _sqlite3 import *
28
29 paramstyle = "qmark"
ModuleNotFoundError: No module named '_sqlite3'
Is it necessary to install a develop library for sqlite3 on macOS by brew?
This way works:
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.7.0
Ref:
https://github.com/pyenv/pyenv/issues/108#issuecomment-359161050
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With