pyan icon indicating copy to clipboard operation
pyan copied to clipboard

FileNotFoundError: [Errno 2] No such file or directory: ''

Open Jesson-mark opened this issue 3 years ago • 2 comments

Hi,

Recently I installed pyan and try to use it to generate a graph of my python script. Unfortunately I encountered an error. Here is my installation command and my python is 3.8.0:

pip install git+https://github.com/Technologicat/pyan.git

While I run the command for my own script:

pyan3 tre_graph.py --uses --no-defines --colored --grouped --annotated --dot > tre.dot

It didn't work as expected but give an error as below:

Traceback (most recent call last):
  File "/home/wangjie/miniconda3/envs/straglr/bin/pyan3", line 8, in <module>
    sys.exit(main())
  File "/home/wangjie/miniconda3/envs/straglr/lib/python3.8/site-packages/pyan/main.py", line 208, in main
    v = CallGraphVisitor(filenames, logger=logger, root=root)
  File "/home/wangjie/miniconda3/envs/straglr/lib/python3.8/site-packages/pyan/analyzer.py", line 60, in __init__
    mod_name = get_module_name(filename)
  File "/home/wangjie/miniconda3/envs/straglr/lib/python3.8/site-packages/pyan/anutils.py", line 41, in get_module_name
    print(os.listdir(potential_root))
FileNotFoundError: [Errno 2] No such file or directory: ''

After some simple inspections of these codes that raising errors, I guess it is the problem of --root parameter. But it is inferred by default so I don't know how to fix it. Could you give some suggestions?

Thanks!

JieWang

Jesson-mark avatar Feb 17 '22 03:02 Jesson-mark

Looks the same as #70

FabienPertuy avatar Mar 17 '22 08:03 FabienPertuy

Would it be possible to proceed with publishing the next version release seeing as this issue is now fixed?

ColtAllen avatar Apr 16 '22 23:04 ColtAllen