I'm trying to install poliastro on windows 10 through pip. I have pip updated to the latest version; however, every time I try to install poliastro, I keep getting the error message in the title, which is preceded by error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe' failed with exit code 2

Here's the full code snippet (this is with astropy uninstalled):

      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for astropy
Failed to build astropy
ERROR: Could not build wheels for astropy, which is required to install pyproject.toml-based projects

I tried uninstalling and reinstalling astropy, installing poliastro with and without astropy installed, and running it through pycharm. Regardless, I still get the error above. I cannot run anaconda on my computer due to lack of memory. I assume the lack of memory is not the cause for the poliastro error though, since I have over 2GB free memory on my C drive. Installing other packages works fine.

I am not an experienced programmer, so I would appreciate a very basic, step by step answer if possible.

EDIT: I'm running python 3.11.5. I tried installing astropy v5 manually, and I got a new error, which I've never seen before: Here's the full code of the new error: '''

Microsoft Windows [Version 10.0.19045.3570]
(c) Microsoft Corporation. All rights reserved.

C:\Users\david>pip install astropy==5.0
Collecting astropy==5.0
  Using cached astropy-5.0.tar.gz (7.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      astropy\wcs\setup_package.py:12: SetuptoolsDeprecationWarning: dep_util is Deprecated. Use functions from setuptools.modified instead.
      !!

              ********************************************************************************
              Please use `setuptools.modified` instead of `setuptools.dep_util`.

              By 2024-May-21, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://github.com/pypa/setuptools/pull/4069 for details.
              ********************************************************************************

      !!
        from setuptools.dep_util import newer_group
      Traceback (most recent call last):
        File "D:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 68, in <module>
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\extension_helpers\_setup_helpers.py", line 67, in get_extensions
          ext_modules.extend(setuppkg.get_extensions())
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
        File ".\astropy\modeling\setup_package.py", line 59, in get_extensions
          from jinja2 import Environment, FileSystemLoader
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\jinja2\__init__.py", line 33, in <module>
          from jinja2.environment import Environment, Template
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\jinja2\environment.py", line 15, in <module>
          from jinja2 import nodes
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\jinja2\nodes.py", line 19, in <module>
          from jinja2.utils import Markup
        File "C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\jinja2\utils.py", line 642, in <module>
          from markupsafe import Markup, escape, soft_unicode
      ImportError: cannot import name 'soft_unicode' from 'markupsafe' (C:\Users\david\AppData\Local\Temp\pip-build-env-p0aw2x30\overlay\Lib\site-packages\markupsafe\__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.

'''

0

There are 0 best solutions below