New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
script with python-vlc module failed after bundled by pyinstaller #3448
Comments
Well, this gives no explanation why it fails, thus you need to debug this yourself. Most propably not all required files are packages. Please have a look at Make sure everything is packaged correctly for tips to find out what is missing. |
Thanks, The VLC contains a plugin folder, I just copy the plugins folder from VLC installation folder to the bundled folder, and then it work correctly. |
Here is the same issue but on linux. I placed plugins directory in "dist/[my application name]" with symbolic link. However I encounter Could you explain this with more detail? |
Hurray, I figured it out. Let's say your application name is vlc-example. Your working directory looks like below vlc-example/ You would run pyinstaller in vlc-example. To fix this error, dist And one more tip. If you want to make one-file bundled application, you should let pyinstaller know all the libraries in plugins directories with their directory hierarchy in spec file. Please find attached spec file. I hope this helps. |
WOW,Thanks
It is long time ago, I almost forgot how to fixied it.
I used pyinstaller to bundle a vlc-based application, I fixed the issue with add "--add-binary "C:\Program Files\VideoLAN\VLC\plugins";plugins " in the pyinstaller command line.
But in a windows without install vlc, it still failed by can not import 'libvlc.dll', I tried to use the --add-binary option for libvlc.dll, but it not work.
Thanks you reply it.
safecorner@163.com
From: jspking
Date: 2019-01-30 16:10
To: pyinstaller/pyinstaller
CC: safecorner; State change
Subject: Re: [pyinstaller/pyinstaller] script with python-vlc module failed after bundled by pyinstaller (#3448)
Hurray, I figured it out.
Let's say your application name is vlc-example. Your working directory looks like below
vlc-example/
└── examples_tkvlc.py
You would run pyinstaller in vlc-example.
crong@crong-H270-HD3:~/work/personal/jspkingproject/python/vlc-example$ pyinstaller examples_tkvlc.py
And when you run the packaged application 'examples_tkvlc' in dist/examples_tkvlc, you will get error like main libvlc error: No plugins found! Check your VLC installation.
To fix this error,
Just copy the whole vlc plugins directory making vlc directory in dist/examples_tkvlc. This is somewhat confusing... My English sucks. Just see below directory structure.
dist
└── examples_tkvlc
├── tcl
│ ├── encoding
│ ├── http1.0
│ ├── msgs
│ ├── opt0.4
│ └── tcl8
│ └── platform
├── tk
│ ├── images
│ ├── msgs
│ └── ttk
└── vlc
└── plugins
├── access
├── access_output
├── audio_filter
├── audio_mixer
├── audio_output
├── codec
├── control
├── demux
├── gui
├── lua
├── meta_engine
├── misc
├── mmx
├── mux
├── notify
├── packetizer
├── services_discovery
├── sse2
├── stream_filter
├── stream_out
├── text_renderer
├── video_chroma
├── video_filter
├── video_output
└── visualization
And one more tip. If you want to make one-file bundled application, you should let pyinstaller know all the libraries in plugins directories with their directory hierarchy in spec file. Please find attached spec file.
I hope this helps.
sv_ui_main.spec.txt
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I have a three +1 step solution for this problem:Working with pyinstaller onefile "exe" like a charm
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except AttributeError:
base_path = os.path.abspath(".")
# Python 3.8 things:
with os.add_dll_directory(os.path.join(base_path, "VLC")):
import vlc +1. Don't forget to add "VLC" folder to .spec file, like this:
|
ENV:
windows 10 simple Chinese version
python 3.6.5
pip 9.0.3
pyinstaller 3.4.dev0+f482da7bc
python_vlc-1.1.2-py3.6.egg
vlc media player 3.0.0 Vetinari
PACKING COMMAND:
pyinstaller sample.py --onedir --debug --noupx --workpath=d:\windows\ktvbuild --distpath=.
TEST SCRIPT:
test script sample.py :
RUN WITH PYTHON
python sample.py
run sample.py with python, it done correct,
RUN smple.exe
go
The text was updated successfully, but these errors were encountered: