block / goose

Goose is a developer agent that operates from your command line to help you do the boring stuff.
https://block.github.io/goose/
Apache License 2.0
108 stars 17 forks source link

pipx install goose-ai==0.9.5 --python 3.12.7 installs goose with python 3.12.6 virtual environment #173

Closed jtorreggiani closed 3 days ago

jtorreggiani commented 4 days ago

pipx doesn't seem to install goose with the correct python version. By default goose seems to look for your system python3 version which is in my case is 3.13.0. When I explicitly specify the goose version and python version pipx installs goose with 3.12.6.

pipx install goose-ai==0.9.5 --python 3.12.7 --force
The command 'python3.12' located at '/opt/homebrew/bin/python3.12' will be used. It may not match the specified version 3.12.7 at the micro/patch level.
  installed package goose-ai 0.9.5, installed using Python 3.12.6
  These apps are now globally available
    - goose
done! ✨ 🌟 ✨

I get errors running commands.

File "/Users/jtorreggiani/.local/pipx/venvs/goose-ai/lib/python3.12/site-packages/exchange/langfuse_wrapper.py", line 51, in <module>
    LANGFUSE_ENV_FILE = os.path.join(PACKAGE_ROOT, ".env.langfuse.local")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

Inspecting the executable I see the python path.

#!/Users/jtorreggiani/.local/pipx/venvs/goose-ai/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from goose.cli.main import cli
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(cli())

Confirmed it is using Python 3.12.6

/Users/jtorreggiani/.local/pipx/venvs/goose-ai/bin/python --version
Python 3.12.6

If change into the goose direction and sync the environment and create a virtual env and update

uv sync
Resolved 105 packages in 7ms
Audited 92 packages in 0.55ms
cd ~/organizer/work/goose-projects/goose
uv sync
uv venv
Using CPython 3.12.7
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
source .venv/bin/activate

And patch the python path in the executable.

#!/Users/jtorreggiani/organizer/work/goose-projects/goose/.venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from goose.cli.main import cli
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(cli())

I can run goose from other directories and seems to otherwise work as expected.

Apologies I created this issue with the wrong Github account and closed the original. 😅

michaelneale commented 3 days ago

hrm - yeah this isn't good. I did a pipx uninstall goose-ai and then install:

goose --version
Traceback (most recent call last):
  File "/Users/micn/.local/bin/goose", line 5, in <module>
    from goose.cli.main import cli
  File "/Users/micn/.local/pipx/venvs/goose-ai/lib/python3.12/site-packages/goose/cli/main.py", line 10, in <module>
    from goose.cli.config import SESSIONS_PATH
  File "/Users/micn/.local/pipx/venvs/goose-ai/lib/python3.12/site-packages/goose/cli/config.py", line 9, in <module>
    from exchange.providers.ollama import OLLAMA_MODEL
  File "/Users/micn/.local/pipx/venvs/goose-ai/lib/python3.12/site-packages/exchange/__init__.py", line 6, in <module>
    from exchange.exchange import Exchange  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/micn/.local/pipx/venvs/goose-ai/lib/python3.12/site-packages/exchange/exchange.py", line 6, in <module>
    from exchange.langfuse_wrapper import observe_wrapper
  File "/Users/micn/.local/pipx/venvs/goose-ai/lib/python3.12/site-packages/exchange/langfuse_wrapper.py", line 51, in <module>
    LANGFUSE_ENV_FILE = os.path.join(PACKAGE_ROOT, ".env.langfuse.local")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen posixpath>", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType
michaelneale commented 3 days ago

should be fixed now