Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
28c4c9b9
Unverified
Commit
28c4c9b9
authored
Jan 28, 2023
by
AUTOMATIC1111
Committed by
GitHub
Jan 28, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7200 from Spaceginner/master
Add a Python version check
parents
ce72af87
56c83e45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
.gitignore
.gitignore
+1
-0
launch.py
launch.py
+33
-0
No files found.
.gitignore
View file @
28c4c9b9
...
...
@@ -33,3 +33,4 @@ notification.mp3
/test/stdout.txt
/test/stderr.txt
/cache.json
no_py_ver_warning
launch.py
View file @
28c4c9b9
...
...
@@ -17,6 +17,38 @@ stored_commit_hash = None
skip_install
=
False
def
check_python_version
():
if
not
os
.
path
.
isfile
(
"no_py_ver_warning"
):
version
=
sys
.
version_info
version_range
=
None
if
platform
.
system
()
==
"Linux"
:
version_range
=
range
(
7
+
1
,
11
+
1
)
else
:
version_range
=
range
(
7
+
1
,
10
+
1
)
try
:
assert
version
.
major
==
3
and
version
.
minor
in
version_range
,
f
"""
=== Warning ===
This program was tested only with 3.10 Python, but you have {version.major}.{version.minor} Python.
If you encounter an error with "RuntimeError: Couldn't install torch." message,
or any other error regarding unsuccessful package (library) installation,
please downgrade (or upgrade) to the latest version of 3.10 Python
and delete current Python and "venv" folder in WebUI's directory.
You can download 3.10 Python from here: https://www.python.org/downloads/release/python-3109/
You will see this warning only once, delete file "no_py_ver_warning" file to show this warning again.
=== Warning ===
Press ENTER to continue...
\
"""
except
AssertionError
as
e
:
print
(
e
)
with
open
(
"no_py_ver_warning"
,
"w"
):
pass
input
()
def
commit_hash
():
global
stored_commit_hash
...
...
@@ -321,5 +353,6 @@ def start():
if
__name__
==
"__main__"
:
check_python_version
()
prepare_environment
()
start
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment