djtech42 / YikYakTerminal

Python implementation of Yik Yak using the pyak API by joseph346. Read, post, upvote, and downvote yaks.
GNU General Public License v2.0
73 stars 36 forks source link

Syntax Error #1

Closed yayitsjp closed 10 years ago

yayitsjp commented 10 years ago

Syntax Error occurs..

jp$ cd '/Users/jp/Downloads/YikYakTerminal-master/' && '/usr/bin/pythonw' '/Users/jp/Downloads/YikYakTerminal-master/YikYak.py' && echo Exit status: $? && exit 1 File "/Users/jp/Downloads/YikYakTerminal-master/YikYak.py", line 51 print ("\n\t\tComments:", end='')

djtech42 commented 10 years ago

It's only compatible with Python 3, so make sure you are using the command "python3 YikYak.py." The way the print statements are formatted isn't compatible with Python 2, which comes with OS X if that is what you are using.

yayitsjp commented 10 years ago

Ah, thank you for that. I ran and installed Python 3 for Mac OS X however it doesn't appear to have installed in place of Python 2.6

djtech42 commented 10 years ago

It won't install over Python 2.6 because that is reserved for the system to maintain compatibility. Python 2 is the version used for the regular python command. Python 3 should install separately and you can check if it is there by just running python3. You should get a message like: Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

yayitsjp commented 10 years ago

New error... Forgive me as I'm completely new to this and trying to learn.

Google Geocoding API has reached the limit of queries.

Please enter coordinates manually: Latitude: 40.0373 Longitude: 75.1455

Traceback (most recent call last): File "YikYak.py", line 124, in main() File "YikYak.py", line 37, in main remoteyakker = pk.Yakker(None, coordlocation, False) File "/Users/jp/Downloads/YikYakTerminal-master/API.py", line 155, in init self.register_id_new(user_id) File "/Users/jp/Downloads/YikYakTerminal-master/API.py", line 174, in register_id_new result = self.get("registerUser", params) File "/Users/jp/Downloads/YikYakTerminal-master/API.py", line 234, in get return requests.get(url, params=params, headers=headers) AttributeError: 'module' object has no attribute 'get' JPMAC:YikYakTerminal-master jp$

djtech42 commented 10 years ago

Did you install requests from here: http://docs.python-requests.org/en/latest/user/install/#install

yayitsjp commented 10 years ago

Yeah, that was one of the first things I did. Perhaps I installed it into the wrong directory or perhaps I need a reboot?

djtech42 commented 10 years ago

I think it might have been installed in the system directory for Python rather than Python 3.

yayitsjp commented 10 years ago

Bingo. I think you nailed it. Let me fix that. Python 3 is a standalone on OS X and I installed it on the console version.

djtech42 commented 10 years ago

It looks like you can move the requests folder to /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/

/Library/Frameworks/Python.framework/Versions/3.4/ is the directory for Python 3.4.

djtech42 commented 10 years ago

Actually, I think you just have to run: "python3.4 -m pip install requests"

This will automatically install in the right directory for 3.4

yayitsjp commented 10 years ago

Yeah, I got it fixed. I got all the syntaxes working, however no dice on the feed. I assume I had to replace the API link in API.py file? I did it and no dice.

yayitsjp commented 10 years ago

Ah, nevermind. I was under the impression i had to replace the API script manually. I got it working. Thanks for all the help. I appreciate you helping out a newbie.