cadCAD-org / cadCAD

Design, simulate, validate, and operate within complex systems
https://cadcad.org
MIT License
549 stars 271 forks source link

cadcad 0.4.28 fails to install with python 3.10.4. #306

Closed LinuxIsCool closed 10 months ago

LinuxIsCool commented 2 years ago

Trying to install cadcad with pip3 fails.

🐍(cadcad-explorations) ygg@pop-os ~/Workspace/LongtailFinancial🚀/cadcad-explorations [main]× 🏂 python3 --version                                                                1 [10:15:21]
Python 3.10.4
🐍(cadcad-explorations) ygg@pop-os ~/Workspace/LongtailFinancial🚀/cadcad-explorations [main]× 🏂 pip3 install cadcad                                                                [10:15:24]
Collecting cadcad
  Using cached cadCAD-0.4.28-py3-none-any.whl (60 kB)
Collecting dill
  Using cached dill-0.3.5.1-py2.py3-none-any.whl (95 kB)
Requirement already satisfied: pytz in /home/ygg/.virtualenvs/cadcad-explorations/lib/python3.10/site-packages (from cadcad) (2022.1)
Requirement already satisfied: six in /home/ygg/.virtualenvs/cadcad-explorations/lib/python3.10/site-packages (from cadcad) (1.16.0)
Collecting fn
  Using cached fn-0.4.3.tar.gz (38 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/setup.py", line 6, in <module>
          import fn
        File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/fn/__init__.py", line 1, in <module>
          from .stream import Stream
        File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/fn/stream.py", line 9, in <module>
          from .iters import map, range
        File "/tmp/pip-install-o16ii1zh/fn_bbdebdebb17c42718299adfcbc03ecf0/fn/iters.py", line 2, in <module>
          from collections import deque, Iterable
      ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
      [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.
chuck-h commented 1 year ago

This worked for me:

git clone --branch python3_10 git@github.com:kapulkin/fn.py.git 
cd fn.py/
python setup.py install

Then

pip install cadCAD==0.4.28

succeeded.

LinuxIsCool commented 1 year ago

Thanks @chuck-h that worked for me too. Seems like fn should be added to requirements for cadcad.

LinuxIsCool commented 1 year ago

In case anyone working with a requirements.txt file, having the following lie before cadcad works for me.

In requirements.txt:

...
https://github.com/kapulkin/fn.py/archive/refs/heads/python3_10.zip
...

Then:

pip3 install -r requirements.txt
danlessa commented 1 year ago

Fix submitted at PR https://github.com/cadCAD-org/cadCAD/pull/309

emanuellima1 commented 10 months ago

Fixed at PR #309