Open 1randomguy opened 3 years ago
Also running into this.
If you're running from pycharm, it's probably because the current working directory needs to be set. Make sure it's set to the /code folder
Same issue, using VScode
enter the code folder before starting the script
enter the code folder before starting the script
Didn't work
I had to modify the project structure AND the code. I'll post what I have later
My situation seems pretty niche but I did find a way to get it working, I'm using MacOS, VScode, python 3.9.5, using the code runner extension
So, I did use the edit which is linked above and code runner seemed to be using python rather than python3, So I have to type python3 -u 'prisonersDilemma.py' to run it
Hope this can help others
oh shoot, I'm not sure why that's happening for you! Yeah, for me, I do have to be in the '/code' folder before running the code to get it to run, but I've never run into the errors you guys are getting. I hope @hand-burger 's solution works for others as well
What I did was that I moved the example strategies folder outside of the folder prisonersDilemma.py
was in (I actually renamed prisonersDilemma.py
to __main__.py
in a folder called "algch" so I can just run python -m algch
to run the tournament)
i fixed this by doing this: inFolder = os.path.dirname(os.path.realpath(__file__)) + '/' + inFolder
Hey, I'm relativly new to python and I didn't find anything on this when googling. So when I tried running the code I got this errormessage:
It doesn't seem to be related to any of my code so I was wondering what caused it and how I would be able to fix it. I'm using Python 3.9 on Windows with PyCharm.