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

__init__() got multiple values for argument 'root' #72

Closed
ALeyshon opened this issue Jun 2, 2021 · 9 comments
Closed

__init__() got multiple values for argument 'root' #72

ALeyshon opened this issue Jun 2, 2021 · 9 comments

Comments

@ALeyshon
Copy link

ALeyshon commented Jun 2, 2021

Issue
Calling pyan3 from command line exits with a TypeError

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/pyan/main.py", line 244, in <module>
    main()
  File "/usr/local/lib/python3.7/dist-packages/pyan/main.py", line 206, in main
    v = CallGraphVisitor(filenames, logger, root=root)
TypeError: __init__() got multiple values for argument 'root'

To reproduce
Install using pip and git master: pip3 install git+https://github.com/Technologicat/pyan.git
Run pyan3 with parameters: pyan3 application.py --dot > test.dot

Environment
Python 3.7.10 VIrtualEnv on Ubuntu 21.04

@ALeyshon ALeyshon changed the title pyan3 won't run at all __init__() got multiple values for argument 'root' Jun 2, 2021
@ALeyshon
Copy link
Author

ALeyshon commented Jun 2, 2021

Duplicate of #64

@ALeyshon ALeyshon closed this as completed Jun 2, 2021
@Technologicat
Copy link
Owner

Please pull from git and retry. I merged pull request #65, which fixes this.

We'll make an updated package available shortly.

@LuisBL
Copy link

LuisBL commented Jan 1, 2022

Hello,
Could you please update package ?

@Ran4
Copy link

Ran4 commented Jul 5, 2022

Any updates on this?

@XixuHu
Copy link

XixuHu commented Nov 24, 2023

change the position of root and logger can fix this error

v = CallGraphVisitor(filenames, root, logger)

@Deepam-Rai
Copy link

Use pip install pyan3=1.1.1, latest pyan3.

@rorynormaness
Copy link

This is an issue again with 1.2.0 - revert to 1.1.1 to fix.

@eshaanagarwal
Copy link

After downloading this particular version, i faced the following issue.
I was trying to build a dependency graph for pandas

!pyan3 pandas/**/*.py --uses --no-defines --colored --grouped --dot > pandas_call_graph.dot

Traceback (most recent call last):
  File "/usr/local/bin/pyan3", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/pyan/main.py", line 235, in main
    v = CallGraphVisitor(filenames, logger)
  File "/usr/local/lib/python3.10/dist-packages/pyan/analyzer.py", line 75, in __init__
    self.process()
  File "/usr/local/lib/python3.10/dist-packages/pyan/analyzer.py", line 82, in process
    self.process_one(filename)
  File "/usr/local/lib/python3.10/dist-packages/pyan/analyzer.py", line 96, in process_one
    self.visit(ast.parse(content, filename))
  File "/usr/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/dist-packages/pyan/analyzer.py", line 340, in visit_Module
    self.generic_visit(node)  # visit the **children** of node
  File "/usr/lib/python3.10/ast.py", line 426, in generic_visit
    self.visit(item)
  File "/usr/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/dist-packages/pyan/analyzer.py", line 454, in visit_FunctionDef
    self.visit(stmt)
  File "/usr/lib/python3.10/ast.py", line 418, in visit
    return visitor(node)
  File "/usr/local/lib/python3.10/dist-packages/pyan/analyzer.py", line 752, in visit_AnnAssign
    get_ast_node_name(value[0]),
IndexError: list index out of range

@mxkpp
Copy link

mxkpp commented Dec 13, 2024

Use pip install pyan3=1.1.1, latest pyan3.

Could this be reopened since the latest pyan3, which is 1.2.0 now as I see it in my 3.12 environment, does not work but this older one (pyan3=1.1.1) does work?

Edit: sorry, nevermind, I see there is this open issue: #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants