Skip to content
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

AttributeError: 'NoneType' object has no attribute 'media_player_new' #89

Closed
bijiaqing opened this issue Feb 13, 2021 · 5 comments
Closed

Comments

@bijiaqing
Copy link

bijiaqing commented Feb 13, 2021

不是很懂这方面的解决办法,上网简单搜了一下,把vlc的几个devel包也安装了但还是报错。
OS:Fedora 31 64-bit

[jiaqing@x1-carbon DD_Monitor]$ ./dist/DDMonitor/DDMonitor
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
/bin/sh: /usr/bin/lspci: No such file or directory
2021-02-13 13:00:18,503 [MainThread ] [INFO ] 系统信息:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
Stepping: 10
CPU MHz: 3758.785
CPU max MHz: 4200.0000
CPU min MHz: 400.0000
BogoMIPS: 4199.88
Virtualization: VT-x
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 1 MiB
L3 cache: 8 MiB
NUMA node0 CPU(s): 0-7
Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown: Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d

2021-02-13 13:00:18,503 [MainThread ] [INFO ] GPU信息:

2021-02-13 13:00:18,504 [MainThread ] [INFO ] libvlc env: PYTHON_VLC_LIB_PATH=
2021-02-13 13:00:18,504 [MainThread ] [INFO ] plugin env: PYTHON_VLC_MODULE_PATH=
2021-02-13 13:00:18,504 [MainThread ] [INFO ] libvlc path: /home/jiaqing/DD_Monitor/dist/DDMonitor/libvlc.so.5
2021-02-13 13:00:18,504 [MainThread ] [INFO ] vlc version: b'3.0.11.1 Vetinari'
2021-02-13 13:00:18,617 [MainThread ] [ERROR]
!!!UNCAUGHT EXCEPTION!!!*********
Type: <class 'AttributeError'>
Value: 'NoneType' object has no attribute 'media_player_new'
Traceback:
File "DD监控室.py", line 1185, in
mainWindow = MainWindow(cacheFolder, progressBar, progressText)
File "DD监控室.py", line 351, in init
hardwareDecode=self.config['hardwareDecode']))
File "VideoWidget_vlc.py", line 279, in init
self.newPlayer() # 实例化 player
File "VideoWidget_vlc.py", line 905, in newPlayer
self.player = self.instance.media_player_new() # 视频播放


[66707] Failed to execute script DD监控室

@bijiaqing
Copy link
Author

bijiaqing commented Feb 13, 2021

按照开发者在#84中所说的添加vlc的plugins地址到scripts/run.sh后, (export VLC_PLUGIN_PATH=/usr/lib64/vlc/plugins/)
重新运行script/build_linux.sh和dist/DDMonitor/DDMonitor,
问题依旧存在.

@ssysm
Copy link
Contributor

ssysm commented Feb 14, 2021

收到,有空看下Fedora

@ssysm
Copy link
Contributor

ssysm commented Feb 14, 2021

F33, VLC 3.0.11.1。
运行了 export VLC_PLUGIN_PATH=/usr/lib64/vlc/plugins/ 之后弹窗消失,程序正常运行。
试了一下,无法复现,有待考察

按理说连devel包都不用装,装vlc的时候vlc-core直接就把所有的对象文件都装好了。很奇怪 ,再换几个distro后面再来看看。

我的env

envs

SHELL=/bin/bash

SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/22184,unix/unix:/tmp/.ICE-unix/22184

COLORTERM=truecolor

HISTCONTROL=ignoredups

XDG_MENU_PREFIX=gnome-

HISTSIZE=1000

HOSTNAME=fedora

SSH_AUTH_SOCK=/run/user/1000/keyring/ssh

XMODIFIERS=@im=ibus

DESKTOP_SESSION=gnome

EDITOR=/usr/bin/nano

PWD=/home/linux/Documents/DD_Monitor/dist/DDMonitor

LOGNAME=linux

XDG_SESSION_DESKTOP=gnome

XDG_SESSION_TYPE=wayland

XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.JSGXY0

GJS_DEBUG_TOPICS=JS ERROR;JS LOG

GDM_LANG=en_US.UTF-8

HOME=/home/linux

USERNAME=linux

LANG=en_US.UTF-8

LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.webp=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=01;36:.au=01;36:.flac=01;36:.m4a=01;36:.mid=01;36:.midi=01;36:.mka=01;36:.mp3=01;36:.mpc=01;36:.ogg=01;36:.ra=01;36:.wav=01;36:.oga=01;36:.opus=01;36:.spx=01;36:.xspf=01;36:

XDG_CURRENT_DESKTOP=GNOME

VTE_VERSION=6201

WAYLAND_DISPLAY=wayland-0

GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/422f6338_2ae6_4410_9f61_1ed2eb52a07e

GJS_DEBUG_OUTPUT=stderr

MOZ_GMP_PATH=/usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed

GNOME_SETUP_DISPLAY=:1

XDG_SESSION_CLASS=user

TERM=xterm-256color

LESSOPEN=||/usr/bin/lesspipe.sh %s

USER=linux

GNOME_TERMINAL_SERVICE=:1.193

DISPLAY=:0

SHLVL=1

QT_IM_MODULE=ibus

XDG_RUNTIME_DIR=/run/user/1000

VLC_PLUGIN_PATH=/usr/lib64/vlc/plugins/

XDG_DATA_DIRS=/home/linux/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/

PATH=/home/linux/.local/bin:/home/linux/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin

GDMSESSION=gnome

DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

MAIL=/var/spool/mail/linux

OLDPWD=/home/linux

_=/usr/bin/env

@bijiaqing
Copy link
Author

bijiaqing commented Feb 14, 2021

对不起,我发现可能有一部分是我的问题。
我运行DDMonito的方式是直接运行path/to/dist/DDMonitor/DDMonitor,这导致在 scripts/run.sh 里设定的变量并没有被调用。
不过 scripts/run.sh 也存在问题,因为最后一行 ./DDMonitor 并不能找到executable
scripts/run.sh 里的 ./DDMonitor 改为 path/to/dist/DDMonitor/DDMonitor 之后运行 scripts/run.sh 问题才解决

@ssysm
Copy link
Contributor

ssysm commented Feb 14, 2021

程序打包完了之后应该会把run.sh复制到dist/DDMonitor里,但是手动声明VLC_PLUGIN_PATH之后应该直接运行./DDMonitor就好了。运行run.sh的话会把手动声明的变量覆盖掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants