xgi / castero

TUI podcast client for the terminal
MIT License
608 stars 37 forks source link

Installation fails (pympv error) #23

Closed ghost closed 5 years ago

ghost commented 5 years ago

I tried to install it with pip3 install castero and also via git, every time I get the following error:

no@x60:~/castero$ sudo python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg)
running install
running bdist_egg
running egg_info
writing requirements to castero.egg-info/requires.txt
writing castero.egg-info/PKG-INFO
writing top-level names to castero.egg-info/top_level.txt
writing dependency_links to castero.egg-info/dependency_links.txt
writing entry points to castero.egg-info/entry_points.txt
package init file 'castero/perspectives/__init__.py' not found (or not a regular file)
package init file 'castero/players/__init__.py' not found (or not a regular file)
package init file 'castero/menus/__init__.py' not found (or not a regular file)
reading manifest file 'castero.egg-info/SOURCES.txt'
writing manifest file 'castero.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
creating build/bdist.linux-i686/egg
creating build/bdist.linux-i686/egg/castero
creating build/bdist.linux-i686/egg/castero/templates
copying build/lib.linux-i686-2.7/castero/templates/castero.conf -> build/bdist.linux-i686/egg/castero/templates
copying build/lib.linux-i686-2.7/castero/templates/feeds -> build/bdist.linux-i686/egg/castero/templates
copying build/lib.linux-i686-2.7/castero/__main__.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/episode.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/downloadqueue.py -> build/bdist.linux-i686/egg/castero
creating build/bdist.linux-i686/egg/castero/menus
copying build/lib.linux-i686-2.7/castero/menus/episodemenu.py -> build/bdist.linux-i686/egg/castero/menus
copying build/lib.linux-i686-2.7/castero/datafile.py -> build/bdist.linux-i686/egg/castero
creating build/bdist.linux-i686/egg/castero/perspectives
copying build/lib.linux-i686-2.7/castero/perspectives/queuelisting.py -> build/bdist.linux-i686/egg/castero/perspectives
copying build/lib.linux-i686-2.7/castero/perspectives/primary.py -> build/bdist.linux-i686/egg/castero/perspectives
copying build/lib.linux-i686-2.7/castero/__init__.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/config.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/perspective.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/player.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/display.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/feed.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/helpers.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/menu.py -> build/bdist.linux-i686/egg/castero
copying build/lib.linux-i686-2.7/castero/feeds.py -> build/bdist.linux-i686/egg/castero
creating build/bdist.linux-i686/egg/castero/players
copying build/lib.linux-i686-2.7/castero/players/vlcplayer.py -> build/bdist.linux-i686/egg/castero/players
copying build/lib.linux-i686-2.7/castero/players/mpvplayer.py -> build/bdist.linux-i686/egg/castero/players
copying build/lib.linux-i686-2.7/castero/queue.py -> build/bdist.linux-i686/egg/castero
byte-compiling build/bdist.linux-i686/egg/castero/__main__.py to __main__.pyc
byte-compiling build/bdist.linux-i686/egg/castero/episode.py to episode.pyc
  File "build/bdist.linux-i686/egg/castero/episode.py", line 16
    pubdate=None, copyright=None, enclosure=None) -> None:
                                                  ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/downloadqueue.py to downloadqueue.pyc
  File "build/bdist.linux-i686/egg/castero/downloadqueue.py", line 12
    def __init__(self, display=None) -> None:
                                     ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/menus/episodemenu.py to episodemenu.pyc
  File "build/bdist.linux-i686/egg/castero/menus/episodemenu.py", line 4
    def __init__ (self, window, feeds, child = None, active = False) -> None:
                                                                     ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/datafile.py to datafile.pyc
  File "build/bdist.linux-i686/egg/castero/datafile.py", line 28
    def __init__(self, path, default_path) -> None:
                                           ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/perspectives/queuelisting.py to queuelisting.pyc
  File "build/bdist.linux-i686/egg/castero/perspectives/queuelisting.py", line 18
    def __init__(self, display) -> None:
                                ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/perspectives/primary.py to primary.pyc
  File "build/bdist.linux-i686/egg/castero/perspectives/primary.py", line 19
    def __init__(self, display) -> None:
                                ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-i686/egg/castero/config.py to config.pyc
  File "build/bdist.linux-i686/egg/castero/config.py", line 34
    def __init__(self) -> None:
                       ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/perspective.py to perspective.pyc
  File "build/bdist.linux-i686/egg/castero/perspective.py", line 44
    def create_windows(self) -> None:
                             ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/player.py to player.pyc
  File "build/bdist.linux-i686/egg/castero/player.py", line 29
    def __init__(self, title, path, episode) -> None:
                                             ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/display.py to display.pyc
  File "build/bdist.linux-i686/egg/castero/display.py", line 63
    def __init__(self, stdscr, feeds) -> None:
                                      ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/feed.py to feed.pyc
  File "build/bdist.linux-i686/egg/castero/feed.py", line 45
    def __init__(self, url=None, file=None, **kwargs) -> None:
                                                      ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/helpers.py to helpers.pyc
  File "build/bdist.linux-i686/egg/castero/helpers.py", line 4
    def third(n) -> int:
                 ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/menu.py to menu.pyc
  File "build/bdist.linux-i686/egg/castero/menu.py", line 15
    def __init__(self, window, items, child=None, active=False) -> None:
                                                                ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/feeds.py to feeds.pyc
  File "build/bdist.linux-i686/egg/castero/feeds.py", line 28
    def __init__(self) -> None:
                       ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/players/vlcplayer.py to vlcplayer.pyc
  File "build/bdist.linux-i686/egg/castero/players/vlcplayer.py", line 13
    def __init__(self, title, path, episode) -> None:
                                             ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/players/mpvplayer.py to mpvplayer.pyc
  File "build/bdist.linux-i686/egg/castero/players/mpvplayer.py", line 12
    def __init__(self, title, path, episode) -> None:
                                             ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-i686/egg/castero/queue.py to queue.pyc
  File "build/bdist.linux-i686/egg/castero/queue.py", line 12
    def __init__(self) -> None:
                       ^
SyntaxError: invalid syntax

creating build/bdist.linux-i686/egg/EGG-INFO
copying castero.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO
copying castero.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying castero.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying castero.egg-info/entry_points.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying castero.egg-info/requires.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying castero.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/castero-0.4.0-py2.7.egg' and adding 'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
Processing castero-0.4.0-py2.7.egg
Removing /usr/local/lib/python2.7/dist-packages/castero-0.4.0-py2.7.egg
Copying castero-0.4.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages
castero 0.4.0 is already the active version in easy-install.pth
Installing castero script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/castero-0.4.0-py2.7.egg
Processing dependencies for castero==0.4.0
Searching for pympv
Reading https://pypi.python.org/simple/pympv/
Downloading https://files.pythonhosted.org/packages/be/6f/ba227d7626ca3611aa350d577f01940002e079d4ca9cad976a9313b0aa7e/pympv-0.6.0.tar.gz#sha256=e364ecc21bc9d438d2902d989767a2d00d70958466154dd9c6a1e395f0ea67b0
Best match: pympv 0.6.0
Processing pympv-0.6.0.tar.gz
Writing /tmp/easy_install-Cvsk0W/pympv-0.6.0/setup.cfg
Running pympv-0.6.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Cvsk0W/pympv-0.6.0/egg-dist-tmp-iZUOhx
mpv.c:585:24: fatal error: mpv/render.h: No such file or directory
 #include "mpv/render.h"
                        ^
compilation terminated.
error: Setup script exited with error: command 'i686-linux-gnu-gcc' failed with exit status 1

Trying to install pympv leads to:

no@x60:~$ sudo pip3 install pympv
Collecting pympv
  Using cached https://files.pythonhosted.org/packages/be/6f/ba227d7626ca3611aa350d577f01940002e079d4ca9cad976a9313b0aa7e/pympv-0.6.0.tar.gz
