polca / pathways

Scenario-wide Life Cycle Assessment
BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

Install problems #5

Closed marc-vdm closed 4 weeks ago

marc-vdm commented 4 weeks ago

related to https://github.com/openjournals/joss-reviews/issues/7309


When I conda create -n pw pip and pip git+https://github.com/polca/pathways.git I get:

ERROR: unknown command "git+https://github.com/polca/pathways.git"


When I conda create -n pw pip and

git clone https://github.com/polca/pathways.git
cd pathways
pip install -r requirements.txt

I get:


Cloning into 'pathways'...
remote: Enumerating objects: 2019, done.
remote: Counting objects: 100% (276/276), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 2019 (delta 239), reused 243 (delta 224), pack-reused 1743 (from 1)
Receiving objects: 100% (2019/2019), 31.33 MiB | 18.33 MiB/s, done.
Resolving deltas: 100% (1366/1366), done.
Collecting numpy==1.24.4 (from -r requirements.txt (line 1))
  Downloading numpy-1.24.4.tar.gz (10.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.9/10.9 MB 6.5 MB/s eta 0:00:00
  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
  ╰─> [32 lines of output]
      Traceback (most recent call last):
        File "/home/marc/.conda/envs/pw/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/home/marc/.conda/envs/pw/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/marc/.conda/envs/pw/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
          backend = _build_backend()
        File "/home/marc/.conda/envs/pw/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
        File "/home/marc/.conda/envs/pw/lib/python3.13/importlib/__init__.py", line 88, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 1022, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/tmp/pip-build-env-hgtzwtot/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/tmp/pip-build-env-hgtzwtot/overlay/lib/python3.13/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/tmp/pip-build-env-hgtzwtot/overlay/lib/python3.13/site-packages/pkg_resources/__init__.py", line 2172, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [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.

When I conda create -n pw and conda install romainsacchi::pathways I get the error that bw2calc is not installed, after that that datapackage is not installed, after which I stopped.

romainsacchi commented 4 weeks ago
  1. pip install instructions corrected (install argument was missing)
  2. cd is also a correct command to enter a folder on Windows (maybe you meant dir/ls?)
  3. The issue is caused by the requirement numpy<=1.24.4 that is incompatible with Python 3.12. Hence, I now restricted the package compatibility to 3.9-3.11. We need numpy<=1.24.4 because of bw2io.
  4. I fixed the conda package requirements. It should work fine now.
marc-vdm commented 4 weeks ago
  1. I now get the same error as with the git clone option
  2. yes, my mistake
  3. see 1
  4. still the same problem as before, but your channel is also not updating pathways: https://anaconda.org/romainsacchi/pathways/files
romainsacchi commented 4 weeks ago

1 & 3: could it be that the environment uses Python 3.12?

marc-vdm commented 4 weeks ago

Yes that resolves 1&3, should have looked better.

For 4: my conda sees the version of today with conda search -c romainsacchi -f pathways but still has the original error, also with python=3.11

romainsacchi commented 4 weeks ago
  1. Indeed, I had an issue with the pipeline. The anaconda channel is now updated.
romainsacchi commented 4 weeks ago

Ah ok, forget my last comment then.

romainsacchi commented 4 weeks ago
  1. I just tried conda install romainsacchi::pathways which fetches today's release (from 20 minutes ago), and it seems to work fine now (and bw2calc and datapackage are now part of the environment). Can you confirm?
marc-vdm commented 4 weeks ago

For me it keeps failing:

(pw) marc@framework7640u:~$ conda install romainsacchi::pathways=2024.10.29
Channels:
 - defaults
 - romainsacchi
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
  - nothing provides bw2calc needed by pathways-2024.10.29-py_0

Could not solve for environment specs
The following package could not be installed
└─ pathways 2024.10.29*  is not installable because it requires
   └─ bw2calc, which does not exist (perhaps a missing channel).
romainsacchi commented 4 weeks ago

I see. I think that is because I forgot to specify the conda-forge channel. I changed the instruction to: conda install -c conda-forge -c romainsacchi pathways. Now it should find the missing packages.

marc-vdm commented 4 weeks ago

All work for me now.