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

Error occurring in django 1.7 #58

Open
alexsilva opened this issue Oct 2, 2015 · 6 comments
Open

Error occurring in django 1.7 #58

alexsilva opened this issue Oct 2, 2015 · 6 comments

Comments

@alexsilva
Copy link

For some reason pkg_resources can not find the version of the lib authtools and generates the error below:

 mod_wsgi (pid=12640): Target WSGI script '...\\wsgi.py' cannot be loaded as Python module.
 mod_wsgi (pid=12640): Exception occurred processing WSGI script '...\\wsgi.py'.
 Traceback (most recent call last):
   File "...\\wsgi.py", line 48, in <module>
     _application = get_wsgi_application()
   File "...\\django\\core\\wsgi.py", line 14, in get_wsgi_application
     django.setup()
   File "...\\django\\__init__.py", line 21, in setup
     apps.populate(settings.INSTALLED_APPS)
   File "...\\django\\apps\\registry.py", line 115, in populate
     app_config.ready()
   File "...\\xadmin\\apps.py", line 13, in ready
     self.module.autodiscover()
   File "...\\xadmin\\__init__.py", line 55, in autodiscover
     import_module('%s.adminx' % app)
   File "...\django\\utils\\importlib.py", line 46, in import_module
     __import__(name)
   File "...\\app\\adminx.py", line 4, in <module>
     from authtools.forms import UserCreationForm, AdminUserChangeForm
   File "...\\pyenv\\Lib\\site-packages\\authtools\\__init__.py", line 3, in <module>
     __version__ = pkg_resources.get_distribution('django-authtools').version
   File "...\\pkg_resources\\__init__.py", line 539, in get_distribution
     dist = get_provider(dist)
   File "...\\pkg_resources\\__init__.py", line 419, in get_provider
   File "...\\pkg_resources\\__init__.py", line 940, in require
     needed = self.resolve(parse_requirements(requirements))
   File "...\\pkg_resources\\__init__.py", line 827, in resolve
     raise DistributionNotFound(req, requirers)
 DistributionNotFound: The 'django-authtools' distribution was not found and is required by the application

If the comment line below the error disappears (authtools.init):

pkg_resources.get_distribution('django-authtools').version

See my environment is to:

Python 2.7.9
Django 1.7
Xadmin (branch django 1.7)
Apache2 (with wsgi)

django-authtools - It is installed in a virtual environment (created with virtualenv).

@rockymeza
Copy link
Contributor

This is interesting, I'm curious, how did you install django-authtools?

@alexsilva
Copy link
Author

pip install django-authtools # to inside virutalenv
Em sex, 2 de out de 2015 às 22:44, Rocky Meza [email protected]
escreveu:

This is interesting, I'm curious, how did you install django-authtools?


Reply to this email directly or view it on GitHub
#58 (comment)
.

@rockymeza
Copy link
Contributor

I'm guessing you are using Windows? I've never tried to use authtools on windows, that might be the problem, but I doubt it.

@alexsilva
Copy link
Author

Yes. I am using Windows. But you should consider that the error does not
come from lib django-authtools, but pkg_resources.

Em sáb, 3 de out de 2015 às 00:09, Rocky Meza [email protected]
escreveu:

I'm guessing you are using Windows? I've never tried to use authtools on
windows, that might be the problem, but I doubt it.


Reply to this email directly or view it on GitHub
#58 (comment)
.

@rockymeza
Copy link
Contributor

I was looking at pkg_resources, what do you get when you run:

import pprint
import pkg_resources

pprint.pprint(pkg_resources.working_set.by_key)

I made a new temporary environment and installed django-authtools and this is what I got:

{'django': Django 1.8.4 (/XXX/.virtualenvs/tmp-d05746e109b81142/lib/python2.7/site-packages),
 'django-authtools': django-authtools 1.2.0 (/XXX/.virtualenvs/tmp-d05746e109b81142/lib/python2.7/site-packages),
 'pip': pip 6.0.8 (/XXX/.virtualenvs/tmp-d05746e109b81142/lib/python2.7/site-packages),
 'python': Python 2.7.10 (/usr/lib64/python2.7/lib-dynload),
 'setuptools': setuptools 12.0.5 (/XXX/.virtualenvs/tmp-d05746e109b81142/lib/python2.7/site-packages),
 'wsgiref': wsgiref 0.1.2 (/usr/lib64/python2.7)}

@exp0nge
Copy link

exp0nge commented Oct 27, 2017

@alexsilva Did you ever figure this out?

edit: install from the repo directly with python setup.py install

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

3 participants