Building wheels for collected packages: pympv
  Running setup.py bdist_wheel for pympv ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4b2j4biu/pympv/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpvjjns0d2pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_ext
  building 'mpv' extension
  creating build
  creating build/temp.linux-i686-3.5
  i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-F5oRAB/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c mpv.c -o build/temp.linux-i686-3.5/mpv.o
  mpv.c:585:24: fatal error: mpv/render.h: No such file or directory
   #include "mpv/render.h"
                          ^
  compilation terminated.
  error: command 'i686-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pympv
  Running setup.py clean for pympv
Failed to build pympv
Installing collected packages: pympv
  Running setup.py install for pympv ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4b2j4biu/pympv/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qs5ca33e-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'mpv' extension
    creating build
    creating build/temp.linux-i686-3.5
    i686-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-F5oRAB/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c mpv.c -o build/temp.linux-i686-3.5/mpv.o
    mpv.c:585:24: fatal error: mpv/render.h: No such file or directory
     #include "mpv/render.h"
                            ^
    compilation terminated.
    error: command 'i686-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4b2j4biu/pympv/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qs5ca33e-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-4b2j4biu/pympv/

Any suggestions?

xgi commented 5 years ago

For the setup.py installation, it looks like it's trying to use Python2.7, which isn't supported. You should be able to run it as python3 setup.py install and it will probably get to the same place as below.

For the second error, you probably need to install libmpv; some package managers bundle libmpv and mpv together, some don't.

Let me know if that fixes the issue, but regardless I'll leave this open for now since I should update the install to check whether you have libmpv installed before crashing like this (it currently checks that you have the mpv binary, but not the source files).

ghost commented 5 years ago

I tried installing it with python3, which gives me "ImportError: No module named 'setuptools'" (even though python3-setuptools is installed). libmpv-dev is also installed.

xgi commented 5 years ago

I'm not sure about the setuptools error, but it doesn't seem to be related to castero. Maybe check this thread: https://stackoverflow.com/questions/14426491/python-3-importerror-no-module-named-setuptools

I also did some testing and I was able to reproduce the pympv error with an older version of libmpv (0.14.0). I no longer experienced it with 0.29.0 from the Ubuntu cosmic repo. I'll try to narrow down the minimum version required and add it to the readme.

ghost commented 5 years ago

Thanks for the hints. I reinstalled setuptools for python3, but this did not solve the problem (same error message). I also upgraded mpv to 0.29.0, but this the mpv error also persists. FWIW, I am running devuan ascii.

xgi commented 5 years ago

Do you mind testing with the latest build (using the "manual installation" instructions)? There are some kinks to work out, but it replaces pympv with python-mpv, which may resolve your problem.

ghost commented 5 years ago

Doing so lets me install the program, but when I try to open it I get this:

Traceback (most recent call last):
  File "/usr/local/bin/castero", line 11, in <module>
    load_entry_point('castero==0.4.0', 'console_scripts', 'castero')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-i686/egg/castero/__main__.py", line 6, in <module>
  File "/usr/local/lib/python2.7/dist-packages/castero-0.4.0-py2.7.egg/castero/helpers.py", line 4
    def third(n) -> int:
                 ^
SyntaxError: invalid syntax
xgi commented 5 years ago

That seems like an issue with using Python2 again, so you may need to change your system 'python' command to refer to Python3.

ghost commented 5 years ago

When I try to install it with python3, I get the aforementioned setuptools error again. (I read the thread you linked to, but none of the suggested solutions there worked. I already reinstalled setuptools for python3 with pip).

neelabalan commented 5 years ago

I having the same error. Tried all the above mentioned steps.

node64 commented 5 years ago

When I try to install it with python3, I get the aforementioned setuptools error again. (I read the thread you linked to, but none of the suggested solutions there worked. I already reinstalled setuptools for python3 with pip).

I had a similar problem with the installation of pympv and solve it by installing python3-dev (in my distro the name of the packet is python3-devel)

xgi commented 5 years ago

Closing this since I was never able to reproduce it and I don't believe it's related to castero. If anyone involved thinks it is, feel free to let me know.