Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jtorreggiani opened this issue Oct 20, 2024 · 2 comments
Labels
bug Something isn't working work-in-progress

Comments

@jtorreggiani
Copy link
Collaborator

jtorreggiani commented Oct 20, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working work-in-progress
Projects
None yet
Development

No branches or pull requests

2 participants