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

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

Open
santyelegy opened this issue Mar 18, 2023 · 0 comments
Open

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

santyelegy opened this issue Mar 18, 2023 · 0 comments

Comments

@santyelegy
Copy link

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.

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

1 participant