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

ubuntu compilation error #135

Closed
legluondunet opened this issue Feb 2, 2018 · 11 comments
Closed

ubuntu compilation error #135

legluondunet opened this issue Feb 2, 2018 · 11 comments

Comments

@legluondunet
Copy link

Hello,
when i launch vidcutter compilation, it says it can not find -lmpv
Thank you for your help.

$ python3 setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videotoolbar.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videolist.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videosliderwidget.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/main.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videoinfo.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videocutter.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/init.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/updater.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/resources.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/graphicseffects.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/about.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videoslider.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/settings.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videostyle.py -> build/lib.linux-x86_64-3.6/vidcutter
copying vidcutter/videoconsole.py -> build/lib.linux-x86_64-3.6/vidcutter
creating build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/videoconfig.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/mpvwidget.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/taskbarprogress.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/init.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/munch.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/videoservice.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/widgets.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/notifications.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
copying vidcutter/libs/singleapplication.py -> build/lib.linux-x86_64-3.6/vidcutter/libs
running build_ext
building 'vidcutter.libs.mpv' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/vidcutter
creating build/temp.linux-x86_64-3.6/vidcutter/libs
creating build/temp.linux-x86_64-3.6/vidcutter/libs/pympv
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ividcutter/libs/pympv/mpv -I/usr/include/python3.6m -c vidcutter/libs/pympv/mpv.c -o build/temp.linux-x86_64-3.6/vidcutter/libs/pympv/mpv.o -g0
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/vidcutter/libs/pympv/mpv.o -lmpv -o build/lib.linux-x86_64-3.6/vidcutter/libs/mpv.cpython-36m-x86_64-linux-gnu.so
/usr/bin/x86_64-linux-gnu-ld.bfd.real : can not find -lmpv
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

OS: Ubuntu 17.10

@Rockus2018
Copy link

Hello,

did you install libmpv properly ?

Please try

sudo apt install libmpv-dev

Check with

locate libmpv.so

Regards

@legluondunet
Copy link
Author

I installed libmpv-dev and now vidcutter compiled without error.
But now how I can launch it?
I tried this:

$ python3 setup.py build
$ cd build/lib.linux-x86_64-3.6/vidcutter
$ python3 videocutter.py
Traceback (most recent call last):
File "videocutter.py", line 42, in
from vidcutter.about import About
ModuleNotFoundError: No module named 'vidcutter.about'

@Rockus2018
Copy link

Rockus2018 commented Mar 11, 2018

Do the spell

python3 setup.py install


However, vidcutter depends on several packages:

apt install libmpv*
apt install mediainfo
apt install libav-tools

(It's a much better choice to install 'ffmpeg' directly instead of 'libav-tools')

To finally run vidcutter some more online magic is needed:

apt install python3-pip
pip3 install -U pip
pip3 install -U pyqt5
pip3 install -U pyopengl

Maybe an

apt install fonts-noto*

is useful too ...


And now you can simply type

vidcutter

on the command line ...

(three error lines are common :0)

@legluondunet
Copy link
Author

legluondunet commented Mar 11, 2018

1°)

$ sudo apt-get install libmpv*
$ sudo apt-get install mediainfo
$ sudo apt-get install libav-tools

I just verified, all this packages are already installed on my Ubuntu

2°)

Do the spell
$ python3 setup.py install

I don't want to install it, I just want to launch it directly after compilation, like I aIways did when I compile program myself, is it possible with vidcutter?

@legluondunet
Copy link
Author

legluondunet commented Mar 11, 2018

On Linux Debian/Ubuntu, you don't need to do this:

To finally run vidcutter some more online magic is needed:

apt install python3-pip
pip3 install -U pip
pip3 install -U pyqt5
pip3 install -U pyopengl

Instead install this package from official Debian/Ubuntu depot:
$ sudo apt-get install python3-pyqt5.qtopengl

I just installed it and now my setup test give me no more error:

$ python3 setup.py test
running test
running egg_info
writing vidcutter.egg-info/PKG-INFO
writing dependency_links to vidcutter.egg-info/dependency_links.txt
writing entry points to vidcutter.egg-info/entry_points.txt
writing top-level names to vidcutter.egg-info/top_level.txt
reading manifest file 'vidcutter.egg-info/SOURCES.txt'
writing manifest file 'vidcutter.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-x86_64-3.6/vidcutter/libs/mpv.cpython-36m-x86_64-linux-gnu.so -> vidcutter/libs

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

But I still can not launch directly vidcutter from his compilation folder.

@Rockus2018
Copy link

Rockus2018 commented Mar 12, 2018

Well, you prefer a lean system.

Good luck with the outdated library, vidcutter seems to be sensitive at this point ...

I'm running Mint 18.3 i.e. Ubuntu Xenial Xerus and got PyQt5 v5.5.1 from standard repository, which version is literally too old to run smoothly. You got v5.7, but PyPi installed v5.10.1 through pip ...

Did my very best, but every time I run vidcutter I'm getting two error lines on stderr

Exception ignored in: 'mpv._c_getprocaddress'
TypeError: an integer is required

or via vidcutter --debug

2018-02-10 21:11 - root - CRITICAL - <class 'mpv.MPVError'>: not supported
2018-02-10 21:29 - root - CRITICAL - <class 'TypeError'>: an integer is required

Could it be, that @ozmartian grounded the error handler by intention ?

BTW, @ozmartian listed the dependencies for Ubuntu in the module helpers.py "for a noticeably better integrated experience":

python3-dev libmpv1 libmpv-dev python3-pyqt5
python3-pyqt5.qtopengl python3-pyqt5.qtx11extras
ffmpeg mediainfo python3-opengl

Look at vidcutter/libs/mpvwidget.py line 30 pp. - you will need the wrapper python3-opengl too.

The installed launch code script is

#!/usr/local/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'vidcutter==5.5.0','gui_scripts','vidcutter'
__requires__ = 'vidcutter==5.5.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('vidcutter==5.5.0', 'gui_scripts', 'vidcutter')()
    )

@Rockus2018
Copy link

Rockus2018 commented Mar 12, 2018

Hopefully did a

git clone -q --depth=1 --branch=master https://github.com/ozmartian/vidcutter.git vidcutter

for the newest fixes ... nope, had to edit mpvwidget.py manually again ...

cd vidcutter
sudo python3 setup.py install

Now I could run vidcutter from command line or with a crippled code too

rockus@Lychee ~ $ python3
Python 3.6.4 (default, Feb 19 2018, 04:35:39) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pkg_resources import load_entry_point
>>> load_entry_point('vidcutter==5.5.0', 'gui_scripts', 'vidcutter')()
QApplication: invalid style override passed, ignoring it.
Exception ignored in: 'mpv._c_getprocaddress'
TypeError: an integer is required

Surprise, a

vidcutter --debug

delivered

... - root - CRITICAL -
... - root - CRITICAL - <class 'mpv.MPVError'>: not supported
... - root - CRITICAL - <class 'TypeError'>: an integer is required

earlier, and now

... - root - CRITICAL -
... - root - CRITICAL - <class 'TypeError'>: an integer is required

@Rockus2018
Copy link

Rockus2018 commented May 18, 2018

Giving v5.5.5 a try - I had to say good-bye to libmpv v0.14 because no vidcutter GUI came up ...

However, after compiling against libmpv v0.22 the above error messages are gone.

OS is Linux Mint 18.3 Cinnamon 64 bit - therefore I had to edit mpvwidget.py for the use of pyopengl before.

@ozmartian
Copy link
Owner

the fonts used by the app are included within the Qt based resource file (i.e. vidcutter/resources.py) which get loaded on app start... the only case where physical, on disk font files are required is the mpv library when rendering text as part of the on-screen-display text messages... having fonts in resource files makes things a hell of a lot easier ensuring things all run as planned across all platforms and packaging formats and in the case of the OSD text the code will first test to see if Noto Sans is already available in your desktop and revert to using DejaVu Sans if not (dejavu sans has become a standard font preinstalled on most distros now)...

wouldn't you be better off using the flatpak or snap or even AppImage... the flatpak from flathuib is being actively maintained, latesty ffmpeg and mpv libraries along with latest codecs and app codebase so no headaches, its just works :)

@Rockus2018
Copy link

Wow, he is real :)

I'm so sorry, nothing above will 'just work' under Linux Mint, because I remember
the line 34 in vidcutter-5.5.0/vidcutter/libs/mpvwidget.py has to be changed from

if distro.id().lower() in {'ubuntu', 'fedora'}:

to

if distro.id().lower() in {'ubuntu', 'fedora', 'linuxmint'}:

before ... and please add 'debian' too, if I guess right.

Well, in branch 6.0.0 you finally gave up. But 6.0.0 is not master branch yet ...

BTW, please look at #168 - I'm not the only one able to get rid of his system fonts : )

I don't like the [flatpak snap docker] solutions - wanna keep minimum control of my machine.

Nevertheless, many thanks for learning so much about all kinds of installing software with your tool.

@legluondunet
Copy link
Author

legluondunet commented Jun 10, 2018

This issue was firstly about the compilation on Ubuntu.
I just compiled the last Vidcutter git source with success on Ubuntu 18.04.
So I can close this issue.
Thank you for your help.

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

3 participants