GithubHelp home page GithubHelp logo

Comments (8)

Skquark avatar Skquark commented on September 26, 2024 1

Interesting that the antivirus is calling my simple bat file a Trojan, that's kinda rude of it.. It's because I have those top two lines in the bat that forces it to elevate permissions to Administrator, which is needed to run the Python stuff. Kinda annoying since I don't think there's any other method/hack to do that, thought it was an acceptable command. You'll have to trust it and add to exception, otherwise things won't work If you "disinfected", you'll have to reinstall to restore the bat script. The new bat includes that fix of changing the "python3" launcher to "py -3". I should probably add a note in my Download page to warn about the potential false positive. Thanks.

from ai-friends.

Skquark avatar Skquark commented on September 26, 2024

Interesting, that's in the sdd-venv.bat file where it seems it couldn't create the ./venv folder using "python3 -m venv .\venv", so it gave DirectoryNotFound unable to download into the venv folder. A few things could be causing that, first thought is it can't find the python3.exe file in the path. I'm thinking when you installed Python from the python.org site, you didn't check the box "Add Python 3.x to PATH", so you could try reinstalling or manually adding to Environment Paths.. This thread had a bunch of suggestions for fixing this error: https://stackoverflow.com/questions/65348890/python-was-not-found-run-without-arguments-to-install-from-the-microsoft-store
I'm also thinking you don't have the python3 file in path.. I'm thinking about replacing that with "py -3" launcher shortcut instead, which looks like the new preferred way of doing it. I had thought the python3 command was universal on all installations but apparently not. If you edit the file you have in Deep\SDDeluxe\Stable-Diffusion-Deluxe\sdd-venv.bat and replace it with this script where I replace the launcher command with py -3

@echo off
cd /D "%~dp0"
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
echo Downloading latest Stable Diffusion Deluxe and running in a Python Virtual Environment
if not EXIST .\venv (py -3 -m venv .\venv)
powershell -Command "Invoke-WebRequest https://raw.githubusercontent.com/Skquark/AI-Friends/main/Stable-Diffusion-Deluxe/Stable-Diffusion-Deluxe.py -OutFile .\venv\Stable-Diffusion-Deluxe.py"
cd .\venv
call .\Scripts\activate.bat
py -3 -m pip install --upgrade --quiet pip
py -3 -m pip install --upgrade --quiet flet
cls
flet .\Stable-Diffusion-Deluxe.py
call .\Scripts\deactivate.bat
exit /B 1

If that works, I'll update the official launch bat to be that. If it doesn't work, open a terminal and run "py --version" and let me know what it says. You can also test run just "python3" to let me know if it finds it or not. Let me know how it goes, trying to make this an easy launch process for everyone, but python installs can be inconsistent sometimes.. Thanks.

from ai-friends.

bbecausereasonss avatar bbecausereasonss commented on September 26, 2024

Thanks, that worked (sort of) got it rolling but I encountered another error.

[notice] A new release of pip is available: 23.0.1 -> 23.2.1
[notice] To update, run: python.exe -m pip install --upgrade pip
Traceback (most recent call last):
File "C:\Users\xxxx\Deep\SDDeluxe\Stable-Diffusion-Deluxe\venv\Stable-Diffusion-Deluxe.py", line 125, in
import requests
ModuleNotFoundError: No module named 'requests'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\xxxx\Deep\SDDeluxe\Stable-Diffusion-Deluxe\venv\Stable-Diffusion-Deluxe.py", line 128, in
import requests
ModuleNotFoundError: No module named 'requests'

from ai-friends.

Skquark avatar Skquark commented on September 26, 2024

Cool.. So was the fix replacing python3 with py -3 ? If so, I've got other areas where I'm launching scripts with python3 command, which is how to do it in Colab, but since it seems that it's not always there in Windows, I should replace the python3.exe with just python everywhere.
The missing requests module should be an easy fix. It's preinstalled in Colab so I just import it, but here I'm noticing the line 128 is after I do a pip install requests, so maybe there's something else going on. The only time simple imports like that haven't worked for me was when it's not ran as Administrator. Anyways, I just saved some fixes that I hope does the trick. To debug that error, I made the pip install requests show in the console, so if there was an error going on there, you should be able to see what's going on. Try running it again and let me know if that's still going on or if we got past it. Fingers' crossed... Thanks.

from ai-friends.

bbecausereasonss avatar bbecausereasonss commented on September 26, 2024

Just from copy/pasting your new bat file.

P.S: Just got this strange Kaspersky Warning.

image

from ai-friends.

bbecausereasonss avatar bbecausereasonss commented on September 26, 2024

image

from ai-friends.

Skquark avatar Skquark commented on September 26, 2024

Problem should be fixed with the latest bat files. I added additional bat debug scripts in the installed program dir, so if there's still an issue you can try those.
It seems like the permission error was when running the venv with a mismatched version of pip. I had pip updating, but was using the wrong python launcher. Changed form py -3 to the ./Scripts/python.exe and it looks like it's able to upgrade it now. I can't do much about the AV false positive on the bat, but at least we know about it. Please lemme know if there's any more errors, hope all's functional now.

from ai-friends.

Skquark avatar Skquark commented on September 26, 2024

I reworked the bat file launchers to get rid of the line that promotes command prompt to Admin, so it should no longer show as a virus. The setup should now add the flag to the shortcut link to Run as Administrator, and if you try to open bat files directly it gives a message to run as admin if you're not. Hope everything is setup right, lemme know if not.

from ai-friends.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.