Cannot compile 'Python.h'. is shown in Msys2 when I typed pip install pretty_midi












0














I am using MSYS2 (Mingw-w64 64bit) on Windows8.1.

And I try to install pretty_midi, a python package for midi manipulation.



At first, I typed



pacman -Ss pretty_midi


but there was no reply.
So I typed



pip install pretty_midi


then many messages appeared and at the end,



    removing: _configtest.c _configtest.o
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 403, in <module>
setup_package()
File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 395, in setup_package
setup(**metadata)
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 62, in run
r = self.setuptools_run()
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
return distutils_install.run(self)
File "/usr/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build.py", line 47, in run
old_build.run(self)
File "/usr/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 148, in run
self.build_sources()
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 165, in build_sources
self.build_extension_sources(ext)
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
sources = self.generate_sources(sources, ext)
File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 422, in generate_config_h
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
File "numpy/core/setup.py", line 48, in check_types
out = check_types(*a, **kw)
File "numpy/core/setup.py", line 281, in check_types
"install {0}-dev|{0}-devel.".format(python))
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-a_6erlui/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-dka2y2vl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-a_6erlui/numpy/


the system tried to install numpy, and by this reason,



SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.


it stopped.
I searched for python-dev, but it seems to be no package corresponds to it in pacman.



I googled a lot, but I can't find the exact answer.

How can I solve this, and install pretty_midi on my MSYS2 system?



Thank you.










share|improve this question



























    0














    I am using MSYS2 (Mingw-w64 64bit) on Windows8.1.

    And I try to install pretty_midi, a python package for midi manipulation.



    At first, I typed



    pacman -Ss pretty_midi


    but there was no reply.
    So I typed



    pip install pretty_midi


    then many messages appeared and at the end,



        removing: _configtest.c _configtest.o
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 403, in <module>
    setup_package()
    File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 395, in setup_package
    setup(**metadata)
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/core.py", line 169, in setup
    return old_setup(**new_attr)
    File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
    return distutils.core.setup(**attrs)
    File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
    File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
    File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 62, in run
    r = self.setuptools_run()
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
    return distutils_install.run(self)
    File "/usr/lib/python3.7/distutils/command/install.py", line 545, in run
    self.run_command('build')
    File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build.py", line 47, in run
    old_build.run(self)
    File "/usr/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
    File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 148, in run
    self.build_sources()
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 165, in build_sources
    self.build_extension_sources(ext)
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
    sources = self.generate_sources(sources, ext)
    File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
    source = func(extension, build_dir)
    File "numpy/core/setup.py", line 422, in generate_config_h
    moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
    File "numpy/core/setup.py", line 48, in check_types
    out = check_types(*a, **kw)
    File "numpy/core/setup.py", line 281, in check_types
    "install {0}-dev|{0}-devel.".format(python))
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    ----------------------------------------
    Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-a_6erlui/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-dka2y2vl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-a_6erlui/numpy/


    the system tried to install numpy, and by this reason,



    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.


    it stopped.
    I searched for python-dev, but it seems to be no package corresponds to it in pacman.



    I googled a lot, but I can't find the exact answer.

    How can I solve this, and install pretty_midi on my MSYS2 system?



    Thank you.










    share|improve this question

























      0












      0








      0







      I am using MSYS2 (Mingw-w64 64bit) on Windows8.1.

      And I try to install pretty_midi, a python package for midi manipulation.



      At first, I typed



      pacman -Ss pretty_midi


      but there was no reply.
      So I typed



      pip install pretty_midi


      then many messages appeared and at the end,



          removing: _configtest.c _configtest.o
      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 403, in <module>
      setup_package()
      File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 395, in setup_package
      setup(**metadata)
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/core.py", line 169, in setup
      return old_setup(**new_attr)
      File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
      return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 62, in run
      r = self.setuptools_run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
      return distutils_install.run(self)
      File "/usr/lib/python3.7/distutils/command/install.py", line 545, in run
      self.run_command('build')
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build.py", line 47, in run
      old_build.run(self)
      File "/usr/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 148, in run
      self.build_sources()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 165, in build_sources
      self.build_extension_sources(ext)
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
      sources = self.generate_sources(sources, ext)
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
      source = func(extension, build_dir)
      File "numpy/core/setup.py", line 422, in generate_config_h
      moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
      File "numpy/core/setup.py", line 48, in check_types
      out = check_types(*a, **kw)
      File "numpy/core/setup.py", line 281, in check_types
      "install {0}-dev|{0}-devel.".format(python))
      SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
      ----------------------------------------
      Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-a_6erlui/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-dka2y2vl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-a_6erlui/numpy/


      the system tried to install numpy, and by this reason,



      SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.


      it stopped.
      I searched for python-dev, but it seems to be no package corresponds to it in pacman.



      I googled a lot, but I can't find the exact answer.

      How can I solve this, and install pretty_midi on my MSYS2 system?



      Thank you.










      share|improve this question













      I am using MSYS2 (Mingw-w64 64bit) on Windows8.1.

      And I try to install pretty_midi, a python package for midi manipulation.



      At first, I typed



      pacman -Ss pretty_midi


      but there was no reply.
      So I typed



      pip install pretty_midi


      then many messages appeared and at the end,



          removing: _configtest.c _configtest.o
      Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 403, in <module>
      setup_package()
      File "/tmp/pip-install-a_6erlui/numpy/setup.py", line 395, in setup_package
      setup(**metadata)
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/core.py", line 169, in setup
      return old_setup(**new_attr)
      File "/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 140, in setup
      return distutils.core.setup(**attrs)
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 62, in run
      r = self.setuptools_run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
      return distutils_install.run(self)
      File "/usr/lib/python3.7/distutils/command/install.py", line 545, in run
      self.run_command('build')
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build.py", line 47, in run
      old_build.run(self)
      File "/usr/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 148, in run
      self.build_sources()
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 165, in build_sources
      self.build_extension_sources(ext)
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
      sources = self.generate_sources(sources, ext)
      File "/tmp/pip-install-a_6erlui/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
      source = func(extension, build_dir)
      File "numpy/core/setup.py", line 422, in generate_config_h
      moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
      File "numpy/core/setup.py", line 48, in check_types
      out = check_types(*a, **kw)
      File "numpy/core/setup.py", line 281, in check_types
      "install {0}-dev|{0}-devel.".format(python))
      SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
      ----------------------------------------
      Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-a_6erlui/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-dka2y2vl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-a_6erlui/numpy/


      the system tried to install numpy, and by this reason,



      SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.


      it stopped.
      I searched for python-dev, but it seems to be no package corresponds to it in pacman.



      I googled a lot, but I can't find the exact answer.

      How can I solve this, and install pretty_midi on my MSYS2 system?



      Thank you.







      python numpy pip msys2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 17:40









      exp

      12




      12





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241683%2fcannot-compile-python-h-is-shown-in-msys2-when-i-typed-pip-install-pretty-mid%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241683%2fcannot-compile-python-h-is-shown-in-msys2-when-i-typed-pip-install-pretty-mid%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()