-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
error in executing the first line of Demo.py #80
Comments
That's really odd. It seems like it's trying to execute line 2242 of "ConsIndShockModel.py" without also executing line 2243, which is what the + \ at the end is telling it to do Are you using Spyder? How are you executing Python code? Have you changed any of the files at all? |
I found that changing line 2242 into |
Hmmmmm yeah that sounds very possible. HARK is written for and tested in Python 2.7 I'd recommend downloading and installing Python 2.7 if you want to use HARK. If that doesn't fix the problem, please let me know |
Thanks David. I'll just check how far it can go with Python 3. |
I can confirm that the error described above occurs under python 3, but not python 2. Here is my effort to run the demo with Python 3:
...the same error. Under Python2.7:
As @dclow noted, HARK has been written for Python 2.7; unfortunately this appears to be one of the places that Python 2/3 differences crop up. Ideally our code would run under both, but as noted above it has only been tested in Python 2.7. There may be more to be said on this. Thanks for catching this. (Not closing the issue just yet.) |
@compumetrika @dclow Thanks for the help. I also confirmed that I could run it on Python 2.7 on my machine without any issues. |
Should we close this issue now, and replace it with one entitled "make HARK compatible with Python 3"? |
Closing because no one has objected to my suggestion for three months. |
Hi,
I am a new comer here. Forgive me if my question sounds stupid.
I run into problem when running the first line of Demo.py (under the folder "ConsumptionSaving")
from ConsIndShockModel import IndShockConsumerType
All that I did was just to enter that folder and execute this first line. The error message is:
File "C:\Users...\Documents\Python\HARK\ConsumptionSaving\ConsIndShockModel.py", line 2242
*raise Exception, "grid_type not recognized in init." + *
^
SyntaxError: invalid syntax
I use Anaconda. Any insight? Thanks.
The text was updated successfully, but these errors were encountered: