You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use this package for a project and we discovered a bug for Windows users. If you want to install dependencies on windows you will receive an OSError - File not found.
We looked a bit deeper into this bug and found out that the path to the python binary (on windows \.venv\Scripts\python.exe) is passed as a relative path. The problem is that Popen on windows does not execute this path from the current working directory (see: https://stackoverflow.com/a/21412727).
Therefore the argument for the Popen call needs to have an absolute path. This could be fixed with (if path contains the absolute path)
@propertydef_python_rpath(self):
"""The relative path (from environment root) to python."""# Windows virtualenv installation installs pip to the [Ss]cripts# folder. Here's a simple check to support:ifsys.platform=='win32':
returnos.path.join(self.path, 'Scripts', 'python.exe')
returnos.path.join('bin', 'python')
Alternatively, it could be solved with a os.path.abspath for Windows.
The text was updated successfully, but these errors were encountered:
dolfinus
added a commit
to dolfinus/virtualenv-api
that referenced
this issue
May 13, 2021
We use this package for a project and we discovered a bug for Windows users. If you want to install dependencies on windows you will receive an
OSError - File not found
.We looked a bit deeper into this bug and found out that the path to the python binary (on windows
\.venv\Scripts\python.exe
) is passed as a relative path. The problem is thatPopen
on windows does not execute this path from the current working directory (see: https://stackoverflow.com/a/21412727).Therefore the argument for the
Popen
call needs to have an absolute path. This could be fixed with (if path contains the absolute path)Alternatively, it could be solved with a
os.path.abspath
for Windows.The text was updated successfully, but these errors were encountered: