dipdup-io / dipdup

Modular framework for creating selective indexers and featureful backends for dapps
https://dipdup.io
MIT License
92 stars 52 forks source link

Error creating new project #884

Closed jagracar closed 11 months ago

jagracar commented 11 months ago

I installed dipdup today. Everything went fine, but the creation of a new project returned an error.

I just run dipdup new and got the following error

content: error
date: '2023-10-27T19:40:12.368353'
exception:
  values:
  - mechanism:
      handled: true
      type: generic
    stacktrace:
      frames:
      - abs_path: 
          /home/jgracia/.local/pipx/venvs/dipdup/lib/python3.11/site-packages/dipdup/cli.py
        code:
        - '    async def wrapper(ctx: click.Context, *args: Any, **kwargs: Any) ->
          None:'
        - '        signals = ctx.invoked_subcommand not in NO_SIGNALS_CMDS'
        - '        set_up_process(signals)'
        - ''
        - '        try:'
        - '            await fn(ctx, *args, **kwargs)'
        - '        except (KeyboardInterrupt, asyncio.CancelledError):'
        - '            pass'
        - '        except Exception as e:'
        - "            package = ctx.obj.config.package if ctx.obj else 'unknown'"
        - '            report_id = save_report(package, e)'
        filename: dipdup/cli.py
        function: wrapper
        lineno: 120
        module: dipdup.cli
        vars:
          args: []
          ctx: <asyncclick.core.Context object at 0x7f6c0ab66690>
          e: AttributeError("module 'sys' has no attribute 'set_int_max_str_digits'")
          fn: <function cli at 0x7f6c0addf560>
          kwargs:
            config:
            - "'dipdup.yaml'"
            env_file: []
          package: "'unknown'"
          signals: 'False'
      - abs_path: 
          /home/jgracia/.local/pipx/venvs/dipdup/lib/python3.11/site-packages/dipdup/cli.py
        code:
        - 'async def cli(ctx: click.Context, config: list[str], env_file: list[str])
          -> None:'
        - '    if _skip_cli_group():'
        - '        return'
        - ''
        - '    # NOTE: https://github.com/python/cpython/issues/95778'
        - '    sys.set_int_max_str_digits(0)'
        - ''
        - '    from dotenv import load_dotenv'
        - ''
        - '    from dipdup.exceptions import ConfigurationError'
        - '    from dipdup.sys import set_up_logging'
        filename: dipdup/cli.py
        function: cli
        lineno: 214
        module: dipdup.cli
        vars:
          config:
          - "'dipdup.yaml'"
          ctx: <asyncclick.core.Context object at 0x7f6c0ab66690>
          env_file: []
    type: AttributeError
    value: module 'sys' has no attribute 'set_int_max_str_digits'
id: 6b296383e8
level: error
package: unknown
reason: AttributeError("module 'sys' has no attribute 'set_int_max_str_digits'")

It looks like i have an old version of python installed, even if I used python3.11?

Environment

jagracar commented 11 months ago

I see that my release candidate is from August 2022 and the PR was merged in September 2022

https://github.com/python/cpython/pull/96500/files

That explains why the method is not in my module.

droserasprout commented 11 months ago

Glad that you've found the root of the issue.

jagracar commented 11 months ago

I commented that line in my local installation and I managed to create a new project.

I will be mostly learning at the moment, so i guess it's not a big problem for me.