导入不属于我当前 Python 2.X 版本的特定模块
我的网站所在的虚拟主机运行 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这在很大程度上取决于您的网络主机为您提供的有关 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.