简体   繁体   中英

Installing Python Qt4 on bluemix

I am trying to run a webscraping application using bluemix and python. The webscrape needs to happen on javascript generated elements and so I am using a python script that makes use of the PyQt4 library. The script relies on these imports to work:

import os
from PyQt4.QtGui import *  
from PyQt4.QtCore import *  
from PyQt4.QtWebKit import *
from flask import Flask
import json
import lxml

For the Flask and lxml modules, I am simply adding them to the requirements.txt file in my bluemix python source folder. It is the PyQt4 library that is the troublesome one. It would seem that you cannot install this library using pip which is what i believe the requirements.txt relies on.

The installation instructions for this library are here:

http://pyqt.sourceforge.net/Docs/PyQt4/installation.html

Any suggestions on how to get this library running in my bluemix application?

Why not just use the PyQt installation instructions?

If you need to use requirements.txt you can find a prepackaged python .whl for your environment here . You should be able to either put the url directly into your requirements.txt file, or for offline installation, download the .whl to your system and specify its location instead.

An example requirements.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM