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

ImportError: No module named packages.urllib3.poolmanager #617

Closed
vrtx64 opened this issue May 12, 2015 · 13 comments
Closed

ImportError: No module named packages.urllib3.poolmanager #617

vrtx64 opened this issue May 12, 2015 · 13 comments

Comments

@vrtx64
Copy link

vrtx64 commented May 12, 2015

Hi!
Have error:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 280, in execute
    translation.activate('en-us')
  File "/usr/lib/python2.7/dist-packages/django/utils/translation/__init__.py", line 130, in activate
    return _trans.activate(language)
  File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 188, in activate
    _active.value = translation(language)
  File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 177, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 159, in _fetch
    app = import_module(appname)
  File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/social/apps/django_app/__init__.py", line 17, in <module>
    from social.strategies.utils import set_current_strategy_getter
  File "/usr/local/lib/python2.7/dist-packages/social/strategies/utils.py", line 1, in <module>
    from social.utils import module_member
  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
@vrtx64
Copy link
Author

vrtx64 commented May 12, 2015

Resolved issue by change in /social/utils.py

from requests.packages.urllib3.poolmanager import PoolManager

to

from urllib3.poolmanager import PoolManager

@marekjalovec
Copy link
Contributor

Ad a newer version of requests to your requirements

requests>=2.5.1

@omab omab closed this as completed in 80ceb11 May 29, 2015
@MingweiSamuel
Copy link

@marekjalovec I am having the same problem as mentioned in this thread, using python3

I have the following relevant packages installed via pip3

oauthlib (0.7.2)
PyJWT (1.3.0)
python-social-auth (0.2.11)
python3-openid (3.0.5)
requests (2.7.0)
requests-oauthlib (0.5.0)
six (1.9.0)
urllib3 (1.10.4)

I get a slightly different error from manage.py (django):

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/usr/local/lib/python3.4/dist-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.4/dist-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/usr/local/lib/python3.4/dist-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1448, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/local/lib/python3.4/dist-packages/social/apps/django_app/default/models.py", line 8, in <module>
    from social.utils import setting_name
  File "/usr/local/lib/python3.4/dist-packages/social/utils.py", line 13, in <module>
    from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named 'requests.packages'

Any help is appreciated

@MingweiSamuel
Copy link

also the same fix mentioned by @vrtx64 fixed the error

@gvidon
Copy link

gvidon commented Aug 1, 2015

@marekjalovec thanks for proper solution!

@ojaved
Copy link

ojaved commented Sep 10, 2015

@marekjalovec I am getting the error even with requests>=2.5.1 .
@vrtx64 fixes the error

@MingweiSamuel
Copy link

Can we get this reopened?
On Sep 9, 2015 5:16 PM, "ojaved" notifications@github.com wrote:

@marekjalovec https://github.com/marekjalovec I am getting the error
even with requests>=2.5.1 .
@vrtx64 https://github.com/vrtx64 fixes the error


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

@puneetagg
Copy link

Am also facing this issue. It's almost year old issue. Does anyone know how to deal with this.?

@omab
Copy link
Owner

omab commented Apr 15, 2016

I've bumped the depedencies versions for Python 2 and 3, that should get rid of this issue, python 3 dependencies where behind python 2.

@puneetagg
Copy link

@omab I checked with the new requirements as well. But still its stuck there.

@puneetagg
Copy link

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!

@sairambandaru
Copy link

sairambandaru commented Apr 25, 2016

Its resolved.I am Python using 2.7 got same issue
Try to import (from urllib3.poolmanager import PoolManager)

Thanks!

mojodna added a commit to posm/osm-export-tool2 that referenced this issue May 19, 2016
@saeidSE
Copy link

saeidSE commented Jun 19, 2022

Hi sorry how i fix it?
"from urllib3 import PoolManager
ModuleNotFoundError: No module named 'urllib3'"

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

9 participants