Python sqlite3 library can't use URIs, even though sqlite3 version should be able to
I have the most recent sqlite3 installed on my machine:
$ sqlite3 --version
3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9
And, in python, the sqlite3 module is using this version of sqlite3:
$ python
Python 3.4.9 (default, Jan 5 2019, 18:35:56)
[GCC 5.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3 as sq
>>> sq.sqlite_version_info
(3, 26, 0)
>>> sq.version_info
(2, 6, 0)
However, I cannot open a database file using URIs, even though that feature has been present in sqlite since version 3.7:
>>> import sqlite3 as sq
>>> c = sq.connect('file://test', uri=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.NotSupportedError: URIs not supported
What is going on here? What have I done wrong?
python sqlite
migrated from superuser.com Jan 6 at 10:13
This question came from our site for computer enthusiasts and power users.
add a comment |
I have the most recent sqlite3 installed on my machine:
$ sqlite3 --version
3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9
And, in python, the sqlite3 module is using this version of sqlite3:
$ python
Python 3.4.9 (default, Jan 5 2019, 18:35:56)
[GCC 5.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3 as sq
>>> sq.sqlite_version_info
(3, 26, 0)
>>> sq.version_info
(2, 6, 0)
However, I cannot open a database file using URIs, even though that feature has been present in sqlite since version 3.7:
>>> import sqlite3 as sq
>>> c = sq.connect('file://test', uri=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.NotSupportedError: URIs not supported
What is going on here? What have I done wrong?
python sqlite
migrated from superuser.com Jan 6 at 10:13
This question came from our site for computer enthusiasts and power users.
Does simply/test
work? And do you have a link for the URI support?
– l0b0
Jan 6 at 5:34
The error message is generated directly from the Python module, not the sqlite library. What OS is this on and how have you installed Python? URI support is supposed to be in the sqlite3 module since Python 3.4
– dhke
Jan 6 at 10:20
I'm running on bluehost's VPS system, so here is my full version string (from /proc/version): Linux version 2.6.32-754.6.3.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue Oct 9 17:27:49 UTC 2018 I've installed this version of Python using pyenv, which was in turn installed using the linuxbrew package manager. I'm not using the system's yum package manager because its "latest" version of SQLite is from 2009. What makes no sense to me is that the Python library is complaining, and yet it does see the new SQLite version.
– EdSanville
Jan 6 at 15:11
add a comment |
I have the most recent sqlite3 installed on my machine:
$ sqlite3 --version
3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9
And, in python, the sqlite3 module is using this version of sqlite3:
$ python
Python 3.4.9 (default, Jan 5 2019, 18:35:56)
[GCC 5.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3 as sq
>>> sq.sqlite_version_info
(3, 26, 0)
>>> sq.version_info
(2, 6, 0)
However, I cannot open a database file using URIs, even though that feature has been present in sqlite since version 3.7:
>>> import sqlite3 as sq
>>> c = sq.connect('file://test', uri=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.NotSupportedError: URIs not supported
What is going on here? What have I done wrong?
python sqlite
I have the most recent sqlite3 installed on my machine:
$ sqlite3 --version
3.26.0 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9
And, in python, the sqlite3 module is using this version of sqlite3:
$ python
Python 3.4.9 (default, Jan 5 2019, 18:35:56)
[GCC 5.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3 as sq
>>> sq.sqlite_version_info
(3, 26, 0)
>>> sq.version_info
(2, 6, 0)
However, I cannot open a database file using URIs, even though that feature has been present in sqlite since version 3.7:
>>> import sqlite3 as sq
>>> c = sq.connect('file://test', uri=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.NotSupportedError: URIs not supported
What is going on here? What have I done wrong?
python sqlite
python sqlite
asked Jan 6 at 2:15
EdSanvilleEdSanville
487
487
migrated from superuser.com Jan 6 at 10:13
This question came from our site for computer enthusiasts and power users.
migrated from superuser.com Jan 6 at 10:13
This question came from our site for computer enthusiasts and power users.
Does simply/test
work? And do you have a link for the URI support?
– l0b0
Jan 6 at 5:34
The error message is generated directly from the Python module, not the sqlite library. What OS is this on and how have you installed Python? URI support is supposed to be in the sqlite3 module since Python 3.4
– dhke
Jan 6 at 10:20
I'm running on bluehost's VPS system, so here is my full version string (from /proc/version): Linux version 2.6.32-754.6.3.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue Oct 9 17:27:49 UTC 2018 I've installed this version of Python using pyenv, which was in turn installed using the linuxbrew package manager. I'm not using the system's yum package manager because its "latest" version of SQLite is from 2009. What makes no sense to me is that the Python library is complaining, and yet it does see the new SQLite version.
– EdSanville
Jan 6 at 15:11
add a comment |
Does simply/test
work? And do you have a link for the URI support?
– l0b0
Jan 6 at 5:34
The error message is generated directly from the Python module, not the sqlite library. What OS is this on and how have you installed Python? URI support is supposed to be in the sqlite3 module since Python 3.4
– dhke
Jan 6 at 10:20
I'm running on bluehost's VPS system, so here is my full version string (from /proc/version): Linux version 2.6.32-754.6.3.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue Oct 9 17:27:49 UTC 2018 I've installed this version of Python using pyenv, which was in turn installed using the linuxbrew package manager. I'm not using the system's yum package manager because its "latest" version of SQLite is from 2009. What makes no sense to me is that the Python library is complaining, and yet it does see the new SQLite version.
– EdSanville
Jan 6 at 15:11
Does simply
/test
work? And do you have a link for the URI support?– l0b0
Jan 6 at 5:34
Does simply
/test
work? And do you have a link for the URI support?– l0b0
Jan 6 at 5:34
The error message is generated directly from the Python module, not the sqlite library. What OS is this on and how have you installed Python? URI support is supposed to be in the sqlite3 module since Python 3.4
– dhke
Jan 6 at 10:20
The error message is generated directly from the Python module, not the sqlite library. What OS is this on and how have you installed Python? URI support is supposed to be in the sqlite3 module since Python 3.4
– dhke
Jan 6 at 10:20
I'm running on bluehost's VPS system, so here is my full version string (from /proc/version): Linux version 2.6.32-754.6.3.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue Oct 9 17:27:49 UTC 2018 I've installed this version of Python using pyenv, which was in turn installed using the linuxbrew package manager. I'm not using the system's yum package manager because its "latest" version of SQLite is from 2009. What makes no sense to me is that the Python library is complaining, and yet it does see the new SQLite version.
– EdSanville
Jan 6 at 15:11
I'm running on bluehost's VPS system, so here is my full version string (from /proc/version): Linux version 2.6.32-754.6.3.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue Oct 9 17:27:49 UTC 2018 I've installed this version of Python using pyenv, which was in turn installed using the linuxbrew package manager. I'm not using the system's yum package manager because its "latest" version of SQLite is from 2009. What makes no sense to me is that the Python library is complaining, and yet it does see the new SQLite version.
– EdSanville
Jan 6 at 15:11
add a comment |
1 Answer
1
active
oldest
votes
OK, I figured out what was going on by reading the source code. When pyenv compiled my version of Python, the _sqlite module was compiled against the ridiculously old CentOS version of the "sqlite3.h" file. Because of this, the Python module didn't have the SQLITE_OPEN_URI macro defined, which causes it give a hard-coded "URIs not supported" Python exception.
To get around this, I had to set the following environment variable:
# This is to direct pyenv to the linuxbrew include and library directories, when building versions of Python
export PYTHON_CONFIGURE_OPTS="LD_RUN_PATH=/home/linuxbrew/.linuxbrew/lib/ LDFLAGS=-L/home/linuxbrew/.linuxbrew/lib/ CPPFLAGS=-I/home/linuxbrew/.linuxbrew/include/"
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54060514%2fpython-sqlite3-library-cant-use-uris-even-though-sqlite3-version-should-be-abl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
OK, I figured out what was going on by reading the source code. When pyenv compiled my version of Python, the _sqlite module was compiled against the ridiculously old CentOS version of the "sqlite3.h" file. Because of this, the Python module didn't have the SQLITE_OPEN_URI macro defined, which causes it give a hard-coded "URIs not supported" Python exception.
To get around this, I had to set the following environment variable:
# This is to direct pyenv to the linuxbrew include and library directories, when building versions of Python
export PYTHON_CONFIGURE_OPTS="LD_RUN_PATH=/home/linuxbrew/.linuxbrew/lib/ LDFLAGS=-L/home/linuxbrew/.linuxbrew/lib/ CPPFLAGS=-I/home/linuxbrew/.linuxbrew/include/"
add a comment |
OK, I figured out what was going on by reading the source code. When pyenv compiled my version of Python, the _sqlite module was compiled against the ridiculously old CentOS version of the "sqlite3.h" file. Because of this, the Python module didn't have the SQLITE_OPEN_URI macro defined, which causes it give a hard-coded "URIs not supported" Python exception.
To get around this, I had to set the following environment variable:
# This is to direct pyenv to the linuxbrew include and library directories, when building versions of Python
export PYTHON_CONFIGURE_OPTS="LD_RUN_PATH=/home/linuxbrew/.linuxbrew/lib/ LDFLAGS=-L/home/linuxbrew/.linuxbrew/lib/ CPPFLAGS=-I/home/linuxbrew/.linuxbrew/include/"
add a comment |
OK, I figured out what was going on by reading the source code. When pyenv compiled my version of Python, the _sqlite module was compiled against the ridiculously old CentOS version of the "sqlite3.h" file. Because of this, the Python module didn't have the SQLITE_OPEN_URI macro defined, which causes it give a hard-coded "URIs not supported" Python exception.
To get around this, I had to set the following environment variable:
# This is to direct pyenv to the linuxbrew include and library directories, when building versions of Python
export PYTHON_CONFIGURE_OPTS="LD_RUN_PATH=/home/linuxbrew/.linuxbrew/lib/ LDFLAGS=-L/home/linuxbrew/.linuxbrew/lib/ CPPFLAGS=-I/home/linuxbrew/.linuxbrew/include/"
OK, I figured out what was going on by reading the source code. When pyenv compiled my version of Python, the _sqlite module was compiled against the ridiculously old CentOS version of the "sqlite3.h" file. Because of this, the Python module didn't have the SQLITE_OPEN_URI macro defined, which causes it give a hard-coded "URIs not supported" Python exception.
To get around this, I had to set the following environment variable:
# This is to direct pyenv to the linuxbrew include and library directories, when building versions of Python
export PYTHON_CONFIGURE_OPTS="LD_RUN_PATH=/home/linuxbrew/.linuxbrew/lib/ LDFLAGS=-L/home/linuxbrew/.linuxbrew/lib/ CPPFLAGS=-I/home/linuxbrew/.linuxbrew/include/"
edited Jan 6 at 16:45
answered Jan 6 at 15:51
EdSanvilleEdSanville
487
487
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54060514%2fpython-sqlite3-library-cant-use-uris-even-though-sqlite3-version-should-be-abl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Does simply
/test
work? And do you have a link for the URI support?– l0b0
Jan 6 at 5:34
The error message is generated directly from the Python module, not the sqlite library. What OS is this on and how have you installed Python? URI support is supposed to be in the sqlite3 module since Python 3.4
– dhke
Jan 6 at 10:20
I'm running on bluehost's VPS system, so here is my full version string (from /proc/version): Linux version 2.6.32-754.6.3.el6.x86_64 (mockbuild@x86-01.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) ) #1 SMP Tue Oct 9 17:27:49 UTC 2018 I've installed this version of Python using pyenv, which was in turn installed using the linuxbrew package manager. I'm not using the system's yum package manager because its "latest" version of SQLite is from 2009. What makes no sense to me is that the Python library is complaining, and yet it does see the new SQLite version.
– EdSanville
Jan 6 at 15:11