python-linkedin icon indicating copy to clipboard operation
python-linkedin copied to clipboard

Syntax error

Open dontknowwat opened this issue 9 years ago • 13 comments

Traceback (most recent call last):
File "link-api.py", line 1, in <module>
from linkedin import linkedin
File "/home/leo_g/python-linkenin/venv/lib/python3.4/site-packages/linkedin/linkedin.py", line 294
except (requests.ConnectionError, requests.HTTPError), error:

I get the above error during installation and while trying to execute code.

I am using python3 on centos 7,

any help is apreciated

dontknowwat avatar Jan 03 '15 09:01 dontknowwat

Same here. OS X python 3.4, package mgmt via conda

dgonzo avatar Jan 21 '15 05:01 dgonzo

I get the same error as well. Running Windows Python 3.4 via Anaconda3. Any help much appreciated here.

File "C:\Users\Samir\Anaconda3\lib\site-packages\linkedin\linkedin.py", line 294
    except (requests.ConnectionError, requests.HTTPError), error:
                                                         ^
SyntaxError: invalid syntax

samirmrao avatar Jan 28 '15 18:01 samirmrao

Same here.

python: 3.4 Mac: Yosemite

Request Method: GET Request URL: http://localhost:8000/ Django Version: 1.7.4 Exception Type: SyntaxError Exception Value:
invalid syntax (linkedin.py, line 294)

melvinma avatar Feb 18 '15 16:02 melvinma

I'm also getting the same issue. Any help would be appreciated. File "c:\pythonexplorer\Python34\lib\site-packages\linkedin\linkedin.py", line 294 except (requests.ConnectionError, requests.HTTPError), error: ^ SyntaxError: invalid syntax

nachal avatar Aug 16 '15 23:08 nachal

I'm also getting the same issue, please fix this man as soon as possible. Traceback (most recent call last): File "http_api.py", line 1, in from linkedin import linkedin File "/home/Saurabh/.virtualenvs/jobfinder/lib/python3.4/site-packages/linkedin/linkedin.py", line 294 except (requests.ConnectionError, requests.HTTPError), error: ^ SyntaxError: invalid syntax

d3prof3t avatar Aug 24 '15 14:08 d3prof3t

Also getting the same error, is there no work around for this? does it work in previous versions or something? Thanks

foogunlana avatar Sep 15 '15 09:09 foogunlana

Traceback (most recent call last): File "http_api.py", line 17, in from linkedin.linkedin import LinkedInAuthentication, LinkedInApplication, PERMISSIONS File "/usr/local/var/pyenv/versions/3.5.1/lib/python3.5/site-packages/linkedin/linkedin.py", line 294 except (requests.ConnectionError, requests.HTTPError), error: ^ SyntaxError: invalid syntax

I'm getting this error too. I'm on 3.5.1

DerekChia avatar Dec 26 '15 11:12 DerekChia

the solution is just change the linkedin folder in the python package with the downloaded folder named linkedin and it will work with you

kamalelsaaid avatar Feb 22 '16 16:02 kamalelsaaid

File "C:\Users\admin\Anaconda3\lib\site-packages\linkedin\linkedin.py", line 294 except (requests.ConnectionError, requests.HTTPError), error:

aidiss avatar Aug 03 '16 12:08 aidiss

@Leo-G seems like a connection error. Are you connected to internet>

Traceback (most recent call last):
File "link-api.py", line 1, in <module>
from linkedin import linkedin
File "/home/leo_g/python-linkenin/venv/lib/python3.4/site-packages/linkedin/linkedin.py", line 294
except (requests.ConnectionError, requests.HTTPError), error:

arpit1997 avatar Oct 31 '16 08:10 arpit1997

Just reviving this thread... The error has nothing to do with a connection problem (it states "invalid syntax"). The LinkedIn API only works on python 2, you have to upgrade it: pip install --upgrade https://github.com/ozgur/python-linkedin/tarball/master

gkohnen avatar Jul 11 '17 07:07 gkohnen

@gkohnen Thank you so much! Nailed it with your answer.

WillZzzz avatar Nov 20 '17 01:11 WillZzzz

@gkohnen it also solves my problem too. Thank you so much!

zhiiiyang avatar Jun 20 '20 23:06 zhiiiyang