TomWagg / cogsworth

A Python package for performing self-consistent population synthesis and galactic dynamics simulations
https://cogsworth.readthedocs.io/
MIT License
16 stars 3 forks source link

Installation error #134

Closed saraghl closed 1 month ago

saraghl commented 1 month ago

Hello, I am trying to install the cogsworth using the conda environment. But I run into this error:

 error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      + meson setup C:\Users\RTS\AppData\Local\Temp\pip-install-mqih68kw\cosmic-popsynth_fd5352a1e53c4317b0f46b96e97b8681 C:\Users\RTS\AppData\Local\Temp\pip-install-mqih68kw\cosmic-popsynth_fd5352a1e53c4317b0f46b96e97b8681\.mesonpy-kfq6eaob -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\RTS\AppData\Local\Temp\pip-install-mqih68kw\cosmic-popsynth_fd5352a1e53c4317b0f46b96e97b8681\.mesonpy-kfq6eaob\meson-python-native-file.ini
      The Meson build system
      Version: 1.5.1
      Source dir: C:\Users\RTS\AppData\Local\Temp\pip-install-mqih68kw\cosmic-popsynth_fd5352a1e53c4317b0f46b96e97b8681
      Build dir: C:\Users\RTS\AppData\Local\Temp\pip-install-mqih68kw\cosmic-popsynth_fd5352a1e53c4317b0f46b96e97b8681\.mesonpy-kfq6eaob
      Build type: native build
      Project name: cosmic
      Project version: 3.4.16
      WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe

      ..\meson.build:1:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
      The following exception(s) were encountered:
      Running `ifort --version` gave "[WinError 2] The system cannot find the file specified"
      Running `ifort -V` gave "[WinError 2] The system cannot find the file specified"
      Running `gfortran --version` gave "[WinError 2] The system cannot find the file specified"
      Running `gfortran -V` gave "[WinError 2] The system cannot find the file specified"
      Running `flang --version` gave "[WinError 2] The system cannot find the file specified"
      Running `flang -V` gave "[WinError 2] The system cannot find the file specified"
      Running `pgfortran --version` gave "[WinError 2] The system cannot find the file specified"
      Running `pgfortran -V` gave "[WinError 2] The system cannot find the file specified"
      Running `g95 --version` gave "[WinError 2] The system cannot find the file specified"
      Running `g95 -V` gave "[WinError 2] The system cannot find the file specified"

      A full log can be found at C:\Users\RTS\AppData\Local\Temp\pip-install-mqih68kw\cosmic-popsynth_fd5352a1e53c4317b0f46b96e97b8681\.mesonpy-kfq6eaob\meson-logs\meson-log.txt
      [end of output]

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

× Encountered error while generating package metadata.

I tried some ways to fix this error including changing the version of Python, and upgrading pip, setuptools, and wheel. but none of them worked. I appreciate your help with this issue.

TomWagg commented 1 month ago

Hi @saraghl - from the paths in your error message, am I correct in thinking you're installing this on Windows?

COSMIC and Gala (the two core dependencies of cogsworth) have some trouble installing on Windows because the C and fortran compilers are not available by default. (The error message you see above is for the installation of COSMIC)

I think some people have had success using Windows Subsystem for Linux in the past to get around that, you could perhaps try installing that (here's a comment from Gala about it)? Or alternatively if you have access to a non-Windows machine the installation should work there!

TomWagg commented 1 month ago

Hi @saraghl, just checking in whether you've had any luck with this?

saraghl commented 1 month ago

Hello Tom, I hope you are doing well.

I installed Linux based on your advice, and fortunately, I was able to easily install Cogsworth afterward.

Thank you for your help.

Bests, Sara

On Fri, Sep 20, 2024 at 15:47 Tom Wagg @.***> wrote:

Hi @saraghl https://github.com/saraghl, just checking in whether you've had any luck with this?

— Reply to this email directly, view it on GitHub https://github.com/TomWagg/cogsworth/issues/134#issuecomment-2364513578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVGRXX55L7XPYDDEWGF3G33ZXR3UXAVCNFSM6AAAAABOHBWL3GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRUGUYTGNJXHA . You are receiving this because you were mentioned.Message ID: @.***>

TomWagg commented 1 month ago

Glad to hear it Sara!