-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Documentation not so clear that a C/C++-compiler is required to install from source #24359
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
Comments
This is the reason: distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ Do you have that installed? If not, do please install it. Edit: I think the potential action here is to clarify that a C/C++-compiler is required. On Linux/Mac it is typically already there, but for Windows most users will have to explicitly install one. The docs could be clearer there. |
compilers are documented in the development docs https://matplotlib.org/devdocs/devel/dependencies.html#c-compiler @sajjad-ali60 is there something we could do to make it clearer that contributors always have to use the dev version of the build instructions? |
This is already documented on stable as well: https://matplotlib.org/stable/devel/dependencies.html#dependencies-for-building-matplotlib Note almost nobody has to build freetype: install matplotlib via conda, and then do I'm going to close, but feel free to re-open if there is some action we can take. |
We do not separately spell out build dependencies (I think these are a subset of the runtime dependencies plus the c compiler). While we could make that distinction, I think the simple solution here is to switch the section order at https://matplotlib.org/stable/devel/development_setup.html#install-matplotlib-in-editable-mode Currently, the order is
If we first tell people to install all dev dependencies, then compiler is there when they follow the instructions. |
Windows is weird and I think I had to try like six things and vcpkg is maybe what worked. |
yes this will be good for better understanding and for future contributors |
I'm going to say this was closed by #24368, which does the reordering suggested earlier in this thread. |
Bug summary
i am building documentation but there's an error occured here.
Code for reproduction
Actual outcome
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building editable for matplotlib
Failed to build matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects
Expected outcome
it should be succesfully build.
Additional information
here is the log:
Traceback (most recent call last):
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 140, in run
self._create_wheel_file(bdist_wheel)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 330, in _create_wheel_file
files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 261, in _run_build_commands
self._run_build_subcommands()
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 288, in _run_build_subcommands
self.run_command(name)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 987, in run_command
cmd_obj.run()
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 84, in run
_build_ext.run(self)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools_distutils\command\build_ext.py", line 346, in run
self.build_extensions()
File "", line 183, in build_extensions
File "E:\LECTURES\Documentation\Python\matplotlib\setupext.py", line 699, in do_custom_build
cc.initialize()
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools_distutils_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\msvc.py", line 214, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "C:\Users\HaLF-MenTaL\AppData\Local\Temp\pip-build-env-mlkau0ej\overlay\Lib\site-packages\setuptools\msvc.py", line 168, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Building freetype in build\freetype-2.6.1
error: Support for editable installs via PEP 660 was recently introduced
in
setuptools
. If you are seeing this error, please report to:https://github.com/pypa/setuptools/issues
Meanwhile you can try the legacy behavior by setting an
environment variable and trying to install again:
SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
error: subprocess-exited-with-error
× Building editable for matplotlib (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: 'E:\LECTURES\Documentation\Python\virtEnv\Scripts\python.exe' 'E:\LECTURES\Documentation\Python\virtEnv\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' build_editable 'C:\Users\HALF-M~1\AppData\Local\Temp\tmp576u6u2s'
cwd: E:\LECTURES\Documentation\Python\matplotlib
Building editable for matplotlib (pyproject.toml) ... error
ERROR: Failed building editable for matplotlib
Failed to build matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects
Operating system
Windows 10 Pro Version 22H2
Matplotlib Version
matplotlib 3.6.2
Matplotlib Backend
No response
Python version
3.10.8
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: