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

Inconsistent Virtual Environment Activation Path for Windows in setup.sh Script #129

Open
elharony opened this issue Oct 28, 2024 · 0 comments

Comments

@elharony
Copy link

Description:

The current setup.sh script uses the default activation path .venv/bin/activate for virtual environments, which works on Linux and macOS systems. However, on Windows, the correct path for activating the virtual environment is .venv/Scripts/activate. This discrepancy causes the script to fail when trying to activate the virtual environment on Windows machines.

Steps to Reproduce:

  1. Clone the repository and navigate to the project directory on a Windows machine.
  2. Run ./setup.sh.
  3. The script will attempt to activate the virtual environment using .venv/bin/activate, resulting in an error:
./setup.sh: line 18: .venv/bin/activate: No such file or directory

Expected Behavior:

The virtual environment should be activated using the correct path on both Windows (.venv/Scripts/activate) and Linux/macOS (.venv/bin/activate).

Proposed Solution:

Add an OS check within the setup.sh script to determine the appropriate activation path based on the user's operating system:

if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
 source .venv/Scripts/activate  # Windows activation path
else
 source .venv/bin/activate  # Linux/macOS activation path
fi
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