我使用webfection,这是共享主机的命令行。在
[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环境中。在必须在每个环境中安装
stripe
。根据your webhost,您应该能够使用easy_install
来安装它们。试试这个:briancain没有在您使用的Python版本中安装它是正确的。而不是他给你的命令:
在确保目录:
/home/username/lib/python2.7/
确实存在之后。如果没有,您可以使用命令:mkdir -p /home/username/lib/python2.7
来创建它。在这将在Python2.7安装中安装它,然后可以从Python2.7上的Django中使用它。在
注意:如果出现错误:“需要libcurl 7.19.0或更高版本来编译pycurl。”您需要按照以下说明操作:
http://community.webfaction.com/questions/6365/problems-installing-pycurl
在你的帐户上安装你自己的curl版本。在
相关问题 更多 >
编程相关推荐