Skip to content

Commit

Permalink
repair #6612
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Jan 10, 2023
1 parent 29fb532 commit 9cfd10c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions webui.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off

if not defined PYTHON (set PYTHON=python)
if not defined VENV_DIR (set VENV_DIR=%~dp0\venv)
if not defined VENV_DIR (set VENV_DIR=%~dp0%venv)

set ERROR_REPORTING=FALSE

Expand All @@ -13,16 +13,16 @@ echo Couldn't launch python
goto :show_stdout_stderr

:start_venv
if [%VENV_DIR%] == [-] goto :skip_venv
if ["%VENV_DIR%"] == ["-"] goto :skip_venv

dir %VENV_DIR%\Scripts\Python.exe >tmp/stdout.txt 2>tmp/stderr.txt
dir "%VENV_DIR%\Scripts\Python.exe" >tmp/stdout.txt 2>tmp/stderr.txt
if %ERRORLEVEL% == 0 goto :activate_venv

for /f "delims=" %%i in ('CALL %PYTHON% -c "import sys; print(sys.executable)"') do set PYTHON_FULLNAME="%%i"
echo Creating venv in directory %VENV_DIR% using python %PYTHON_FULLNAME%
%PYTHON_FULLNAME% -m venv %VENV_DIR% >tmp/stdout.txt 2>tmp/stderr.txt
%PYTHON_FULLNAME% -m venv "%VENV_DIR%" >tmp/stdout.txt 2>tmp/stderr.txt
if %ERRORLEVEL% == 0 goto :activate_venv
echo Unable to create venv in directory %VENV_DIR%
echo Unable to create venv in directory "%VENV_DIR%"
goto :show_stdout_stderr

:activate_venv
Expand Down

9 comments on commit 9cfd10c

@younyokel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love you bruh

@mezotaken
Copy link
Collaborator

@mezotaken mezotaken commented on 9cfd10c Jan 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any difference between %~dp0venv and %~dp0%venv except readability? I'll never touch a .bat file here again, that's for sure. Thanks for the fix.

@tonis110
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brother, do you need to buy?

@dvdvideo1234
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that will pretty much do it

@tonis110
Copy link

@tonis110 tonis110 commented on 9cfd10c Jan 11, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dvdvideo1234
Copy link

@dvdvideo1234 dvdvideo1234 commented on 9cfd10c Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I think you rather need the expression in green. It will replace %venv%:
image

@AUTOMATIC1111
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mezotaken: don't worry about it.

dvdvideo1234: it meeds to be a literal venv and not an environment variable named venv.

@Ozymandias22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I'm don't really know code and stuff like this. Is this for the inpaint brush duplication fix?

@dvdvideo1234
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ozymandias22

This is rather for the incorrect paths to VENV in the startup bat file

Please sign in to comment.