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 #18

Closed
asuna opened this issue Feb 15, 2015 · 5 comments
Closed

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

asuna opened this issue Feb 15, 2015 · 5 comments

Comments

@asuna
Copy link

asuna commented Feb 15, 2015

root@dedi-fr-25527:~/iScript# ./pan.baidu.com.py 
Traceback (most recent call last):
  File "./pan.baidu.com.py", line 8, in <module>
    from requests_toolbelt import MultipartEncoder
  File "/usr/local/lib/python2.7/dist-packages/requests_toolbelt/__init__.py", line 19, in <module>
    from .adapters import SSLAdapter, SourceAddressAdapter
  File "/usr/local/lib/python2.7/dist-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
    from .ssl import SSLAdapter
  File "/usr/local/lib/python2.7/dist-packages/requests_toolbelt/adapters/ssl.py", line 13, in <module>
    from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named packages.urllib3.poolmanager

之前centos下用着一直没问题,这次换Ubuntu (14.04) 下用就报错了

@PeterDing
Copy link
Owner

@asuna 贴一下下面命令的结果

ls -l /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3

@0cean
Copy link

0cean commented Feb 15, 2015

注销重新登录再下载,之前115遇到此类报错,可以解决。
Sent using CloudMagic
On 周日, 2月 15, 2015 at 8:12 下午, asuna notifications@github.com wrote:root@dedi-fr-25527:~/iScript# ./pan.baidu.com.py
Traceback (most recent call last):
File "./pan.baidu.com.py", line 8, in
from requests_toolbelt import MultipartEncoder
File "/usr/local/lib/python2.7/dist-packages/requests_toolbelt/init.py", line 19, in
from .adapters import SSLAdapter, SourceAddressAdapter
File "/usr/local/lib/python2.7/dist-packages/requests_toolbelt/adapters/init.py", line 12, in
from .ssl import SSLAdapter
File "/usr/local/lib/python2.7/dist-packages/requests_toolbelt/adapters/ssl.py", line 13, in
from requests.packages.urllib3.poolmanager import PoolManager
ImportError: No module named packages.urllib3.poolmanager

之前centos下用着一直没问题,这次换Ubuntu (14.04) 下用就报错了

—Reply to this email directly or view it on GitHub.

@asuna
Copy link
Author

asuna commented Feb 16, 2015

root@dedi-fr-25527:~# ls -l /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3
ls: cannot access /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3: No such file or directory

@PeterDing
Copy link
Owner

@asuna 你好像没有装 requests
试试:

pip install requests

pip 是python2的pip

@asuna
Copy link
Author

asuna commented Feb 16, 2015

requests之前安装了,upgrade下就好了...

root@dedi-fr-25527:~# pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages
Cleaning up...
root@dedi-fr-25527:~# pip install requests --upgrade
Downloading/unpacking requests from https://pypi.python.org/packages/py2.py3/r/requests/requests-2.5.1-py2.py3-none-any.whl#md5=11dc91bc96c5c5e0b566ce8f9c9644ab
  Downloading requests-2.5.1-py2.py3-none-any.whl (464kB): 464kB downloaded
Installing collected packages: requests
  Found existing installation: requests 2.2.1
    Uninstalling requests:
      Successfully uninstalled requests
Successfully installed requests
Cleaning up...
root@dedi-fr-25527:~# ./p^C
root@dedi-fr-25527:~# ./iScript/pan.baidu.com.py 
usage: https://github.com/PeterDing/iScript#pan.baidu.com.py

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