SyntaxError: invalid syntax
whenever i try to import requests_html
i get this error-->
Traceback (most recent call last):
File "F:/python programs/ne.py", line 115, in
which python version are you running?
whenever i try to import requests_html i get this error--> Traceback (most recent call last): File "F:/python programs/ne.py", line 115, in import requests_html File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests_html.py", line 13, in from fake_useragent import UserAgent File "E:\PyCharm Community Edition 2020.1.1\index\heloo\lib\site-packages\fake_useragent__init__.py", line 4, in from fake_useragent.fake import FakeUserAgent, UserAgent # noqa # isort:skip File "E:\PyCharm Community Edition 2020.1.1\index\heloo\lib\site-packages\fake_useragent\fake.py", line 10, in from fake_useragent.utils import load, load_cached, str_types, update File "E:\PyCharm Community Edition 2020.1.1\index\heloo\lib\site-packages\fake_useragent\utils.py", line 15, in from urllib2 import urlopen, Request, URLError File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib2.py", line 220 raise AttributeError, attr ^ SyntaxError: invalid syntax
Try for python 3.8 64 bit install this 64-bit version and then try it. Upgrade your pip using (pip install --upgrade pip) then try for reinstall (pip install requests-html) almost your error should be cleared.
whenever i try to import requests_html i get this error--> Traceback (most recent call last): File "F:/python programs/ne.py", line 115, in import requests_html File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests_html.py", line 13, in from fake_useragent import UserAgent File "E:\PyCharm Community Edition 2020.1.1\index\heloo\lib\site-packages\fake_useragent__init__.py", line 4, in from fake_useragent.fake import FakeUserAgent, UserAgent # noqa # isort:skip File "E:\PyCharm Community Edition 2020.1.1\index\heloo\lib\site-packages\fake_useragent\fake.py", line 10, in from fake_useragent.utils import load, load_cached, str_types, update File "E:\PyCharm Community Edition 2020.1.1\index\heloo\lib\site-packages\fake_useragent\utils.py", line 15, in from urllib2 import urlopen, Request, URLError File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib2.py", line 220 raise AttributeError, attr ^ SyntaxError: invalid syntax
Your syntax for requests_html is replaced by requests-html for install this try to run (pip install requests-html)