Oserror: looks like you do not have git installed, please install.\
I have created a container to run Jupyterlab (to run tensorflow). I try to replicateText Classification exampleand I ran the notebook at my container.However, I encounter this error while running one of the code:image1438×1617 215 KBError Message: OSError: Looks like you do not have git installed, please install.I did install git-lfs in my ubuntu (WSL).I tried many possible solutions but the issue still persists.
2023-09-05T21:22:21Z
Hi!Ok, from your message I gather that you’re trying to run a Jupyter notebook within a container. When the notebook attempts to interact with git, anOSErrorsuggests that git is not installed. Despite installing git-lfs on your Ubuntu (WSL), the issue persists.So, I would approach it like this:Containers run in isolation from the host OS, so if git is installed on the host, the container may not have access to it.Installing git-lfs doesn’t necessarily mean git itself is installed. Git Large File Storage (git-lfs) is an extension but not a replacement for git.The error might originate from the Python environment within the container rather than the OS layer.And if you think you found the issue try this,:Install git in the container: If git is not present in the container, you’ll need to install it there.Open a shell into the container:docker exec -it <container_name_or_id> /bin/bashInstall git:apt-get update && apt-get install -y gitEnsure PATH is correctly set: It’s possible git is installed but not found in the PATH.In the container, check the path:echo $PATHEnsure the directory containing the git executable is in the PATH.Check from Python: Sometimes, the Python environment might not detect installed packages correctly.In the Jupyter notebook, try running:import shutil
shutil.which("git")This should return the path to the git executable, if available.In short:Step into your container and ensuregitis properly installed.Double-check your container’sPATHvariable.Testgitaccessibility from your Python environment inside Jupyter.Hope this helps!
2023-09-06T04:27:34Z
Hi I followed your steps but the error still persists. However, the error resolved after running this code:apt-get install git-lfsin docker environment.Thank you so much.