jeanslack / Videomass

Videomass is a free, open source and cross-platform GUI for FFmpeg and yt-dlp
https://jeanslack.github.io/Videomass/
GNU General Public License v3.0
1.08k stars 50 forks source link

Videomass on Ubuntu 18.04 with Python 3.6.9: AttributeError: module 'wx' has no attribute 'NewIdRef' #51

Closed arrowgent closed 2 years ago

arrowgent commented 2 years ago

install process:

To install Videomass add this [PPA](https://launchpad.net/~jeanslack/+archive/ubuntu/videomass) to your system:

$ sudo add-apt-repository ppa:jeanslack/videomass
$ sudo apt-get update
$ sudo apt install python3-videomass

sudo apt install python3-videomass

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python3-wxgtk4.0
Suggested packages:
  atomicparsley yt-dlp
The following NEW packages will be installed:
  python3-videomass python3-wxgtk4.0
0 upgraded, 2 newly installed, 0 to remove and 18 not upgraded.
Need to get 0 B/6,905 kB of archives.
After this operation, 43.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

run videomass, launches and queries ffmpeg & youtube-dl/yt-dlp then requests restart after restart:

videomass

Info: executable=/usr/bin/videomass
06:17:10 AM: Debug: Adding duplicate image handler for 'Windows bitmap file'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/videomass/gui_app.py", line 117, in OnInit
    main_frame = MainFrame()
  File "/usr/lib/python3/dist-packages/videomass/vdms_main/main_frame.py", line 126, in __init__
    self.ytDownloader = youtubedl_ui.Downloader(self)
  File "/usr/lib/python3/dist-packages/videomass/vdms_panels/youtubedl_ui.py", line 339, in __init__
    t_id = wx.NewIdRef()
AttributeError: module 'wx' has no attribute 'NewIdRef'
OnInit returned false, exiting...

reminder videomass.conf is set to Disable all for youtube-dl & yt-dlp

#-------------------------- 8- Downloader preferences -------------------------#

# Downloader preferences sets the downloader behavior during application
# startup. It needs one of the following fields:

#       `Disable all`,` youtube_dl`, `yt_dlp` or `false`

# Where `Disable all` means not load anything, `youtube_dl` means load/use
# youtube-dl on sturtup, `yt_dlp` means load/use yt_dl on sturtup, `false`
# means *not set at all* and the wizard dialog will be displayed.
Disable all

system info:

ubuntu 18.04 heavily modified package base... unfortunately

python3-videomass_3.5.3-1_all

apt list python3 python3/bionic-updates,now 3.6.7-1~18.04 amd64 [installed]

apt list python3-wxgtk4.0 python3-wxgtk4.0/bionic,now 4.0.1+dfsg-2 amd64 [installed,automatic]

apt list python3-pubsub python3-pubsub/now 4.0.3-4 all [installed,local] ^ installed from focal.

apt list python3-requests python3-requests/bionic,bionic 2.25.1+dfsg-2~18.04.sav0 all [upgradable from: 2.22.0-2~18.04.sav0]

most likely python3.6.7 and wxgtk4.0 are not supported with your current build?

[Python >= 3.6.9]
[wxPython-Phoenix >= 4.0.3]
[PyPubSub >= 4.0.3]
[requests >= 2.21.0]
jeanslack commented 2 years ago

Hi,

I was certain that the Python version on the updated Ubuntu Bionic was 3.6.9.

However from the tests I had performed, the Python version to make videomass work must be at least v.3.6.9 (better if 3.7.0), since on version 3.6.9 not everything works completely.

Also, the following debug message is not responsible for this error, as it is always shown to me .

Debug: Adding duplicate image handler for 'Windows bitmap file'

arrowgent commented 2 years ago

yes i was checking python3 --version Python 3.6.9

not sure why my apt list shows 3.6.7

i also tried sudo update-alternatives --config python3 changing to 3.7, 3.8, and 3.9

those also did not work im using the appimage, let me know if there is something else i can test for you?

apt list python3-distutils python3-distutils/bionic-updates,bionic-updates,now 3.6.9-1~18.04 all [installed,automatic]

i have to use 3.6 for the overall OS, several software i use requires it and fails with 3.7,3.8,3.9

jeanslack commented 2 years ago

The AttributeError: module 'wx' line has no attribute 'NewIdRef' explains everything: the wxPython v.4.0.3 is no longer supported by Videomass.

I will have to specify in the minimum requirements that the version of Python3 must be at least 3.7.0 and that the version of the wx must be at least 4.0.7.

I'm sorry I made these errors of assessment, I will make the necessary corrections on the documentation.

The last thing you could try is to remove python3-wxgtk4.0 and try to install the latest release of wxPython using pip as user not with sudo, like this:

then start Videomass.

Thanks!

jeanslack commented 2 years ago

After some tests: replaced the reference to the identifier wx.NewIdRef() (which causes the error you reported) with wx.ID_ANY and it seems to also work on Bionic with Python 3.6.9 and wxPython 4.0.3. No apparent conflicts on other versions of wxPython.

arrowgent commented 2 years ago

its only a year left of Bionic support (not including extended 10 year support) so most CI will remove building in this enviornment anyways. hell, even ubuntu's repos and mirrors will probally remove it.

further, python 3.6 is deprecated. you should be moving forward with python 3.7

so i did what you modified: replace NewIdRef() with ID_ANY

https://github.com/jeanslack/Videomass/pull/52/commits/db50003ae500bcce829b68b832bf271b6096c8d6#diff-247e11c32a15ec9f967d2740e03985e2bbf74e080226d197f58077bd5f8eef17

https://github.com/jeanslack/Videomass/pull/52/commits/db50003ae500bcce829b68b832bf271b6096c8d6#diff-b791922bed4ae81ef419a1c1b963b6013f394041bd0298e2f968b9319f1d9cda

https://github.com/jeanslack/Videomass/pull/52/commits/db50003ae500bcce829b68b832bf271b6096c8d6#diff-30bd369a7fdd02f7f1da237373afdfbfb530fbed8997c5d2c51ab482c76e105d

seems to work.

closing i will say what interested me in this software was a super easy GUI for cropping the area of a video compared to cli ffmpeg to input - output with WxH crops.

jeanslack commented 2 years ago

its only a year left of Bionic support (not including extended 10 year support) so most CI will remove building in this enviornment anyways. hell, even ubuntu's repos and mirrors will probally remove it.

Yes I know, also the Videomass.AppImage building is based on Bionic until the end of its support.

further, python 3.6 is deprecated. you should be moving forward with python 3.7

Yes I will