malcolmw / pykonal

Travel-time calculator based on the fast-marching method solution to the Eikonal equation.
https://malcolmw.github.io/pykonal-docs/
GNU General Public License v3.0
147 stars 54 forks source link

The problem when installing pykonal #45

Closed kuanghy2320 closed 5 months ago

kuanghy2320 commented 5 months ago

newbie to Python, am trying to install the package pykonal to explore Python, but can't get it installed. Below is the error output. Can anyone help pls? Thank you very much!

(pykonal_) C:\Users\26976>pip install pykonal Collecting pykonal Using cached pykonal-0.4.0.tar.gz (10.6 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 ╰─> [101 lines of output] Compiling pykonal/constants.pyx because it changed. Compiling pykonal/fields.pyx because it changed. Compiling pykonal/heapq.pyx because it changed. Compiling pykonal/locate.pyx because it changed. Compiling pykonal/solver.pyx because it changed. Compiling pykonal/stats.pyx because it changed. [1/6] Cythonizing pykonal/constants.pyx [2/6] Cythonizing pykonal/fields.pyx [3/6] Cythonizing pykonal/heapq.pyx [4/6] Cythonizing pykonal/locate.pyx [5/6] Cythonizing pykonal/solver.pyx [6/6] Cythonizing pykonal/stats.pyx C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:75: _MissingDynamic: license defined outside of pyproject.toml is ignored. !!

          ********************************************************************************
          The following seems to be defined outside of `pyproject.toml`:

          `license = 'GNU GPLv3'`

          According to the spec (see the link below), however, setuptools CANNOT
          consider this value unless `license` is listed as `dynamic`.

          https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

          To prevent this problem, you can list `license` under `dynamic` or alternatively
          remove the `[project]` table from your file and rely entirely on other means of
          configuration.
          ********************************************************************************

  !!
    _handle_missing_dynamic(dist, project_table)
  C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:75: _MissingDynamic: `dependencies` defined outside of `pyproject.toml` is ignored.
  !!

          ********************************************************************************
          The following seems to be defined outside of `pyproject.toml`:

          `dependencies = ['cython>=0.29.14', 'h5py', 'numpy', 'scipy']`

          According to the spec (see the link below), however, setuptools CANNOT
          consider this value unless `dependencies` is listed as `dynamic`.

          https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

          To prevent this problem, you can list `dependencies` under `dynamic` or alternatively
          remove the `[project]` table from your file and rely entirely on other means of
          configuration.
          ********************************************************************************

  !!
    _handle_missing_dynamic(dist, project_table)
  C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:75: _MissingDynamic: `optional-dependencies` defined outside of `pyproject.toml` is ignored.
  !!

          ********************************************************************************
          The following seems to be defined outside of `pyproject.toml`:

          `optional-dependencies = {'tests': ['nose']}`

          According to the spec (see the link below), however, setuptools CANNOT
          consider this value unless `optional-dependencies` is listed as `dynamic`.

          https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

          To prevent this problem, you can list `optional-dependencies` under `dynamic` or alternatively
          remove the `[project]` table from your file and rely entirely on other means of
          configuration.
          ********************************************************************************

  !!
    _handle_missing_dynamic(dist, project_table)
  Traceback (most recent call last):
    File "D:\anaconda3\envs\pykonal_\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "D:\anaconda3\envs\pykonal_\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:\anaconda3\envs\pykonal_\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\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\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\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 61, in <module>
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 159, in setup
      dist.parse_config_files()
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\dist.py", line 627, in parse_config_files
      pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config\pyprojecttoml.py", line 67, in apply_configuration
      return _apply(dist, config, filepath)
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py", line 56, in apply
      _apply_project_table(dist, config, root_dir)
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py", line 82, in _apply_project_table
      corresp(dist, value, root_dir)
    File "C:\Users\26976\AppData\Local\Temp\pip-build-env-v56uqsuw\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py", line 183, in _license
      _set_config(dist, "license", val["text"])
  KeyError: 'text'
  [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.

kuanghy2320 commented 5 months ago

This is my packages in environment at D:\anaconda3\envs\pykonal. I hope it helps! (pykonal) C:\Users\26976>conda list

packages in environment at D:\anaconda3\envs\pykonal_:

#

Name Version Build Channel

ca-certificates 2023.12.12 haa95532_0 cython 3.0.8 pypi_0 pypi h5py 3.10.0 pypi_0 pypi numpy 1.26.3 pypi_0 pypi openssl 3.0.12 h2bbff1b_0 pip 23.3.1 py39haa95532_0 python 3.9.18 h1aa4202_0 scipy 1.11.4 pypi_0 pypi setuptools 68.2.2 pypi_0 pypi sqlite 3.41.2 h2bbff1b_0 tzdata 2023d h04d1e81_0 vc 14.2 h21ff451_1 vs2015_runtime 14.27.29016 h5e58377_2 wheel 0.42.0 pypi_0 pypi

kuanghy2320 commented 5 months ago

Can you tell me what I should do to fix this?

Cleaf-y commented 5 months ago

clone the code, modify the requires in pyproject.toml, set 'setuptools==68.2.2', and reinstall it.

kuanghy2320 commented 5 months ago

clone the code, modify the requires in pyproject.toml, set 'setuptools==68.2.2', and reinstall it. You're right. Thank you very much. image

malcolmw commented 5 months ago

It looks like you have the workaround already, but I uploaded a new version of pykonal (0.4.1) to pypi that implements this fix. Pykonal should be installable via pip install pykonal now. Closing this issue as completed.

kuanghy2320 commented 5 months ago

Thank you very much!Good luck!