Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] pip install failed - TypeError: RegexHighlighter() takes no arguments #65

Closed
EdwardTheLegend opened this issue May 21, 2022 · 6 comments
Labels
Bug Something isn't working

Comments

@EdwardTheLegend
Copy link

EdwardTheLegend commented May 21, 2022

Describe the bug
A clear and concise description of what the bug is.

When I attempt to install pytermgui using pip the installation fails and throws an error

Defaulting to user installation because normal site-packages is not writeable
Collecting pytermgui
  Using cached pytermgui-6.1.0.tar.gz (136 kB)
  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
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "/home/[user]/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/[user]/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/[user]/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-3ngpzg9c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/tmp/pip-build-env-3ngpzg9c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-3ngpzg9c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 281, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/tmp/pip-build-env-3ngpzg9c/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 3, in <module>
          import pytermgui
        File "/tmp/pip-install-4s0u2_kx/pytermgui_e7e9e5f247fd4974833e1cb8344f0c75/pytermgui/__init__.py", line 20, in <module>
          from .parser import *
        File "/tmp/pip-install-4s0u2_kx/pytermgui_e7e9e5f247fd4974833e1cb8344f0c75/pytermgui/parser.py", line 121, in <module>
          from .colors import str_to_color, Color, StandardColor
        File "/tmp/pip-install-4s0u2_kx/pytermgui_e7e9e5f247fd4974833e1cb8344f0c75/pytermgui/colors.py", line 22, in <module>
          from .fancy_repr import FancyYield
        File "/tmp/pip-install-4s0u2_kx/pytermgui_e7e9e5f247fd4974833e1cb8344f0c75/pytermgui/fancy_repr.py", line 7, in <module>
          from .highlighters import highlight_python
        File "/tmp/pip-install-4s0u2_kx/pytermgui_e7e9e5f247fd4974833e1cb8344f0c75/pytermgui/highlighters.py", line 156, in <module>
          highlight_python = RegexHighlighter(
      TypeError: RegexHighlighter() takes no arguments
      [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.

To Reproduce
Steps to reproduce the behavior:

  1. Open a terminal on a machine without pytermgui installed
  2. Type python3 -m pip install pytermgui and hit enter
  3. See the error

Expected behavior
A clear and concise description of what you expected to happen.

The installation to work successfully

Screenshots
If applicable, add screenshots to help explain your problem.

System information

Alpine on WSL on Windows 10

Add the output of "ptg --version" in this box.

Possible cause
If you have a hunch on what might be causing this, please add it here.

Seems like something to do with the dataclass meaning that RegexHighlighter doesn't get an init ?

Possible solution
If you know a way we could fix this, please add it here.

I don't know much about dataclasses but maybe this link is relevant

@EdwardTheLegend EdwardTheLegend added the Bug Something isn't working label May 21, 2022
@bczsalba
Copy link
Owner

Which version of Python is this?

@EdwardTheLegend
Copy link
Author

3.9

@bczsalba
Copy link
Owner

Could you show me the output of ptg -v?

@bczsalba bczsalba changed the title pip install failed. TypeError: RegexHighlighter() takes no arguments [BUG] pip install failed - TypeError: RegexHighlighter() takes no arguments May 22, 2022
@EdwardTheLegend
Copy link
Author

❯ ptg -v
Traceback (most recent call last):
  File "/home/[user]/.local/bin/ptg", line 33, in <module>
    sys.exit(load_entry_point('pytermgui==0.4.1', 'console_scripts', 'ptg')())
  File "/home/[user]/.local/bin/ptg", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.9/importlib/metadata.py", line 524, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.9/importlib/metadata.py", line 187, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: pytermgui

@bczsalba bczsalba reopened this May 24, 2022
@bczsalba
Copy link
Owner

I didn't mean to close this yet. Could you try cloning the latest commit and installing using pip install .? I think it should work now.

Odd that this problem never seemed to come up anywhere else. Thank you for the report!

@EdwardTheLegend
Copy link
Author

Working now
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants