You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Doc]: Instructions for editable installation on Windows potentially missing a step #27168
The documentation states to install the Visual Studio Build Tools and through these the latest MSVC, "C++ CMake tools for Windows," and a Windows SDK.
Even though I did that (and rebooted), the editable install did not work. The installation process and compilation itself seemed to be working fine. At least, I couldn't spot any obvious errors in the output. But Matplotlib failed to import due to some DLLs not being found.
What fixed it for me, was running the following command:
Obviously, path and architecture may be different for other users. But it seems this step is necessary to correctly set up the environment. I'm not very familiar with this MSVC stuff though, so maybe this was some peculiarity on my system? Someone who knows more about this should decide whether this is right or not.
Suggested improvement
Add a note to run this command before the editable install.
I think I figured out the specific problem I have. I had a stray installation of GCC and related tools on my system, courtesy of Strawberry Perl. Their installer adds that folder to the system PATH variable without asking or explicitly telling.
Meson seems to prefer to use GCC when it's available like that. Pip finishes with Successfully installed matplotlib-3.9.0.dev0, so everything looks correct. But the installed build of Matplotlib cannot be imported.
The problem is reliably reproducible for me.
Forcing msvc, as suggested, fixes the problem as well.
Maybe it would be a good idea, to always force msvc on windows?
I did not initially force MSVC, because theoretically one may want to use other compilers (e.g., Cygwin), and we don't actually require anything specially from MSVC. Though as this seems to keep tripping up people, it may be better to make this the default and have the other less-common option go through the hoop of turning it off instead.
Though as this seems to keep tripping up people, it may be better to make this the default and have the other less-common option go through the hoop of turning it off instead.
Could also add a sentence linking the troubleshooting entry in the install docs. At the end of the section, a sentence like
folks building on windows may need to :ref:`force msvc <link to troubleshooting entry>.
Activity
story645 commentedon Oct 23, 2023
I didn't have to run this command to install on my windows machine, but I did have to force msvc. What about adding it as a troubleshooting entry: https://matplotlib.org/devdocs/devel/troubleshooting.html
QuLogic commentedon Oct 24, 2023
Are you installing in a conda environment or a venv?
theOehrly commentedon Oct 24, 2023
I'm installing in a venv.
I think I figured out the specific problem I have. I had a stray installation of GCC and related tools on my system, courtesy of Strawberry Perl. Their installer adds that folder to the system PATH variable without asking or explicitly telling.
Meson seems to prefer to use GCC when it's available like that. Pip finishes with
Successfully installed matplotlib-3.9.0.dev0, so everything looks correct. But the installed build of Matplotlib cannot be imported.The problem is reliably reproducible for me.
Forcing msvc, as suggested, fixes the problem as well.
Maybe it would be a good idea, to always force msvc on windows?
QuLogic commentedon Oct 27, 2023
Ah yes, Strawberry Perl is something.
I did not initially force MSVC, because theoretically one may want to use other compilers (e.g., Cygwin), and we don't actually require anything specially from MSVC. Though as this seems to keep tripping up people, it may be better to make this the default and have the other less-common option go through the hoop of turning it off instead.
story645 commentedon Oct 28, 2023
Could also add a sentence linking the troubleshooting entry in the install docs. At the end of the section, a sentence like
theOehrly commentedon Oct 29, 2023
In my opinion, that would be a good solution as well. I somehow found the troubleshooting section easy to miss.
story645 commentedon Oct 30, 2023
I went slightly more general, but does the solution in #27226 work for you? If not, what should I add?
theOehrly commentedon Oct 30, 2023
I think that's a good solution 👍
I'll close this because the problem I had is resolved and docs have been improved.