applegrew / django-select2

This is a Django integration for Select2
MIT License
719 stars 314 forks source link

installation error #7

Closed ouhouhsami closed 12 years ago

ouhouhsami commented 12 years ago

Hello,

I have a requirements.txt file to install python related packages, and inside I have got your (great) app. But, when I run pip install -r requirements.txt, I get :

File "/srv/brahms/.virtualenvs/test/build/Django-Select2/setup.py", line 111, in <module>

    VERSION = __import__(PACKAGE).__version__

  File "django_select2/__init__.py", line 3, in <module>

    from django.conf import settings

ImportError: No module named django.conf

which is "normal" because, due to the way pip works, django is not allready installed.

one way to solve this issue would be to have a dedicated version.py file inside your module.

Regards,

applegrew commented 12 years ago

Ohk... But I have assumed that Djnago will always be installed before, which definitely needed for this app. So, your uses case is that you are installing this app to the system lib and installing Django in virtualenv?

ouhouhsami commented 12 years ago

My use case is: I build a virtualenv from scratch, installing at the same time django and django_select2 in my virtualenv.

applegrew commented 12 years ago

Then if django is installed before django_select2 then it should not be a problem, as it naturally should be. I am just trying to understand if there is more to it than I currently understand. :-)

toabi commented 12 years ago

I have the same problem in a buildout environment… although it's last in all configuration files.

edit: Well. It seems that I can't really fix that with my buildout configuration. I also vote for a dedicated version.py so that django stuff doesn't have to be there at install-time.

ouhouhsami commented 12 years ago

@applegrew : the thing is that buiding env from scratch, pip try to install your app, know it requires django but need to import django.conf.settings in init.py which is not available

applegrew commented 12 years ago

@ouhouhsami Even if I separate __version__ into say version.py and I put that in django_select2 dir then accessing that module will trigger __init__.py right? So, maybe before from django.conf import settings I need to check if django module is available right?

applegrew commented 12 years ago

Right now made a commit to Master. Can you please test it and let me know if it works for you.

applegrew commented 12 years ago

Please let me know if it works for you. Then I will release it as a package.

toabi commented 12 years ago

@applegrew It works for me now, thanks a lot!

applegrew commented 12 years ago

Gr8 then. I will release this as version 3.1.2.

ouhouhsami commented 12 years ago

It's good for me too ! Thanks

applegrew commented 12 years ago

Ok. Gr8

applegrew commented 12 years ago

version 3.1.2 released.