Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named stripe #3

Open
manish2409 opened this issue Jul 17, 2015 · 8 comments
Open

No module named stripe #3

manish2409 opened this issue Jul 17, 2015 · 8 comments

Comments

@manish2409
Copy link

Hi I used the instructions given to install this wintergear demo in a virtual env but gave me this error :
NO MODULE NAMED STRIPE
I am using Linuxmint 17.1
Detailed steps:

  1. created a virtual env demo. (virtualenv demo ) and activated it (source demo/bin/activate).
  2. next copied the downloaded wintergear source code into the demo folder with shoop source code in shoop sub folder.
  3. Installed all the requirements. (pip install -r requirements.txt)
  4. When I execute command python manage.py wintergear_import_demo, it throws error no module named stripe.
  5. I downoaded shoop-stripe source code. And executed command : python /home/manish/Downloads/shoop-stripe-master/setup.py install. It says package directory shoop_stripe doesnot exist.
  6. I create a directory named shoop_stripe in demo folder. And again run python /home/manish/Downloads/shoop-stripe-master/setup.py install. It installed shoop-stripe.
  7. I run command python manage.py wintergear_import_demo and it still gives me error no module named stripe.
  8. I run pip freeze and there is stripe installed.

Result of pip freeze

Babel==1.3
Django==1.8.2
django-bootstrap3==6.1.0
django-countries==3.3
django-enumfields==0.7.3
django-filer==0.9.11
django-jinja==1.4.1
django-mptt==0.7.4
django-parler==1.4
django-polymorphic==0.7.1
django-registration-redux==1.2
django-timezone-field==1.2
djangorestframework==3.1.3
easy-thumbnails==2.2
enum34==1.0.4
factory-boy==2.5.2
fake-factory==0.5.2
Jinja2==2.7.3
jsonfield==1.0.3
Markdown==2.6.2
MarkupSafe==0.23
Pillow==2.9.0
pytz==2015.4
PyYAML==3.11
requests==2.7.0
shoop==1.1.0.post0.dev0
shoop-stripe==0.1
six==1.9.0
Unidecode==0.4.18
wheel==0.24.0

Complete Traceback:

/home/manish/Projects/demo/shoop/shoop/utils/importing.py:9: RemovedInDjango19Warning: django.utils.importlib will be removed in Django 1.9.
from django.utils import importlib

Traceback (most recent call last):
File "manage.py", line 14, in
execute_from_command_line(sys.argv)
File "/home/manish/Projects/demo/local/lib/python2.7/site-packages/django/core/management/init.py", line 338, in execute_from_command_line
utility.execute()
File "/home/manish/Projects/demo/local/lib/python2.7/site-packages/django/core/management/init.py", line 312, in execute
django.setup()
File "/home/manish/Projects/demo/local/lib/python2.7/site-packages/django/init.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/manish/Projects/demo/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/manish/Projects/demo/local/lib/python2.7/site-packages/django/apps/config.py", line 119, in create
import_module(entry)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named stripe

@tulimaki
Copy link
Contributor

For wintergear demo there is certain version of shoop inside this project. The older version includes stripe module.

For correct use of wintergear demo: You should not have shoop or shoop-stripe installed in virtualenv (uninstall those from demo virtualenv). Also to get correct shoop version for wintergear you should run "git submodule update --init" inside wintergear folder. Also you can see "Getting started" instructions at readme.

If you have to use newest version of shoop with wintergear demo you can't have "shoop.stripe" in your INSTALLED_APPS.

@manish2409
Copy link
Author

I deleted shoop-stripe from INSTALLED_APPS and executed the command npm build run.
Then I started the server and went to localhost:8000 I get this error:

screenshot from 2015-07-17 14 08 14

This is the traceback::

