计算化学公社

 找回密码 Forget password
 注册 Register
Views: 921|回复 Reply: 1
打印 Print 上一主题 Last thread 下一主题 Next thread

[GROMACS] 下载安装gmxapi包一直出现问题如何解决?

[复制链接 Copy URL]

43

帖子

0

威望

207

eV
积分
250

Level 3 能力者

跳转到指定楼层 Go to specific reply
楼主
老师同学们好,我在通过pycharm中的终端共聚安装gmxapi一直失败(包括通过pip install gmxapi和从官网下载api后通过pip install "文件路径")两种方式都失败,已经按照官方手册确认了pip、setuptools 和 wheel等已安装并更新至最新,以下是我使用的版本号等信息
python:3.12(64-bit)
gromacs:gmx2020.6_AVX2_CUDA_win64  论坛社长编译的GPU版本
pycharm:2023.2.5版本
计算机纯小白,搜了一圈也没整明白,特来求助大家,救救孩子吧



以下是输入pip install gmxapi后出现的信息:

Collecting gmxapi
  Using cached gmxapi-0.4.2.tar.gz (207 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting mpi4py (from gmxapi)
  Using cached mpi4py-3.1.5-cp312-cp312-win_amd64.whl.metadata (8.0 kB)
Collecting packaging (from gmxapi)
  Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting pybind11 (from gmxapi)
  Using cached pybind11-2.11.1-py3-none-any.whl.metadata (9.5 kB)
Collecting networkx>=2.0 (from gmxapi)
  Using cached networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)
Requirement already satisfied: numpy>1.7 in c:\pycharm community edition\works\venv\lib\site-packages (from gmxapi) (1.26.2)
Using cached networkx-3.2.1-py3-none-any.whl (1.6 MB)
Using cached mpi4py-3.1.5-cp312-cp312-win_amd64.whl (471 kB)
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Using cached pybind11-2.11.1-py3-none-any.whl (227 kB)
Building wheels for collected packages: gmxapi
  Building wheel for gmxapi (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for gmxapi (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [127 lines of output]
      <string>:74: SetuptoolsDeprecationWarning: Deprecated API usage.
      !!

              ********************************************************************************
              As setuptools moves its configuration towards `pyproject.toml`,
              `setuptools.config.read_configuration` became deprecated.

              For the time being, you can use the `setuptools.config.setupcfg` module
              to access a backward compatible API, but this module is provisional
              and might be removed in the future.

              To read project metadata, consider using
              ``build.util.project_wheel_metadata`` (https://pypi.org/project/build/).
              For simple scenarios, you can also try parsing the file directly
              with the help of ``configparser``.
              ********************************************************************************

      !!
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\abc.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\commandline.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\datamodel.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\exceptions.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\operation.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\runtime.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\testsupport.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\typing.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\utility.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\version.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\_logging.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\_transform.py -> build\lib.win-amd64-cpython-312\gmxapi
      copying src\gmxapi\__init__.py -> build\lib.win-amd64-cpython-312\gmxapi
      creating build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\abc.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\context.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\fileio.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\mdrun.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\modify_input.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\read_tpr.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\workflow.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      copying src\gmxapi\simulation\__init__.py -> build\lib.win-amd64-cpython-312\gmxapi\simulation
      running build_ext
      thon setuptools script to build and install the gmxapi Python interface.

      The `gmxapi` package requires an existing GROMACS installation, version 2020 or higher.
      If the usual GROMACS environment variables are detected (such as from sourcing GMXRC),
      the corresponding GROMACS installation will be used. Otherwise, provide CMake options
      to the Python package installer.
      Define ``gmxapi_ROOT`` to the GROMACS installation directory (``-Dgmxapi_ROOT=/path/to/gromacs``).
      Help CMake find the GROMACS compiler toolchain with ``-C  /path/to/gromacs/share/cmake/gromacs/gromacs-hints.cmake``.

      If this script is unable to locate GROMACS as above, it will check for a
      GMXTOOLCHAINDIR environment variable, giving the location of a gromacs-toolchain.cmake file.
      The toolchain file is not provided by GROMACS 2022 and above, so support for GMXTOOLCHAINDIR
      is deprecated.

      Example:
          GROMACS_DIR=/path/to/gromacs
          CMAKE_ARGS="-Dgmxapi_ROOT=$GROMACS_DIR -C $GROMACS_DIR/share/cmake/gromacs/gromacs-hints.cmake"
          pip install gmxapi

      See https://manual.gromacs.org/current/gmxapi/userguide/install.html for more information.

      Traceback (most recent call last):
        File "C:\PyCharm Community Edition\works\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\PyCharm Community Edition\works\venv\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 "C:\PyCharm Community Edition\works\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup  
          exec(code, locals())
        File "<string>", line 415, in <module>
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup        
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command      
          super().run_command(command)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command      
          super().run_command(command)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command      
          super().run_command(command)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 232, in run
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 88, in run  
          _build_ext.run(self)
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 345, in run
          self.build_extensions()
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "C:\Users\84039\AppData\Local\Temp\pip-build-env-pz98dn4n\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 187, in build_extension
        File "<string>", line 373, in update_gromacs_client_cmake_args
      GmxapiInstallError: Please set a valid gmxapi_ROOT.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gmxapi
Failed to build gmxapi
ERROR: Could not build wheels for gmxapi, which is required to install pyproject.toml-based projects


8

帖子

0

威望

335

eV
积分
343

Level 3 能力者

2#
发表于 Post on 2025-12-9 17:26:20 | 只看该作者 Only view this author
spack env activate gmx
mamba activate gmxapi假如你创建了这个名称的环境
which gmx假如是/spack/env/gmx/bin/gmx
. /spack/env/gmx/bin/GMXRC
spack build-env gromacs -- bash假如这个是你spack install gromacs生成的软件包名称是gromacs
mamba activate gmxapi
pip install gmxapi

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-1-23 20:14 , Processed in 0.160044 second(s), 20 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list