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

Getting import error using django-rest-framework-social-oauth2 #50

Closed
puneetagg opened this issue Apr 14, 2016 · 5 comments
Closed

Getting import error using django-rest-framework-social-oauth2 #50

puneetagg opened this issue Apr 14, 2016 · 5 comments
Labels

Comments

@puneetagg
Copy link
Contributor

I have followed all the instructions mentioned in the documentation for setup but I am getting import error. Below is the stacktrace:

Traceback (most recent call last):
File "/home/vaio/git_kiti/kiti/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/default/models.py", line 8, in <module>
from social.utils import setting_name
File "/usr/local/lib/python2.7/dist-packages/social/utils.py", line 13, in <module>
from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named packages.urllib3.poolmanager
@puneetagg puneetagg changed the title Getting error using django-rest-framework-social-oauth2 Getting import error using django-rest-framework-social-oauth2 Apr 14, 2016
@PhilipGarnero
Copy link
Collaborator

This is coming from python-social-auth.
Probably a version conflict with the requests package. See this commit.
Check the version of your requests package.

@puneetagg
Copy link
Contributor Author

It was 2.2 but now I have upgraded it to 2.9.1. Still facing the issue.

@PhilipGarnero
Copy link
Collaborator

We'll have to wait for them to fix it.
I can't really help you more than that.
Try commenting or +1 this issue
What I usually do when something isn't going to be fixed soon is forking the project, fixing it and then adding my fork in my requirements.txt (just before the other packages using it).

-e git+https://github.com/puneetagg/python-social-auth.git#egg=python-social-auth #needed for drfso2 while issue 617 isn't fixed
django-rest-framework-social-oauth2==1.0.4

@puneetagg
Copy link
Contributor Author

Thanks for suggesting the way in such situations.

@puneetagg
Copy link
Contributor Author

Its resolved. Python used for running application was of the system and I now changed it to that of my virtual env. May be that's why requests module was being picked from the system instead of virtaulenv.

Thanks!

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

No branches or pull requests

2 participants