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

Developer shell fails in conda environments #1060

Open
Michael-Geuenich opened this issue Feb 4, 2025 · 0 comments
Open

Developer shell fails in conda environments #1060

Michael-Geuenich opened this issue Feb 4, 2025 · 0 comments

Comments

@Michael-Geuenich
Copy link

Describe the bug

The developer__shell tool fails to capture the output of Python scripts when executed within a conda environment. This prevents users from running Python scripts inside their conda environments as expected when u
sing the tool, as no output is captured from the executed script.

To Reproduce

Steps to reproduce the behavior:

  1. Create a minimal Python script: Using the developer__text_editor tool, create a file named reprex_script.py with the following content:

    import sys
    print("Hello from python", file=sys.stderr)

    Save this script to a directory, e.g., /Users/michael/CampbellLab/2024_PDAC_IMC/.

  2. Create a conda environment: Use the developer__shell tool to create a new conda environment named reprex_env with Python 3.10:

    conda create -n reprex_env python=3.10 -y
  3. Attempt to run the Python script within the conda environment: Use the developer__shell tool to execute the script within the activated conda environment, redirecting stderr to stdout:

    conda activate reprex_env && python /Users/michael/CampbellLab/2024_PDAC_IMC/reprex_script.py 2>&1

    Observe that no output is captured or displayed.

  4. Run the same script outside of the conda environment: Use the developer__shell tool to execute the same script without activating the conda environment, redirecting stderr to stdout:

     python /Users/michael/CampbellLab/2024_PDAC_IMC/reprex_script.py 2>&1

    Observe that the output "Hello from python" is correctly captured and displayed.

Expected behavior

When running the Python script within the conda environment using the developer__shell tool, the script should print "Hello from python" to stderr, which should be captured and displayed by the tool. The output s
hould be the same as when running the script outside of the conda environment.

Screenshots

Not applicable, as the issue is with the shell output not being captured, rather than a visual element.

Please provide following information:

  • OS & Arch: macOS arm64
  • Interface: CLI
  • Version: latest version
  • Extensions enabled: computercontroller, developer
  • Provider & Model: Google - gemini-1.5-pro (or whatever model you are currently using)

Additional context

The developer__shell tool works correctly when executing commands outside of a conda environment. The issue arises specifically when a conda environment is activated prior to running the python script, as demonst
rated in the steps above. This suggests a problem with how the developer__shell tool interacts with conda environment activation and process management. The fact that even echo commands fail within the conda en
vironment suggests the problem is not with python, but with the shell execution environment itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant