microsoft / Llama-2-Onnx

Other
1k stars 88 forks source link

No module named 'ChatApp' #37

Open dhgouveia2 opened 7 months ago

dhgouveia2 commented 7 months ago

when trying to execute the ChatApp/app.py from Windows powershell

$ python ChatApp/app.py

I got the following error.

Traceback (most recent call last):
  File "C:\Llama-2-Onnx\ChatApp\app.py", line 6, in <module>
    from interface.hddr_llama_onnx_interface import LlamaOnnxInterface
  File "C:\Llama-2-Onnx\ChatApp\interface\hddr_llama_onnx_interface.py", line 12, in <module>
    from ChatApp.app_modules.utils import (
ModuleNotFoundError: No module named 'ChatApp'

Dependencies have been installed

cd .\ChatApp
pip install -r requirements.txt
$ python -V
Python 3.10.6
Nancyberry31 commented 7 months ago

37

![Uploading Screenshot_20231113-155858~2.jpg…]()

meetrais commented 6 months ago

when trying to execute the ChatApp/app.py from Windows powershell

$ python ChatApp/app.py

I got the following error.

Traceback (most recent call last):
  File "C:\Llama-2-Onnx\ChatApp\app.py", line 6, in <module>
    from interface.hddr_llama_onnx_interface import LlamaOnnxInterface
  File "C:\Llama-2-Onnx\ChatApp\interface\hddr_llama_onnx_interface.py", line 12, in <module>
    from ChatApp.app_modules.utils import (
ModuleNotFoundError: No module named 'ChatApp'

Dependencies have been installed

cd .\ChatApp
pip install -r requirements.txt
$ python -V
Python 3.10.6

I resolved this error by removing "ChatApp." where ever its referred.

For example, Change This -> from ChatApp.app_modules.utils import

To -> from app_modules.utils import

IanLeeClaxton commented 6 months ago

To resolve you will need to do the following:

Windows: SET PYTHONPATH=.

Mac/Linux export PYTHONPATH=.

This should be added to the documentation or fixed in the project via config