Noah
Noah

Reputation: 11

Trying to make a python exe that works on all computers

Ive been trying to turn my pthon script into a standalone exe with pyinstaller, the problem is I need to include python-vlc and when I run

pyinstaller --add-binary "E:\Documents\Spotify Posters\Spotify Poster Coding Shit\libvlc.dll;." --add-binary "E:\Documents\Spotify Posters\Spotify Poster Coding Shit\libvlccore.dll;." --onefile test3.py

I get the error

Traceback (most recent call last):
    File "test3.py", line 1120, in <module>
        main()
    File "test3.py", line 1116, in main
        app = SpotifyPosterApp(root)
        ^^^^^^^^^^^^^^^^^^^^^^
    File "test3.py", line 108, in ~init~
        self.backgroundplayer = vlc.MediaPlayer(BACKGROUNDVIDEO_PATH) 
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "vlc.py", line 3287, in __new
        AttributeError: 'NoneType' object has no attribute 'media_player_new'
[32308] Failed to execute script 'test3' due to unhandled exception!

if I dont include the binaries the code will run as an exe on my main PC but I need it so that the code can be transferred to multiple PCs and the moment I include the binaries I get the error stated above, any help would be great thank you

Upvotes: 0

Views: 80

Answers (1)

fam-woodpecker
fam-woodpecker

Reputation: 707

I'm pretty sure that the --add-data and --add-binary take the format SOURCE:DEST meaning that the separator is a colon (:), not a semi-colon (;). Try a relative path instead.

e.g. say you run the installer from the folder Spotify Posters

pyinstaller --add-binary "Spotify Poster Coding Shit\libvlc.dll:." --add-binary "Spotify Poster Coding Shit\libvlccore.dll:." --onefile test3.py

Upvotes: 0

Related Questions