Closed picarica closed 2 years ago
Does source venv/bin/activate
output anything?
Does
source venv/bin/activate
output anything?
nope, its empty
bash: venv/bin/activate: No such file or directory
i am not sure why, it suses the command used in the documentation, even when cloning it results the same folder without the activate bin
You should check that python3-venv
or virtualenv
is installed.
python3 -c 'import venv'
should not return any errors
python3 -m venv venv/
should populate the directory
Have you set a custom value for python_cmd
in webui-user.sh
?
python3 -c 'import venv
ran fine without errors
python3 -m venv venv/
fixed it, thanks for your help
Same issue, except when running source venv/bin/activate
it just spews the exact same error.
Well, I met this bug too under my old machine Ubuntu 16.04, and use 2 hours to find solution....
the clue of this problem is 'ensurepip component is missing/disabled on Ubuntu' but ensurepip
is invoked in python3 -m venv venv/
Because I found the when I type python3 -m venv venv/
error show:
Error: Command '['/home/whoami/stable-diffusion-webui/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
I run python3 -Im ensurepip --upgrade --default-pip
shows:
python3: No module named ensurepi
Solution is simple:
/python3 -m venv venv/ --without-pip
to generate 'activate' file in venv/bin
folder
For others still stuck, I noticed the venv included in Automatic1111's clone of SDUI won't work as expected if your local Python version is different from the version used in that venv (3.8).
After a lot of research:
sudo apt-get install python3.8-venv
[^1]: I encountered the dreaded ensurepip error ("the virtual environment was not created successfully because ensurepip is not available") while troubleshooting the OP, which led me to this Stackoverflow trail/answer
@lizekui @awwalm
Hi,
I have followed both of your instructions, but still having the same error. Do you have any idea ?
Thanks
@lizekui @awwalm
Hi,
I have followed both of your instructions, but still having the same error. Do you have any idea ?
Thanks
You need to enter the stable-diffusion-webui folder, execute python3 -m venv venv/
then execute the bash script again.
cd stable-diffusion-webui
python3 -m venv venv/
cd ..
bash <(wget -qO- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh)
python3 -m venv venv/
Does it matter if I use python3 or python? I installed 3106, set webui-user with python_cmd="python" rather than python3, since 'python3' is not recognized. Still getting the same error when I run the sh in Git Bash (win10) sd-webui folder. not too sure why I needa cd.. out of it (then I get the python3 not found, hence I'm asking). 10x
python3 -c 'import venv'
sudo python3 -m venv venv/
I needed a sudo on there as well, for permission's sake
I meat this problem too.
and……I delete all venv folder.Both at my home folder and at this mother folder.then I run
bash webui.sh
and it's work.
urrrrrr sorry its also have some problems.......just solve venv's problem yet.......
go to /home/whoami/stable-diffusion-webui/
, whoami is your current username. and rm -rf venv/
, and run python3 -m venv venv/
In aws I used t2.xlarge instance and download was instant for some reason, otherwise it was not working in smaller instances.
get it. I have solved it at 4.10, but thanks also. I remenber I delete the .venv at root directory to address it.Or I forget the truth....
it works for me.
rm -rf venv
./webui.sh
it would re-create a new venv python, and it works fine.
You should check that
python3-venv
orvirtualenv
is installed.
python3 -c 'import venv'
should not return any errors
python3 -m venv venv/
should populate the directoryHave you set a custom value for
python_cmd
inwebui-user.sh
?
it works
Solved by "chown -R $USER:$USER /var/www/.../stable-diffusion-webui"
python3 -m venv venv/
That fixed it for me. Thanks!
sudo apt update
cd stable-diffusion-webui
rm -rf venv
sudo apt install python3-venv
./webui.sh
solved my problem
sudo apt install python3-venv
python3 -m venv venv/
source venv/bin/activate
It works for me.
For others still stuck, I noticed the venv included in Automatic1111's clone of SDUI won't work as expected if your local Python version is different from the version used in that venv (3.8).
After a lot of research:
- I installed the venv for python 3.8 despite running python 3.10 on Ubuntu 20.041:
sudo apt-get install python3.8-venv
- Followed @lizekui 's instructions.
- Executed the bash script and it finally ran.
Footnotes
- I encountered the dreaded ensurepip error ("the virtual environment was not created successfully because ensurepip is not available") while troubleshooting the OP, which led me to this Stackoverflow trail/answer ↩
This was it for me as well. Using pyenv, within the working directory, I simply
pyenv install 3.10
pyenv local 3.10
./webui.sh
Should probably be notated in the documentation, thank you for noticing this, helped a lot
^ uncommenting that line in webui-user.sh
did it for me.
(I had done pyenv install 3.10 && pyenv local 3.10
prior to that)
Related Stack Overflow discussion.
If you use pyenv, create a virtual environment and then export python_cmd
to point to the Python of the virtual environment
E.g.
pyenv virtualenv 3.10 stable-diffusion-webui
pyenv local stable-diffusion-webui
export python_cmd="$HOME/.pyenv/versions/stable-diffusion-webui/bin/python3"
./webui.sh
Same problem when i run " python3 -c 'import venv' " ran fine without errors but when i run " python3 -m venv venv/ " it ran without error but it also doesn't do anything
When i try to Install Pyenv prereqs it outputs: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
When i try to install pyenv it outputs: WARNING: Can not proceed with installation. Kindly remove the '/home/jax_sparrow/.pyenv' directory first.
When i try to install Python 3.10 it outputs:
OS: Window 11 Home
In my case deleting the venv folder helped.
If not try to enable in webui-user.sh:
# python3 executable
python_cmd="python3"
had this problem cuz I was running python at version 3.12
as default, switched to 3.10.6
and it all worked fine.
Describe the bug after installing all dependencies i stil get error ERROR: Cannot activate python venv, aborting...
To Reproduce Steps to reproduce the behavior: 1.i just pasted bash <(wget -qO- https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh),
Expected behavior to work
Screenshots
Desktop (please complete the following information):
Additional context i have Linux Mint 20.3 Cinnamon