amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
158 stars 99 forks source link

Problem with AMUSE Development install #829

Closed tangtong98 closed 2 years ago

tangtong98 commented 2 years ago

Hello,

I had no trouble installing AMUSE, but I had a problem with AMUSE Development. I got an error when running "test_HRdiagram_cluster.py":No module named 'amuse.community.mesa'. Then I tried to run pip install -e . and got the following error:

(Amuse-env) tangt@DESKTOP-D7M2799:/mnt/f/amuse-main$ pip install -e .
Obtaining file:///mnt/f/amuse-main
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [36 lines of output]
      Traceback (most recent call last):
        File "/home/tangt/Amuse-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/tangt/Amuse-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/tangt/Amuse-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 281, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 71, in <module>
          setup(
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 155, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 109, in setup
          _setup_distribution = dist = klass(attrs)
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 458, in __init__          _Distribution.__init__(
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
          self.finalize_options()
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 851, in finalize_options
          ep(self)
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 104, in infer_version
          _assign_version(dist, config)
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 51, in _assign_version
          _version_missing(config)
        File "/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 106, in _version_missing
          raise LookupError(
      LookupError: setuptools-scm was unable to detect version for /mnt/f/amuse-main.

      Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

      For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
      [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.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

So how can I solve this problen, thank you an advance for your answer.

spzwart commented 2 years ago

Dear Tangtong,

In your installation you did not install MESA properly. This package has to be installed separately. At the moment we have two versions of MESA in AMUSE, one is a somewhat older (but better tested) version, and the other has just been adapted to be used with AMUSE. you can install either of them via a separate download. Steven, can you tell Tantong what is the current best procedure to install MESA, because that is not yet reported in the book.

Cheers, Simon

On Feb 28 2022, at 1:42 pm, tangtong98 @.***> wrote:

Hello,

I had no trouble installing AMUSE, but I had a problem with AMUSE Development. I got an error when running "test_HRdiagram_cluster.py":No module named 'amuse.community.mesa'. Then I tried to run pip install -e . and got the following error:

(Amuse-env) @.***:/mnt/f/amuse-main$ pip install -e .

Obtaining file:///mnt/f/amuse-main

Installing build dependencies ... done

Checking if build backend supports build_editable ... done

Getting requirements to build wheel ... done

Preparing metadata (pyproject.toml) ... error

error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.

│ exit code: 1

╰─> [36 lines of output]

 Traceback (most recent call last):

   File

"/home/tangt/Amuse-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in

     main()

   File

"/home/tangt/Amuse-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main

     json_out['return_val'] = hook(**hook_input['kwargs'])

   File

"/home/tangt/Amuse-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel

     return hook(metadata_directory, config_settings)

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel

     self.run_setup()

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 281, in run_setup

     super(_BuildMetaLegacyBackend,

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup

     exec(compile(code, __file__, 'exec'), locals())

   File "setup.py", line 71, in <module>

     setup(

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/init.py", line 155, in setup

     return distutils.core.setup(**attrs)

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 109, in setup

     _setup_distribution = dist = klass(attrs)

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 458, in init _Distribution.init(

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 293, in init

     self.finalize_options()

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 851, in finalize_options

     ep(self)

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 104, in infer_version

     _assign_version(dist, config)

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools_scm/integration.py", line 51, in _assign_version

     _version_missing(config)

   File

"/tmp/pip-build-env-63uiw_nu/overlay/lib/python3.8/site-packages/setuptools_scm/init.py", line 106, in _version_missing

     raise LookupError(

 LookupError: setuptools-scm was unable to detect version for /mnt/f/amuse-main.

 Make sure you're either building from a fully intact git

repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

 For example, if you're using pip, instead of

https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

 [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.

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

So how can I solve this problen, thank you an advance for your answer.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.

[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/amusecode/amuse/issues/829", "url": "https://github.com/amusecode/amuse/issues/829", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

MJCWilhelm commented 2 years ago

I think this may be another error. Did you git clone the amuse repository, or download it from github? I saw a similar error when someone downloaded it, in that case you don't get all of the git infrastructure and amuse seems to require that. So in the place where you want amuse you should do git clone https://github.com/amusecode/amuse.git

Concerning MESA, it's not installed by default, because it's such a big package it needs to be downloaded separately. After installing amuse via pip, and building the framework and codes, you should also do make mesa.code DOWNLOAD_CODES=1

And about the new version Simon mentioned, the version currently in amuse is an older version of MESA, and an interface to the modern version has been developed but not yet implemented in the main branch. The example script will definitely have been written with the old version in mind, and may not work with the new version. For completeness, the new version is available on the interface developer's amuse fork, https://github.com/rjfarmer/amuse/tree/mesa_15140 (note the branch used).

tangtong98 commented 2 years ago

Thank you for your thoughtful answers. Before, I downloaded amuse from github. Now I have git it again with the code you provided. After doing the make mesa.code DOWNLOAD_CODES=1, I ran this code python setup.py develop_build and get the following results:

(Amuse-env) tangt@DESKTOP-D7M2799:~/amuse$ python setup.py develop_build
running develop_build
building libraries and community codes
build, for logging, see 'build.log'
[22:12:37] building amuse_mpi-library
[22:12:37] building forsockets-library
[22:12:37] building g6-library
[22:12:37] building sapporo_2-library
[22:12:37] building sapporo_light-library
[22:12:37] building simple_hash-library
[22:12:44] building stopcond-library
[22:12:44] building aarsethzare
[22:12:44] building adaptb
[22:12:44] building asterisk
[22:12:44] building athena
[22:12:44] building bhtree
[22:12:44] building bonsai
[22:12:44] building bonsai2
[22:12:44] building brutus
[22:12:44] building bse
[22:12:44] building capreole
[22:12:44] building distributed
[22:12:44] building etics
[22:12:44] building evtwin
[22:12:44] building fastkick
[22:12:44] building fi
[22:12:44] building flash
[22:12:44] building fractalcluster
[22:12:44] building gadget2
[22:12:44] building galactics
[22:12:44] building galaxia
[22:12:44] building hacs64
[22:12:44] building halogen
[22:12:44] building hermite
[22:12:44] building higpus
[22:12:45] building hop
[22:12:45] building huayno
[22:12:45] building kepler
[22:12:45] building kepler_orbiters
[22:12:45] building krome
[22:12:45] building mameclot
[22:12:45] building mercury
[22:12:46] building mesa
[22:12:46] building mi6
[22:12:46] building mikkola
[22:12:46] building mmams
[22:12:46] building mmc
[22:12:46] building mobse
[22:12:46] building mocassin
[22:12:46] building mosse
[22:12:46] building mpiamrvac
[22:12:46] building nbody6xx
[22:12:46] building octgrav
[22:12:46] building petar
[22:19:51] building ph4
[22:19:51] building phantom
[22:19:58] building phigrape
[22:20:00] building pikachu
[22:20:00] building rebound
[22:20:00] building sakura
[22:20:00] building seba
[22:21:36] building secularmultiple
[22:21:36] building sei
[22:21:36] building simplex
[22:21:36] building smalln
[22:21:36] building sphray
[22:21:36] building sse
[22:21:36] building symple
[22:21:36] building tupan
[22:21:37] building twobody
[22:21:37] building vader
Community codes not built (because of errors):
================================================================================
 * distributed
 * phantom
Optional builds failed, need special libraries:
 * asterisk - java
 * fastkick - gpu
 * fi - gl, periodic_gl
 * hacs64 - gpu
 * higpus - gpu
 * huayno - cl
 * mi6 - gpu
 * ph4 - gpu
 * phigrape - gl, grape, gl_gpu, gpu
Optional builds failed, need CUDA/GPU libraries:
 * sapporo_light
 * bonsai
 * bonsai2
 * etics
 * octgrav
 * pikachu
Optional builds failed, need separate download
 * flash , make flash.code DOWNLOAD_CODES=1
 * mocassin , make mocassin.code DOWNLOAD_CODES=1
 * tupan , make tupan.code DOWNLOAD_CODES=1
================================================================================
Community codes built
================================================================================
* aarsethzare
* adaptb
* asterisk
* athena (selfgrav,mhd,scalar)
* bhtree
* brutus
* bse
* capreole (mpi)
* evtwin
* fastkick
* fi (mp,map_mp,periodic,map)
* fractalcluster
* gadget2 (normal,nogravity,periodic_nogravity,periodic)
* galactics
* galaxia
* hacs64
* halogen
* hermite
* higpus
* hop
* huayno (mp)
* kepler
* kepler_orbiters
* krome
* mameclot
* mercury
* mesa
* mi6
* mikkola
* mmams
* mmc
* mobse
* mosse
* mpiamrvac (acc,2dacc,2d,1d,1dacc)
* nbody6xx
* petar
* ph4
* phigrape (mpi)
* rebound
* sakura
* seba
* secularmultiple
* sei
* simplex
* smalln
* sphray
* sse
* symple
* twobody
* vader
================================================================================
50 out of 52 codes built, 5 out of 6 libraries built

I think I should have MESA installed, but when I run from amuse.community.mesa.interface import MESA in python, I still get 'No module named 'amuse.community.mesa'' error.

So what should I do next to solve this problem? Sorry for troubling you.

rieder commented 2 years ago

Could you post the output of pip list | grep amuse?

tangtong98 commented 2 years ago

I run pip list | grep amuse, get the following results:

(Amuse-env) tangt@DESKTOP-D7M2799:~$ pip list | grep amuse
amuse                 2021.7.0.3.dev187+g299457310 /home/tangt/amuse/src
amuse-athena          2021.7.0.2
amuse-bhtree          2021.7.0.2
amuse-bse             2021.7.0.2
amuse-capreole        2021.7.0.2
amuse-evtwin          2021.7.0.2
amuse-fastkick        2021.7.0.2
amuse-fi              2021.7.0.2
amuse-fractalcluster  2021.7.0.2
amuse-framework       2021.7.0.2
amuse-gadget2         2021.7.0.2
amuse-galactics       2021.7.0.2
amuse-galaxia         2021.7.0.2
amuse-halogen         2021.7.0.2
amuse-hermite         2021.7.0.2
amuse-hop             2021.7.0.2
amuse-huayno          2021.7.0.2
amuse-kepler          2021.7.0.2
amuse-kepler-orbiters 2021.7.0.2
amuse-mameclot        2021.7.0.2
amuse-mercury         2021.7.0.2
amuse-mmams           2021.7.0.2
amuse-ph4             2021.7.0.2
amuse-phigrape        2021.7.0.2
amuse-seba            2021.7.0.2
amuse-secularmultiple 2021.7.0.2
amuse-simplex         2021.7.0.2
amuse-smalln          2021.7.0.2
amuse-sphray          2021.7.0.2
amuse-sse             2021.7.0.2
amuse-tests           2021.7.0.2
amuse-twobody         2021.7.0.2
rieder commented 2 years ago

Thanks.

You will need to uninstall all amuse packages except for amuse itself - it should work then.

tangtong98 commented 2 years ago

Thank you very much for your help, I have been able to use it smoothly.