python - 我只能在某个版本的Python下导入Stripe Python库

标签 python linux module webfaction stripe-payments

我使用 Webfaction,这是共享主机的命令行。

[zallarak@web198 ~]$ python2.6
Python 2.6.5 (r265:79063, Nov 23 2010, 02:02:03) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import stripe
>>>

[zallarak@web198 ~]$ python2.7
Python 2.7.1 (r271:86832, Dec  1 2010, 06:29:57) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import stripe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named stripe

我知道一定有一种简单的方法可以让它在所有版本的 Python 中工作。我将非常感谢任何关于如何使这项工作/它背后的概念的见解。

我的 Django 版本在 2.7 上运行,所以目标是让它在 2.7 上运行

最佳答案

你的问题是 stripe 模块没有安装在每个 python 环境中。

I know there must be a simple way to make it work in all version of Python.

您必须在每个环境中安装stripe。根据your webhost ,您应该能够使用 easy_install 安装它们。试试这个:

python2.7 `which easy_install` stripe

关于python - 我只能在某个版本的Python下导入Stripe Python库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8364972/

相关文章:

python - Django: python manage.py runserver 给出 RuntimeError: maximum recursion depth exceeded in cmp

python - Python-如何为多用户输入创建错误处理?

python - 如何在终端中重写输出

javascript - 在 AMD 模块中使用条件依赖是个好主意吗?

python - 如何创建可选参数?

python - 加载特定的训练模型

c++ - 为什么我收到信号时会出现段错误

linux - 如何在类似字典的文件上使用 grep

python - 应该如何编写 Python 文件,使其既可以是模块又可以是具有命令行选项和管道功能的脚本?

node.js - 返回 promise 结果的模块