tonybaloney / wily

A Python application for tracking, reporting on timing and complexity in Python code
Apache License 2.0
1.2k stars 58 forks source link

Unable to use wily on cli #226

Closed liaochris closed 10 months ago

liaochris commented 10 months ago

Describe the bug After installing wily with pip install wily, I am unable to use it on the CLI. Whenever I run wily, I get the output.

-bash: wily: command not found

I tested this on both MacOS and linux.

devdanzin commented 10 months ago

I'll try to reproduce this later tonight. Can you please share what Python version you use, and whether the pip install is on a virtual environment or on system Python?

liaochris commented 10 months ago

Pip install is on a system python for both, Python 3.8 on Linux and python 3.11 for MacOS

devdanzin commented 10 months ago

Thank you very much for reporting this issue!

Trying to install on a system Python in WSL gives the warning:

pip install wily
Defaulting to user installation because normal site-packages is not writeable

Do you see the same?

But the main reason for wily not working seems to be that the wily script install directory is not on PATH, as further warnings indicate:

 WARNING: The script wily is installed in '/home/danzin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Can you check whether wily is in ~/.local/bin on Linux, and whether that directory is on your PATH? Does running ~/.local/bin/wily work? If so, I'd assume a similar situation explains why it doesn't work on MacOS.

Works fine in a virtual environment, so if the above doesn't explain your issue, that would be a workaround until we figure this out.

liaochris commented 10 months ago

I added the installation location of wily to my path variable in both MacOS and Linux, and it works on both now. Thank you!