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

SyntaxError: invalid syntax #415

Open
Natsu-2 opened this issue Sep 8, 2020 · 3 comments
Open

SyntaxError: invalid syntax #415

Natsu-2 opened this issue Sep 8, 2020 · 3 comments

Comments

@Natsu-2
Copy link

Natsu-2 commented Sep 8, 2020

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

@TotallyNotChase
Copy link

which python version are you running?

@YashVadhadiya
Copy link

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.

@YashVadhadiya
Copy link

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)

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