How do I fix this error when I import requests?

Asked

Viewed 76 times

-1

python3.2/site-packages/requests/__init__.py", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/storage/emulated/0/com.hipipal.qpyplus/lib/python3.2/site-packages/urllib3/contrib/pyopenssl.py", line 147
    for prefix in [u'*.', u'.']:
                       ^
SyntaxError: invalid syntax
  • 2

    edit the question by placing the error code in question so we can help, so it is difficult

1 answer

0


You need to use version 2.7 of Python. Besides, the above error is not from the import of requests but pyopenssl. Do Pip install for python 3.

Remove the requests you installed and run the command:

pip3 install requests

Browser other questions tagged

You are not signed in. Login or sign up in order to post.