FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: Documentation not so clear that a C/C++-compiler is required to install from source · Issue #24359 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: Documentation not so clear that a C/C++-compiler is required to install from source #24359

Closed

Description

Bug summary

i am building documentation but there's an error occured here.

Code for reproduction

follow the documentation
https://matplotlib.org/stable/devel/development_setup.html#installing-for-devs

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

Activity

  1. oscargus commented on Nov 4, 2022

    Member

    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.

  2. changed the title [-][Bug]: [/-] [+][Bug]: Documentation not so clear that a C/C++-compiler is required to install from source[/+] on Nov 4, 2022
  3. story645 commented on Nov 4, 2022

    Member

    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?

  4. jklymak commented on Nov 4, 2022

    Member

    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 pip install -e . to install the dev version. However, you still need a c compiler for our c code.

    I'm going to close, but feel free to re-open if there is some action we can take.

  5. timhoffm commented on Nov 4, 2022

    Member

    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

    • Install Matplotlib in editable mode
    • Install additional development dependencies

    If we first tell people to install all dev dependencies, then compiler is there when they follow the instructions.

  6. story645 commented on Nov 4, 2022

    Member

    Note almost nobody has to build freetype: install matplotlib via conda, and then do pip install -e . to install the dev version

    Windows is weird and I think I had to try like six things and vcpkg is maybe what worked.

  7. a-sajjad72 commented on Nov 5, 2022

    Author

    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

    • Install Matplotlib in editable mode
    • Install additional development dependencies

    If we first tell people to install all dev dependencies, then compiler is there when they follow the instructions.

    yes this will be good for better understanding and for future contributors
    and thanks to all of you guys it scuccesfully installed

  8. ksunden commented on Nov 5, 2022

    Member

    I'm going to say this was closed by #24368, which does the reordering suggested earlier in this thread.

  9. added this to the v3.6.3 milestone on Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL