Skip to content

Not able to Install pyan from ControlFlow.py in windows 11 #158

@santyelegy

Description

@santyelegy

Describe the bug
Not able to install pyan when calling ControlFlow.py.

To Reproduce
I tried to run the following code in ControlFlow.py and get the following error:

import shutil

PYAN = 'pyan3' if shutil.which('pyan3') is not None else 'pyan'

if shutil.which(PYAN) is None:
    # If installed from pypi, pyan may still be missing
    os.system('pip install "git+https://github.com/uds-se/pyan#egg=pyan"')
    PYAN = 'pyan3' if shutil.which('pyan3') is not None else 'pyan'

assert shutil.which(PYAN) is not None
  File "D:\Python\lib\site-packages\fuzzingbook\GreyboxFuzzer.py", line 647, in <module>
    from .ControlFlow import generate_maze_code
  File "D:\Python\lib\site-packages\fuzzingbook\ControlFlow.py", line 861, in <module>
    assert shutil.which(PYAN) is not None
AssertionError

Expected behavior
The code should install pyan and move on

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

Desktop (please complete the following information):

  • OS: windows 11
  • Python version 3.10

Additional context
I tested my installation and if pyan is runnable.

>where.exe pyan
D:\Python\Scripts\pyan
>pyan test.py --uses --defines --colored --grouped --annotated --dot > test.dot
# this pop up a window letting you select which application you would like to open this file with

This is because the pyan installed from https://github.com/uds-se/pyan#egg=pyan will create a file named pyan in Python\Script\ without a file name extension .exe. However, shutil.which() will only search for executables with file name extensions like .exe . The pyan installation code from ControlFlow.py is not working for my machine (windows 11).

Qucik Solution
Uninstall pyan and use pip install pyan3 instead. Will get the pyan3.exe file in the Python/Script folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions