strohne / Facepager

Facepager was made for fetching public available data from YouTube, Twitter and other websites on the basis of APIs and webscraping.
https://github.com/strohne/Facepager/releases
506 stars 198 forks source link

Cannot install Facepager, "ImportError: No module named QtWebKit" (Ubuntu 16.04) #99

Closed emanuelaf closed 5 years ago

emanuelaf commented 5 years ago

Hi and thanks for your work on Facepager. I am following the steps in src/readme.txt to run Facepager under linux. However, I get a number of errors, one of which does not allow me to continue with the instructions.

The first one occurs here:

$ sudo apt-get install build-essential git cmake libqt4-dev libphonon-dev python2.7-dev libxml2-dev libxslt1-dev qtmobility-dev python-virtualenv [sudo] password for emanuela: Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package qtmobility-dev

I continue although it seems I do not have qtmobility-dev. All the steps go smoothly. My extract does not seem to work, but I get around it by manually extracting PySide-1.2.2.tar.gz. I continue on and I find a typo:

../pacepager_env/bin/pip2.7 install dist/PySide-1.2.2-cp27-none-linux_x86_64.whl

I guess it was meant to be facepager_env.

Then comes the main issue. When I run:

python Facepager.py

I get the following error:

$ python Facepager.py Traceback (most recent call last): File "Facepager.py", line 30, in from PySide.QtCore import * ImportError: No module named PySide.QtCore

I try to get around it with:

sudo apt-get install python3-pyside

Then I try again:

$ python Facepager.py Traceback (most recent call last): File "Facepager.py", line 36, in from actions import File "/home/emanuela/io/progetto_tango/Facepager/src/actions.py", line 5, in from apimodules import File "/home/emanuela/io/progetto_tango/Facepager/src/apimodules.py", line 12, in from PySide.QtWebKit import QWebView, QWebPage ImportError: No module named QtWebKit

I also tried to install libqtf-webkit from the package manager, but I get the following error:

$ sudo apt-get install libqt4-webkit Reading package lists... Done Building dependency tree
Reading state information... Done Package libqt4-webkit is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libqtwebkit4 libqtwebkit4:i386

E: Package 'libqt4-webkit' has no installation candidate

and when I install libqtwebkit4 or libqtwebkit4:i386, it turns out I already have them and the problem persists. I also tried using a more recent version of PySide, that is PySide-1.2.4, but I still get the same errors. Do you have any idea of what else I could do?

Thanks.

strohne commented 5 years ago

First of all: thanks for trying so hard. I didn't use Facepager under Linux for years. If it works out, maybe I could create a build.

The problem is PySide, I had the very same issues with the Mac version, there is a working description in the readme.txt. We need PySide 1 with Qt4 because of WebKit. Most recent working version is PySide v1.22. Newer versions will not work afaik.

Try:

pip install -U PySide==1.2.2

emanuelaf commented 5 years ago

Thank you, but unfortunately I had already tried that and it doesn't work. Just in case I had made a mistake, I uninstalled everything, tried again with your tip but I still get the same error.

Do you have any idea of some linux distribution on which it works?

siscia commented 5 years ago

Hi @strohne

I tried quite hard to run the application in linux, but without success up to now. The problem seems to be that QtWebKit is deprecated and removed from most repository since defined insecure.

I tried to use the PyQt4 version from Riverbank but without success. I would try to build with Ubuntu vivid as was done in the readme, but all the repo are offline. I also tried to follow the instruction for Mac, but it seems like there is some issue in the brew tap and I can't install anything.

Is there any way around it? How much work will it be a CLI instead of a GUI? What to migrate to PyQt5 that will means to switch to Python3?

Are you using it on Windows?

What can we do to bring back this package?

strohne commented 5 years ago

hi, I already startet upgrading to python 3 and pyside 2 + PyQt5. sorry, i am too busy at the moment, but I hope to find some time near the end of the year.

yes, I am on windows.

siscia commented 5 years ago

Hi,

I completely understand, don't worry.

I would like to help but I am not so well versed into graphics stuff...

If something unreleted to graphic is needed please let me know!

Cheers, Simone

strohne commented 5 years ago

Hi emanuelaf and siscia,

I migrated Facepager to Python3 (version 3.7) and PySide2 (version 5.11.1) .

The new version is in the python3 branch and still needs testing. It would be great if you could try it out and report back:

$ pip3 install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml
$ pip3 install PySide2==5.11.1
$ pip3 install numpy pandas

$ git clone -b python3 https://github.com/strohne/Facepager
$ cd Facepager/src
$ python3 Facepager.py 

Happy end of the year!

strohne commented 5 years ago

Complete steps to run under Ubuntu 18.04 using a virtual environment: https://github.com/strohne/Facepager/tree/python3/src

Just replace git clone https://github.com/strohne/Facepager with git clone -b python3 https://github.com/strohne/Facepager as long as the new version is not in the master branch.

emanuelaf commented 5 years ago

Hi strohne,

Thanks for your great work!!! It is working now! However the commands seem to be pip3 and python3, not pip and python.

I now got Facepager running on ubuntu 16.04, I will let you know if I encounter any issues while using it.

Happy start of the year :)

strohne commented 5 years ago

Right, pip3 and python3, I will correct it in my comment. I am still struggling with packaging the app, pyinstaller doesn't like QtWebEngine. Hopefully, I can make a Linux build in the near future.

nubiofs commented 5 years ago

Hi strohne,

Thanks, at first, functional without problem for:

$ uname -a Linux 4.15.0-39-generic #42-Ubuntu SMP UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I just followed (https://github.com/strohne/Facepager/tree/python3/src#steps-to-runder-under-ubuntu-18041-lts):

Open terminal in a directory of your choice and execute the commands indicated by the $ sign.

//Install additional software: $ sudo apt install git $ sudo apt-get install python3-venv

//Clone Facepager $ git clone -b python3 https://github.com/strohne/Facepager $ cd Facepager

//Setup Python environment $ python3 -m venv . $ source bin/activate

$ bin/pip3 install SQLAlchemy python-dateutil requests_oauthlib requests-toolbelt rauth lxml $ bin/pip3 install PySide2==5.11.1 $ bin/pip3 install numpy pandas

//Start Facepager $ cd src $ python3 Facepager.py

strohne commented 5 years ago

Great, thank you for testing. I adjusted pip -> pip3 and python -> python3.

Does one of you know how to package executables with pyinstaller? I would like to provide a binary release for linux. But I couldn't manage to get PySide working yet. Looks like pyinstaller misses to copy some files to the dist folder.

If you feel like you could help please see https://github.com/strohne/Facepager/tree/python3/build#ubuntu-18041-lts

siscia commented 5 years ago

I would love to help but unfortunately I have never done it.

However, maybe a simple docker image would be sufficient, especially for Linux users.

Cheers!

strohne commented 5 years ago

Merged the python3 branch into master and deleted it. I will try to build later and close the issue for now.

(In the meantime I developed a feature to use OpenAPI (formerly Swagger) files to populate the modules. Unfortunately, I had to remove the old documentation, so there are no suggestions for Twitter and only limited suggestions for Facebook in the master version. But the new feature will be great some day.)