如何在Ubuntu上的Pycharm中更新SQLite3版本?

发布于 2025-02-03 10:00:46 字数 336 浏览 4 评论 0原文

我有一个完全更新的Pycharm编辑器(版本Pycharm 2022.1.2)。

我患有SQL查询(SQLITE3),该查询不支持SQLite版本3.33,而Pycharm似乎仅具有3.31版。

我尽力升级它,而我的Ubuntu 20.04拥有SQLite3(3.38)的最新版本,但仍然,Pycharm不在乎它,它仍然使用我不知道在哪里的旧3.31。

那么,如何在Pycharm中将SQLite更新为更理智的版本?

Pycharm使用SQLalchemy来操纵数据库,它是最新版本(1.4.37),但它仍然使用SQLite版本3.31。

项目解释器是Venv'd Python3.8。

I have a fully updated PyCharm editor (version PyCharm 2022.1.2).

I'm suffering from an SQL query (SQLite3), which is not supported below SQLite version 3.33, and PyCharm seems having version 3.31 only.

I tried my best to upgrade it, and my Ubuntu 20.04 has the most updated version of sqlite3 (3.38), but still, PyCharm doesn't care about it and it still uses the old 3.31 from I have no idea where.

So, how can I update SQLite to a more sane version in PyCharm?

PyCharm uses SQLAlchemy to manipulate the databases, and it is in the latest version (1.4.37), but it still uses SQLite version 3.31.

Project interpreter is a venv'd Python3.8.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紅太極 2025-02-10 10:00:46

简单地安装了最新版本的sqlite(例如,来自在这里)不足以获得Python在Ubuntu上认识它。

$ sqlite3 --version
3.38.5 2022-05-06 15:25:27 78d9c993d404cdfaa7fdd2973fa1052e3da9f66215cff9c5540ebe55c407d9fe
$ python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.31.1'

相关问题,我们需要添加/usr/usr/local/lib ld_library_path环境变量:

$ LD_LIBRARY_PATH=/usr/local/lib python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.38.5'

如果您不想将全局更改为ld_library_path您可以将其添加到Pycharm Run配置中:

Simply having the latest version of SQLite installed (e.g., from here) is not enough to get Python on Ubuntu to recognize it.

$ sqlite3 --version
3.38.5 2022-05-06 15:25:27 78d9c993d404cdfaa7fdd2973fa1052e3da9f66215cff9c5540ebe55c407d9fe
$ python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.31.1'

As mentioned in the related question, we need to add /usr/local/lib to the LD_LIBRARY_PATH environment variable:

$ LD_LIBRARY_PATH=/usr/local/lib python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.38.5'

If you don't want to make a global change to LD_LIBRARY_PATH you can add it to your PyCharm run configuration:

PyCharm run configuration

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文