-
Notifications
You must be signed in to change notification settings - Fork 4
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
VirtualEnv's pip install -r requirements.txt
fails because git behaves differently when shell=False
passed to subprocess.run()
#365
Comments
pip install -r
command fails on my M1 because PATH is passed to env=
argpip install -r requirements.txt
fails becuase git behaves differently when
shell=False passed to
subprocess.run()`
pip install -r requirements.txt
fails becuase git behaves differently when
shell=False passed to
subprocess.run()`pip install -r requirements.txt
fails because git behaves differently when
shell=False passed to
subprocess.run()`
pip install -r requirements.txt
fails because git behaves differently when
shell=False passed to
subprocess.run()`pip install -r requirements.txt
fails because git behaves differently when shell=False
passed to subprocess.run()
@nickjalbert any reason we should not pass |
Adding |
Hmm, I don't know why |
Including PATH in the env we pass to the
subprocess.run
causes mygit
to use/usr/local/git/etc/gitconfig
which refers to files that don't exist in my homedir (~/.gitcinclude
, `~/.gitignore, etc.).agentos/pcs/virtual_env.py
Lines 214 to 219 in 4030b81
I verified this by running the following after activating virtualenv created by agentos for the agent:
which fails with:
the
~/.gitignore'
in the error is referring to a line in/usr/local/git/etc/gitconfig
.And then I run it again, but remove
/usr/local/bin
from the PATH in the command:...and the pip install runs fine.
Running the pip command directly in my bash shell works fine. That is, the following works fine (note that PATH is the same):
I believe the problem is that we are currently passing shell=False to
subprocess.run()
, and so git is behaving differently for that subprocess than it does for me inside my shell (i.e., git seems to be using that conf file/usr/local/git/etc/gitconfig
but not for my shell.I verified this by running the same python command inside the virtualenv as before, except i set
shell=True
and it succeeds:The text was updated successfully, but these errors were encountered: