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 creates executable virtual env with python 3.12.6 #172

Closed integrativernd-dev closed 4 days ago

integrativernd-dev 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.