Closed aa452110 closed 3 years ago
I hate to say this but it works just fine on my machine (I checked Python 3.8.5 on Linux and 3.9.1 on Windows). Can you give some more information on your Python environment? Can you check if the bug persists in ipython or another non-PyCharm environment?
Thanks for the reply. I've now tried a mac, pc, and Linux(ubuntu). I'm running Python 3.9 on each and using PyCharm on each as well.
I get the same error on the Mac and PC (I've tried multiple PCs).
It does work, however, on my ubuntu setup.
I'm not sure what the issue, obviously. It looks like some sort of time-out issue when it goes to grab the statcast data that, for whatever reason, Ubuntu/Linux does not have a problem with.
Well, I solved it on my windows setups in PyCharm. I have not tried the same thing on my Mac setup, but I'm hopeful that would solve it too. Linux/Ubuntu just didn't need it.
I was just searching through StackOverflow here: https://stackoverflow.com/questions/15900366/all-example-concurrent-futures-code-is-failing-with-brokenprocesspool
I saw someone use a comment saying something about windows and using:
if name == 'main':
so, I tried this:
from pybaseball import statcast
if __name__ == '__main__':
stats = statcast()
stats.to_csv("yesterdays_statcast_data.cvs")
I've got no idea why that worked. But it did. Now when I run any statcast() function it pulls the data down just fine.
So, great day!
That's... wildly annoying, especially that it's only on windows. Not sure if there's a sensible way to protect this from the package level, maybe it's something we should consider adding a warning on though?
I'm closing this for now as we can't chase down every issue with Windows demons
First, thanks for all you do. Second, I'm a noob so I apologize. I've tried my darndest to solve the issue here.
In short, every function on pybaseball works great for me except the statcast(). (Statcast_batter() and statcast_pitcher(), for example, all work great.)
I use PyCharm on PC. I teach high school students python and would really like to add the pybaseball package as part of my curriculum.
But any statcast() call gives me the same error, no matter what I try. See below.
If you have any help or links or documentation I can read through to troubleshoot a solve it would be much appreciated.
Thank you. Brian
in:
statcast("2021-04-28")
out: