google / textfsm

Python module for parsing semi-structured text into python tables.
Apache License 2.0
1.09k stars 168 forks source link

Can't install textfsm 1.1.3 #105

Closed clj closed 1 year ago

clj commented 2 years ago

Hi, I can't install very recently released textfsm 1.1.3. This seems to be because:

pip install textfsm
Collecting textfsm
  Downloading textfsm-1.1.3.tar.gz (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.5/55.5 KB 1.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/km/bpjt_xps0174w9mlsh18tjbm0000gn/T/pip-install-t1l_cd8g/textfsm_b7c4791da8d447b98c4e9ddb9eb14469/setup.py", line 20, in <module>
          import textfsm
        File "/private/var/folders/km/bpjt_xps0174w9mlsh18tjbm0000gn/T/pip-install-t1l_cd8g/textfsm_b7c4791da8d447b98c4e9ddb9eb14469/textfsm/__init__.py", line 11, in <module>
          from textfsm.parser import *
        File "/private/var/folders/km/bpjt_xps0174w9mlsh18tjbm0000gn/T/pip-install-t1l_cd8g/textfsm_b7c4791da8d447b98c4e9ddb9eb14469/textfsm/parser.py", line 41, in <module>
          import six
      ModuleNotFoundError: No module named 'six'
      [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.
clj commented 2 years ago

Actually, pip doesn't seem to do setup_requires, but it seems possible to get around all this by setting the version in setup.cfg, e.g.: #106

mshonichev commented 2 years ago

same here, 1.1.3 won't install on clean virtualenv, while 1.1.2 installs ok.

case:

python3 -m venv create .venv
. .venv/bin/activate
(.venv) python3 -m pip install textfsm==1.1.3

    Downloading textfsm-1.1.3.tar.gz (55 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.5/55.5 KB 4.9 MB/s eta 0:00:00
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [10 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-k9k1vv0x/textfsm_1ecf1a26ccf6489cbdec834073b72b6d/setup.py", line 20, in <module>
            import textfsm
          File "/tmp/pip-install-k9k1vv0x/textfsm_1ecf1a26ccf6489cbdec834073b72b6d/textfsm/__init__.py", line 11, in <module>
            from textfsm.parser import *
          File "/tmp/pip-install-k9k1vv0x/textfsm_1ecf1a26ccf6489cbdec834073b72b6d/textfsm/parser.py", line 41, in <module>
            import six
        ModuleNotFoundError: No module named 'six'

workaround: first install six and then install textfsm.

python3 -m venv create .venv
. .venv/bin/activate
(.venv) python3 -m pip install six wheel
(.venv) python3 -m pip install textfsm

Collecting textfsm
  Using cached textfsm-1.1.3.tar.gz (55 kB)
Requirement already satisfied: future in ./.venv/lib/python3.9/site-packages (from textfsm) (0.18.2)
Requirement already satisfied: six in ./.venv/lib/python3.9/site-packages (from textfsm) (1.16.0)
Building wheels for collected packages: textfsm
  Building wheel for textfsm (setup.py) ... done
  Created wheel for textfsm: filename=textfsm-1.1.3-py2.py3-none-any.whl size=44656 sha256=f0b90fc4af5848401c0494c68f5a0ec60304bb3267940c2b842fa6b95279e93b
  Stored in directory: /root/.cache/pip/wheels/c0/bb/5e/e4ba0085967a66bc97c1e8be7318f83538fe0ea640cda14560
Successfully built textfsm
Installing collected packages: textfsm
Successfully installed textfsm-1.1.3
ColonelBundy commented 2 years ago

Same issue here...

shustinm commented 2 years ago

Same issue for me. This is because the release of textfsm 1.1.3 doesn't include a built wheel distribution like on textfsm 1.1.2. Specifying 1.1.2 in the requirement set should work.

jefvantongerloo commented 1 year ago

Same issue here, release is 1.1.3 is broken. Ignore minor release wildcard by specifying 1.1.2 directly instead of textfsm = "^1.1.2"

What is the reason behind the release, because only the version number seemed to be bumped up?

jobec commented 1 year ago

Same issue here. @jefvantongerloo This changed: https://github.com/google/textfsm/compare/v1.1.2...v1.1.3

edo248 commented 1 year ago

Just spent some time debugging this to find out that install fails because there's not wheel in the latest version (as @shustinm mentioned).

Just to add to this build without wheel fails because setup py imports own package before even starting the install https://github.com/google/textfsm/blob/master/setup.py#L20 then there's a import * in https://github.com/google/textfsm/blob/master/textfsm/__init__.py#L11 that calls parser which reaches for six. All of this happening before setup even started.

MrPaulAR commented 1 year ago

As a workaround you can install six prior to textfsm 1.1.3. It's a bit hacky but works until a fix is released.

harro commented 1 year ago

Missed uploading the wheel, added it now. And 'pip install textfsm' installs latest release on a clean environment.