-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Pin Matplotlib < 3.1.1 to avoid mutiprocessing MacOS error #3912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good.
You could add a manual downgrade of the installed matplotlib in create_testenv.sh
line 45 ?
I'd rather and create a new issue for taking it back out when matplotlib/matplotlib#15410 is fixed. |
@michaelosthege I could use your help here: do you see what I'm doing wrong? 🤔 |
Wow, that looks super weird! |
Exactly 😅 I'll try with the quotes but I'm skeptical, as I already had quotes on earlier tries with relative installs ( |
This is definitely a mystery: now it uninstalls MPL 3.2.1, downloads 3.1.0... but installs 3.1.3 😅 (see lines 522 and 535 in Travis). |
Codecov Report
@@ Coverage Diff @@
## master #3912 +/- ##
=======================================
Coverage 83.45% 83.45%
=======================================
Files 103 103
Lines 14178 14178
=======================================
Hits 11832 11832
Misses 2346 2346 |
@michaelosthege, after multiple attempts, tests finally passed 🍾 |
It worked 🎉 And I think I understand why: it probably comes from the In a nutshell, if |
I agree.
…On Wed, May 6, 2020 at 5:14 PM Alexandre ANDORRA ***@***.***> wrote:
It worked 🎉 And I think I understand why: it probably comes from the
--ignore-installed flag, used lines 46 and 47 of create_testenv.sh. As
explained in this SO thread
<https://stackoverflow.com/questions/51913361/difference-between-pip-install-options-ignore-installed-and-force-reinstall/51916623>,
this flag doesn't uninstall previous versions of packages -- it just
ignores them. As a result, you can end up with multiple versions of MPL in
the venv, which is why I had to uninstall MPL thre times -- until the most
recent version could be 3.1.0
In a nutshell, if --ignore-installed is here to ensure packages are
reinstalled each time, I think we should use --force-reinstall instead --
much safer, as it will uninstall previous versions before installing new
ones. If you agree, I'll make the change (maybe in another PR?).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3912 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFETGFBVG6JBYMXQ2UAGMTRQF5GRANCNFSM4MY6BWAA>
.
|
Can you please check https://bugs.python.org/issue33725 In particular https://bugs.python.org/issue33725#msg329923 which suggests that adding mp.set_start_method('forkserver') will fix this problem on all versions of python3 (the reason upgrading to 3.8.2 is that this is now the default). This seems like a better fix than forcing an old Matplotlib version.
This is not a MPL bug, this is a python + multi-process + OSX bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if the forkserver thing fixes the problem instead.
Thanks a lot for the proposed solution @tacaswell ! Depending on the answer, it seems to me that the fix could be incorporated into PyMC source code (where is to be determined), or added by each user individually if they encounter the bug. Am I right? |
We have to be aware that fork server isn't available on windows, so
|
Thanks for the link @lucianopaz, very useful!
Disclaimer: I'm punching well above my league here, so please tell me if I talk nonsense! |
@AlexAndorra Sorry for not being clearer. |
That's great! I didn't know about the
That sounds good to me.
I don't think it's necessary to also test the python version here. |
The default going forward is |
Ha ha, me neither @tacaswell 😅 What I think I understood is that this problem doesn't appear on python >= 3.8.2 anymore because the default start method was switched to @lucianopaz, thanks for the feedback 👌 I'll start marking the changes ASAP, probably on another PR as this is very different than this branch now. |
Closing this then to wait for other PR. |
This PR adresses #3849 by pinning Matplotlib to versions < 3.1.1.
This avoids an issue that appeared in MPL 3.1.1, where multiprocessing crashes on MacOS when plotting code is executed before code using multiprocessing -- see this issue on MPL repo.
The pin should be removed only when the issue is resolved on MPL side.
Should we keep #3849 open though, as a reminder?
In passing, I reordered requirements.txt alphabetically, to mirror requirements-dev.txt