AbanteAI / rawdog

Generate and auto-execute Python scripts in the cli
Apache License 2.0
1.79k stars 140 forks source link

cant run rawdog on windows. #67

Closed thelege2nd closed 9 months ago

thelege2nd commented 9 months ago

I am using Python 3.12.2

I ran pip install rawdog-ai

then I initially get this error when I run rawdog

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\rawdog__main__.py", line 4, in import readline ModuleNotFoundError: No module named 'readline'

I installed pip install pyreadline

Now I'm getting this error

C:\Windows\System32>rawdog Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Scripts\rawdog.exe__main.py", line 4, in File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\rawdog\main.py", line 4, in import readline File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\readline.py", line 34, in rl = Readline() ^^^^^^^^^^ File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyreadline\rlmain.py", line 422, in init BaseReadline.init(self) File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyreadline\rlmain.py", line 62, in init__ mode.init_editing_mode(None) File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyreadline\modes\emacs.py", line 633, in init_editing_mode self._bind_key('space', self.self_insert) File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyreadline\modes\basemode.py", line 162, in _bind_key if not callable(func): ^^^^^^^^^^^^^^ File "C:\Users\myuser\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyreadline\py3k_compat.py", line 8, in callable return isinstance(x, collections.Callable) ^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'collections' has no attribute 'Callable'

biobootloader commented 9 months ago

try pip install pyreadline3 instead - sorry this should be fixed already on the github version of the code, but hasn't yet been updated on PyPI

biobootloader commented 9 months ago

it's updated on PyPI now! closing this as it should be fixed, please reopen if you experience any more issues.

thelege2nd commented 9 months ago

rawdog failed to start for some reason.**

C:\Users\thele>rawdog Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Scripts\rawdog.exe__main.py", line 7, in File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Lib\site-packages\rawdog__main.py", line 88, in main llm_client = LLMClient(config) ^^^^^^^^^^^^^^^^^ File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Lib\site-packages\rawdog\llm_client.py", line 36, in init__ {"role": "system", "content": EnvInfo(config=self.config).render_prompt()}, ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Lib\site-packages\rawdog\utils.py", line 21, in init__ self._set_from_env() File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Lib\site-packages\rawdog\utils.py", line 38, in _set_from_env self.cwd_info = self._get_cwd_info() ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Lib\site-packages\rawdog\utils.py", line 63, in _get_cwd_info size = len(list(item.iterdir())) if item.is_dir() else item.stat().st_size ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\thele\AppData\Local\Programs\Python\Python311\Lib\pathlib.py", line 931, in iterdir for name in os.listdir(self): ^^^^^^^^^^^^^^^^ PermissionError: [WinError 5] Access is denied: 'C:\Users\thele\Application Data'

So I ran CMD with admin privilege. It worked but it's showing that fatal error. is this normal? Should I still pip install pyreadline3??

image

miraculix95 commented 9 months ago

I have had the same issue. I had exactly the same error as the other guy, .... tried to manually import readline ... the same problem ... tried to import pyreadline ... again ... luckily I have seen this closed message ... so I imported the pyreadline3. And finally. The Windows installation is a pain, and after all these troubles - it cost me a significant amount of time - I am now rather cautious about the product. ... but thanks anyway ...

biobootloader commented 9 months ago

@miraculix95 how did you install rawdog? with pip install rawdog-ai or by cloning this repo?

miraculix95 commented 9 months ago

With pip install rawdog-ai

miraculix95 commented 9 months ago

One information I found missing as well: What Python versions are allowed? Is Python 3.12. allowed? What is the ~ directory for the config file in the context of a windows installation?

biobootloader commented 9 months ago

Ah, thanks there was an issue with requirements setup, fixed by @jakethekoenig here: https://github.com/AbanteAI/rawdog/pull/88

Python 3.12 should work! We'll add which versions work, but I'd assume 3.10+

The ~ directory on windows should be something like C:\Users\username

miraculix95 commented 9 months ago

Thanks a lot