Question

I use Webfaction, and this is the command line for the shared host.

[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

I know there must be a simple way to make it work in all version of Python. I would much appreciate any insight on how to make this work/the concept behind it.

My version of Django runs on 2.7, so the goal is to make it work on 2.7

Was it helpful?

Solution

Your problem is that the stripe module is not installed in each python environment.

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

You must install stripe in each environment. According to your webhost, you should be able to install them with easy_install. Try this:

python2.7 `which easy_install` stripe

OTHER TIPS

Brian Cain is correct about it not being installed in the Python version you are using. Instead of the command he gave you should run:

easy_install-2.7 stripe

After making sure that the directory: /home/username/lib/python2.7/ actually exists. If it doesn't you can use the command: mkdir -p /home/username/lib/python2.7 to create it.

That will install it in your Python2.7 installation, which you can then use from Django on Python2.7.

Note: If you get the error: "Need libcurl version 7.19.0 or greater to compile pycurl." you'll need to follow the instructions here:

http://community.webfaction.com/questions/6365/problems-installing-pycurl

to install your own version of curl on your account.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top