spine-tools / Spine-Toolbox

Spine Toolbox is an open source Python package to manage data, scenarios and workflows for modelling and simulation. You can have your local workflow, but work as a team through version control and SQL databases.
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
72 stars 17 forks source link

Installation broken (git) #2336

Open jkiviluo opened 1 year ago

jkiviluo commented 1 year ago

When trying to follow installation instructions for git (https://github.com/spine-tools/Spine-Toolbox#installation-from-sources-using-git), at step 6 (install requirements), I get this. Doing python 3.9.

It works when I do it in the 0.8-dev branch.

(spi-entity2) C:\data\spi-entity2>python -m pip install -r requirements.txt
Obtaining spinedb_api from git+https://github.com/spine-tools/Spine-Database-API.git#egg=spinedb_api (from -r requirements.txt (line 1))
  Updating c:\data\spi-entity2\src\spinedb-api clone
  Running command git fetch -q --tags
  Running command git reset --hard -q d75bc5d5a9cb707c224bcfe858031ed390ff2c47
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Obtaining spine_engine from git+https://github.com/spine-tools/spine-engine.git#egg=spine_engine (from -r requirements.txt (line 2))
  Cloning https://github.com/spine-tools/spine-engine.git to c:\data\spi-entity2\src\spine-engine
  Running command git clone --filter=blob:none --quiet https://github.com/spine-tools/spine-engine.git 'C:\data\spi-entity2\src\spine-engine'
  Resolved https://github.com/spine-tools/spine-engine.git to commit 470f154e546e8bd285794830ee0146d27316c6d9
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error

  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [55 lines of output]
      C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\version.py:95: UserWarning: tag "starting fsmonitor-daemon in 'C:/data/spi-entity2/src/spine-engine'\n0.23.0" no version found
        warnings.warn(f"tag {tag!r} no version found")
      Traceback (most recent call last):
        File "C:\Users\prokjt\Miniconda3\envs\spi-entity2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\prokjt\Miniconda3\envs\spi-entity2\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:\Users\prokjt\Miniconda3\envs\spi-entity2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\build_meta.py", line 468, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 1, in <module>
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
          _setup_distribution = dist = klass(attrs)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\dist.py", line 303, in __init__
          _Distribution.__init__(self, dist_attrs)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 283, in __init__
          self.finalize_options()
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools\dist.py", line 680, in finalize_options
          ep(self)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_integration\setuptools.py", line 121, in infer_version
          _assign_version(dist, config)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_integration\setuptools.py", line 53, in _assign_version
          maybe_version = _get_version(config, force_write_version_files=True)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_get_version_impl.py", line 93, in _get_version
          parsed_version = parse_version(config)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_get_version_impl.py", line 56, in parse_version
          or parse_scm_version(config)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_get_version_impl.py", line 35, in parse_scm_version
          return _entrypoints.version_from_entrypoint(
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_entrypoints.py", line 55, in version_from_entrypoint
          maybe_version: version.ScmVersion | None = fn(root, config=config)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\git.py", line 211, in parse
          return _git_parse_inner(
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\git.py", line 255, in _git_parse_inner
          version = version_from_describe(wd, config, describe_command)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\git.py", line 243, in version_from_describe
          return describe_res.parse_success(parse=parse_describe)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\_run_cmd.py", line 77, in parse_success
          return parse(self.stdout)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\git.py", line 241, in parse_describe
          return meta(tag=tag, distance=distance, dirty=dirty, node=node, config=config)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\version.py", line 210, in meta
          parsed_version = _parse_tag(tag, preformatted, config)
        File "C:\Users\prokjt\AppData\Local\Temp\1\pip-build-env-v_7rx91d\overlay\Lib\site-packages\setuptools_scm\version.py", line 193, in _parse_tag
          assert version is not None
      AssertionError
      [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 editable 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.
soininen commented 1 year ago

You're trying to install the entity branch, right? I guess it won't work since the branches don't have version tags.

ptsavol commented 1 year ago

Installing Spine Toolbox from master branches works fine on my system. Maybe you skipped step 5.

python -m pip install --upgrade pip

Is this the case?

ptsavol commented 1 year ago

@soininen This issue is about the master branch being possibly broken. Please see chat on element.

soininen commented 1 year ago

Aye, it's the environment name (spi-entity2) that let me astray here.

ptsavol commented 1 year ago

Actually this might be caused by the new dynamic versioning thing. The easiest fix is to clone the spinetoolbox repo again.

jkiviluo commented 1 year ago

I did clean install with new conda environment. Did all the steps. Still the same.

soininen commented 1 year ago

I also did a clean install (freshly cloned Spine-Toolbox repository) with new conda environment and got toolbox running smoothly. @jkiviluo Can you provide any other information about your Python environment?

jkiviluo commented 1 year ago
(spi-master) C:\data\spi-entity\Spine-Toolbox\src\spinedb-api>conda list
# packages in environment at C:\Users\prokjt\Miniconda3\envs\spi-master:
#
# Name                    Version                   Build  Channel
ca-certificates           2023.08.22           haa95532_0
openssl                   3.0.11               h2bbff1b_2
pip                       23.2.1           py39haa95532_0
python                    3.9.18               h1aa4202_0
setuptools                68.0.0           py39haa95532_0
sqlite                    3.41.2               h2bbff1b_0
tzdata                    2023c                h04d1e81_0
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.41.2           py39haa95532_0
jkiviluo commented 1 year ago

I just re-tried and now it goes through. I was on a shaky wi-fi last time (but I tried it twice). And the error does not say it was because of lost internet connection. Well, let's hope this will not repeat. Closing...

jkiviluo commented 1 year ago

Just kidding. I was in wrong directory (v0.8) where the python -m pip install -r requirements.txt works. So, in master still the same error message.

ptsavol commented 10 months ago

@jkiviluo Did you ever get installation from master branch working? There's a new issue (#2462), which is probably related somehow.

jkiviluo commented 10 months ago

Still the same. Created a new environment, followed instructions for git installation and got the same AssertionError.

jkiviluo commented 10 months ago

Somebody seems to know something about this; https://hpc-discourse.usc.edu/t/trouble-installing-modules-via-pip/784

I don't know what I should do in my case though.