Environment:

Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.8.2
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'shoop_demo',
'wintergear_theme',
'wintergear_demo_content',
'django_jinja',
'filer',
'easy_thumbnails',
'shoop.core',
'shoop.simple_pricing',
'shoop.simple_supplier',
'shoop.default_tax',
'shoop.front',
'shoop.front.apps.registration',
'shoop.front.apps.auth',
'shoop.front.apps.customer_information',
'shoop.front.apps.personal_order_history',
'shoop.front.apps.simple_order_notification',
'shoop.front.apps.simple_search',
'shoop.admin',
'shoop.addons',
'shoop.testing',
'bootstrap3',
'shoop.notify',
'shoop.simple_cms',
'registration')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'shoop.front.middleware.ProblemMiddleware',
'shoop.front.middleware.ShoopFrontMiddleware')

Traceback:
File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.             response = response.render()
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/django/template/response.py" in render
  2.         self.content = self.rendered_content
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  3.     content = template.render(context, self._request)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/django_jinja/backend.py" in render
  4.     return self.template.render(context)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/jinja2/environment.py" in render
  5.     return self.environment.handle_exception(exc_info, True)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/jinja2/environment.py" in handle_exception
  6.     reraise(exc_type, exc_value, tb)
    
    File "/home/manish/Projects/shoop_demo/wintergear_theme/templates/shoop/front/index.jinja" in top-level template code
  7. {% extends "shoop/front/base.jinja" %}
    File "/home/manish/Projects/shoop_demo/wintergear_theme/templates/shoop/front/base.jinja" in top-level template code
  8.             {% block content %}{% endblock %}
    
    File "/home/manish/Projects/shoop_demo/wintergear_theme/templates/shoop/front/index.jinja" in block "content"
  9.                 {{ macros.product_box(product, show_description=False) }}
    
    File "/home/manish/Projects/shoop_demo/wintergear_theme/templates/shoop/front/macros.jinja" in template
  10.                 <img alt="{{ product.name }}" src="{{ product.primary_image|thumbnail(size=thumbnail_size, crop='smart', upscale=True) }}" class="primary-image">
    
    File "/home/manish/Projects/shoop_demo/shoop/shoop/front/templatetags/thumbnails.py" in thumbnail
  11.     thumbnail = thumbnailer.get_thumbnail(options, generate=generate)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/easy_thumbnails/files.py" in get_thumbnail
  12.                 silent_template_exception=silent_template_exception)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/easy_thumbnails/files.py" in generate_thumbnail
  13.         fail_silently=silent_template_exception)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/easy_thumbnails/engine.py" in generate_source_image
  14.             image = generator(source, **processor_options)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/easy_thumbnails/source_generators.py" in pil_image
  15. image.load()
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/PIL/ImageFile.py" in load
  16.             d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
    
    File "/home/manish/Projects/shoop_demo/local/lib/python2.7/site-packages/PIL/Image.py" in _getdecoder
  17.     raise IOError("decoder %s not available" % decoder_name)
    

Exception Type: IOError at /
Exception Value: decoder jpeg not available

@tulimaki
Copy link
Contributor

Either PIL not installed or incorrect version of PIL installed. Install requirements after submodule update or check your PIL installation.

@manish2409
Copy link
Author

I install PIL using
pip install PIL --allow-external PIL --allow-unverified PIL but still giving me error. pip freeze shows PIL==1.1.7 installed in virtual environment

@tulimaki
Copy link
Contributor

Ok, that version should be fine. Here http://stackoverflow.com/questions/12555831/decoder-jpeg-not-available-error-when-following-django-photo-app-tutorial is similiar issue with Django. Perhaps you are missing libjpeg-dev.

@manish2409
Copy link
Author

I install libjpeg-dev in root by using sudo apt-get install libjpeg-dev. I searched but couldn't find a way to use it in my virtualenv. Can you help me on this?

@tulimaki
Copy link
Contributor

If this is all what you did you should pip uninstall PIL and reinstall it.

Like it says in the stackoverflow post i would suggest that you install zlib1g-dev and libpng12-dev also before reinstalling PIL to your virtualenv.

@manish2409
Copy link
Author

Hi I tried the link you mentioned but still no luck. I am not able to get it in my virtual environment. Also I read in several forums that i can use Pillow instead of PIL. So why Both are installed simultaneously? Can I Install shoop and wintergear demo in system instead of a virtualenv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants