Topic: Python...

Stealing PATH env variable and installing into your own custom is a HUGE problem.
It took me ages to figure out why when I needed to use Python it was completely broken.

I need somebody to tell me how I might delete your BS custom python, and then point everything to a full install version with the modules I actually need to do everything else with python.
which version, modules and otherwise else is needed for SVP?

It's worse that python essentially is installed without any means of removal from the normal routes... Since I thought I had a clean system but command line was running python from someplace... (That I then had to track down)
Completely breaking all other functions of a system for your single piece of software is a HUGE red flag.

Its now that other software which requires python and modules will never run...

---

How do I fix this so all other software will also work?
I need to install the full version of python, and remove yours. But I also want to use the software I paid for from your end...
If I am to install the full version, and disable yours, what do I need to add, or enable to maintain functionality in SVP? (I use it for Plex and MPV solely, mostly Plex)

If you can put all the correct things into your own custom, then you/I can put them in a full release of python... I just need to know what.

This is completely unacceptable software design practices.

Re: Python...

SVP "steals" nothing unless you ordered it to do so by _manually_ running "set env. variables for vapoursynth" command, which shows a _huge_ warning message you must read _before_ continue.
If you didn't read it - blame yourself.

SVP also doesn't _install_ any Python version, there's only a portable Python sitting in its own folder.

> How do I fix this so all other software will also work?

Remove SVP 4\mpv64 folder from PATH and PYTHONPATH variables.

> If I am to install the full version, and disable yours, what do I need to add

Vapoursynth

Re: Python...

So I can confirm that you are incorrect.

Having installed Python 3.11 fully, and changing the PATH variables, Plex breaks and no longer plays video (since the mpv dll is trying to do something it cannot, Plex just crashes) This is because the mpv64 plugin is no longer where it looks for python and the plugin files, since it then looks at the python folder...

When I copy the contents of the mpv64 folder into the python folder, Plex works properly again. And then I have the full use of python and its plugins... To which now function as to be expected. (I'm not going to waste time trying to identify exactly which files are needed in that folder since that's a huge waste of my time. But it does in fact work to run SVP and mpv64 from the python folder)
In this case it was the folder located in appdata/roaming/python/python311
PATH is now set to that location for python. And the contents of the mpv64 folder are now in that folder to accommodate compatibility.

Re: Python...

> So I can confirm that you are incorrect.

what exactly is incorrect?
as I said before - you have to install Vapoursynth.

Re: Python...

OP is completely correct.
I've had this exact issue for years.
I like and use and paid for SVP, so I don't want to through away the money I spent on the software...

But it completely destroys the ability to use any other Python ... anything.

I can't believe it runs this way. I've never encountered any other piece of software that completely hijacks Python for its own purposes and prevents anything else from working with it.

I wish I had answers...

Re: Python...

OP is completely incorrect big_smile
If you DON'T want to use portable Python bundled with SVP system-wide - DON'T add it to system vars. End of story.

If you WANT to use YOUR Python installation with SVP - ok, do it. You just have to install Vapoursynth.

Re: Python...

Okay... but why even make the default action do that in the first place?

Re: Python...

what "default action"?

Re: Python...

Chainik wrote:

what "default action"?

Well, are you not saying that if you don't want SVP to take control of your Python path that you have to install something externally?
Vapoursynth?

Re: Python...

You want to SVP install Vapoursynth to you?
Using your Python location.

Thank you for your suggestion. We will think about it. How to make SVP installer more smart smile

Re: Python...

Chainik wrote:

what "default action"?

I'm trying to understand how you think this happens.
I've just tried doing what you said, made sure I unticked everything except for the core application during a clean install.
It once again destroyed my Python install.
So I'm really unsure how you think this is acceptable.
Would love for you to write a small guide on how to install SVP without it ruining Python on your PC.

Re: Python...

There's no magic here.
Either you have SVP 4\mpv64 in PATH, or not.
You can easily check this by yourself.

I believe that SVP _installation_ doesn't modify PATH.
Do you really think it does?

Re: Python...

It 100% does... I don't know why you keep thinking it doesn't. It ABSOLUTELY modifies PATH.

This is the environment variables after a clean install with all default settings.
https://i.imgur.com/5Q0GP5h.png

Are you not actually a developer of the application?
Do you not know how it works?

14

Re: Python...

reynbow wrote:

It 100% does... I don't know why you keep thinking it doesn't. It ABSOLUTELY modifies PATH.

This is the environment variables after a clean install with all default settings.
https://i.imgur.com/5Q0GP5h.png

Are you not actually a developer of the application?
Do you not know how it works?


Any update on this? SVP is messing up python and causing issues with Manga/VN OCR Sugoi-Translator-Toolkit V7. Is there any detailed guide on setting other Path and correct setting for vapoursynth?

Re: Python...

ZR
SVP is messing up python

SVP is not "messing up Python", it's you who messing up Python by manually running "setup env. variables" command.
Do not run it if you don't want to "mess up Python".
Remove these variables if you don't want them. SVP doesn't need them.

reynbow
Are you not actually a developer of the application? Do you not know how it works?

Yes I am and yes I do. SVP installation doesn't modify these env. variables. The only way to modify them is _manually_ run the "setup env. variables" command.
If you have this "after a clean install with all default settings" then these variables were there already _before_ a "clean install".

16

Re: Python...

Chainik wrote:

ZR
SVP is messing up python

SVP is not "messing up Python", it's you who messing up Python by manually running "setup env. variables" command.
Do no run it if you don't want to "mess up Python".
Remove these variables if you don't want them. SVP doesn't need them.

reynbow
Are you not actually a developer of the application? Do you not know how it works?

Yes I am and yes I do. SVP installation doesn't modify these env. variables. The only way to modify them is _manually_ run the "setup env. variables" command.
If you have this "after a clean install with all default settings" then these variables were there already _before_ a "clean install".


So, the way to fix it is by deleting all SVP PATH in the Environment Variable?

Re: Python...

> So, the way to fix it is by deleting all SVP PATH in the Environment Variable?

If SVP's portable Python 3.11 breaks something in other apps - then, yes.
If you still need MPC-HC to work with Vapoursynth Filter, then you have to install system-wide Python and Vapoursynth whatever versions you want and manage them by yourself.

18 (edited by ChuckWheat 17-02-2024 20:40:00)

Re: Python...

I battled this problem this morning. I want to use SVP with Plex, but also use Python systemwide and with an IDE without confusing hiccups. I am new to Python, coding, and using an IDE. I eventually came across what I think is a temporary solution from a user on reddit:

https://www.reddit.com/r/KoboldAI/comme … ;context=3

I followed the SVP with Plex for Windows installation procedure, which involves replacing Plex's mpv.dll and creating mpv.conf like normal. Without the environment variables set to SVP's mpv64 for PATH and PYTHONPATH, I kept them as the defaults after installing Python. "C:\Users\[user]\AppData\Local\Programs\Python\Python312\" and "..\Scripts\". No PYTHONPATH variable present.

Then, I copied the entire contents of the "C:\Program Files (x86)\SVP 4\mpv64" folder into the Plex folder "C:\Program Files\Plex\Plex", replacing a few files that shared names. (copying the Plex folder first for backup of course)

This seems to work, but not perfectly. Plex for Windows displays a "Playback Error" message after launching it if something was previously playing, but actually playing something works, and SVP will do its thing. I just make sure to Stop the playback before closing Plex and this seems to mitigate the error on future Plex launches.
Most importantly, I can run Python from the Windows Terminal/Powershell, and it uses the normal Python installation. And I can use Pycharm without it confusing which Python to use or compatibility of modules with versions.

I suppose if I update Plex or SVP or any of its components in the future, I might need to re-do this. As I am inexperienced in these things, I'm not sure if this method breaks anything else, so try at your own risk.

Re: Python...

isn't it easier to install Vapoursynth and copy just a single mpv.dll?

Re: Python...

Would you be willing to help me do that? I have the "Core for Vapoursynth 64-bit" component installed through the SVP installer. I also installed Vapoursynth R65. I don't know what to do from here.

Re: Python...

ChuckWheat wrote:

Would you be willing to help me do that?

I've just encountered the same problem. I did the same thing as you to no avail - Plex was still crashing. I figured out a way, though -- a .bat file which will run Plex for me with some custom environment variables set, therefore not messing with my global Python installation.
Please note everything is hardcoded, but it should work on standard installations. If you use HTPC, you might need to modify the path, but it should be pretty readable. It won't let me attach a bat file, so I'll just include it as text - hope that's fine.

@echo off
setlocal

:: Get the current PATH
set "originalPath=%PATH%"

:: Create a new PATH, excluding directories containing 'Python'
set "newPath="
for %%P in ("%originalPath:;=";"%") do (
    echo.%%~P | find /i "Python" >nul || (
        if not defined newPath (
            set "newPath=%%~P"
        ) else (
            set "newPath=%newPath%;%%~P"
        )
    )
)

:: Add the new directory to the PATH
set "newPath=%newPath%;C:\Program Files (x86)\SVP 4\mpv64"

:: Set the PYTHONPATH
set "PYTHONPATH=C:\Program Files (x86)\SVP 4\mpv64"

:: Run Plex.exe with the new environment
cmd /C "set "PATH=%newPath%" && start "" "C:\Program Files\Plex\Plex\Plex.exe""

endlocal