applegrew / django-select2

This is a Django integration for Select2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

installation error

ouhouhsami opened this issue · comments

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,

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?

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

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. :-)

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.

@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

@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?

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

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

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

Gr8 then. I will release this as version 3.1.2.

It's good for me too ! Thanks

Ok. Gr8

version 3.1.2 released.