导入不属于我当前 Python 2.X 版本的特定模块

发布于 2024-12-01 12:39:03 字数 362 浏览 2 评论 0原文

我的网站所在的虚拟主机运行 Python 2.4 和 Python 2.4。该网站使用 SQLite3 python 模块(这只是 Python 2.5 及更高版本的一部分)。这意味着我无法使用 SQLite3 模块,因为它不是 Python 2.4 的一部分。

有没有办法让我自己上传 python SQLite3 模块&只需在我的脚本中导入/引用它?你知道我会怎么做吗?

通常我只会在我的虚拟主机主目录上安装 Python25,但是这个虚拟主机不允许我这样做。

有什么办法可以让我上传&导入特定模块 - 来自 c++ 似乎这一定是可能的,对吗?因为在 C++ 中,我一生都在编写库和代码。只需导入其中的特定部分即可导入命名空间的特定类ETC。

My webhost where our website is runs Python 2.4 & the website uses the SQLite3 python module (which is only part of Python 2.5 & up). This means that I cant use the module SQLite3 because its not part of Python 2.4.

Is there a way for me to upload the python SQLite3 module myself & just import/refernce that in my script? Do you know how I would do this?

Usually I would just install Python25 on my webhost home directory, but this webhost wont allow me to do this.

Is there any way I can just upload & import a specific module - coming from c++ it seems this must be possible right? Because in C++ I spend my whole life writting libraries & just importing specific parts of them & importing specific classes of a namespace & etc.

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

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

发布评论

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

评论(1

野鹿林 2024-12-08 12:39:03

这在很大程度上取决于您的网络主机为您提供的有关 Python 环境的控制程度。对于普通共享主机,运行时Python环境是固定的。

This very much depends about how much control your webhost gives you about the Python environment. For normal shared hosting, the runtime Python environment is fixed.

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