Error installing PyQt5 library: unresolved reference
I'm trying to create a browser using Python and the library PyQt5
I installed correctly the library but i don't know why components can't be found.
Is there a reason why the components can't be found? Thank you in advance
This is my code
import PyQt5
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtNetwork import *
import sys
from optparse import OptionParser
class MyBrowser(QWebPage):
''' Settings for the browser.'''
def userAgentForUrl(self, url):
''' Returns a User Agent that will be seen by the website. '''
return "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
class Browser(QWebView):
def __init__(self):
# QWebView
self.view = QWebView.__init__(self)
# self.view.setPage(MyBrowser())
self.setWindowTitle('Loading...')
self.titleChanged.connect(self.adjustTitle)
# super(Browser).connect(self.ui.webView,QtCore.SIGNAL("titleChanged
(const QString&)"), self.adjustTitle)
def load(self, url):
self.setUrl(QUrl(url))
def adjustTitle(self):
self.setWindowTitle(self.title())
def disableJS(self):
settings = QWebSettings.globalSettings()
settings.setAttribute(QWebSettings.JavascriptEnabled, False)
app = QApplication(sys.argv)
view = Browser()
view.showMaximized()
view.load("https://pythonspot.com")
app.exec_()
This is where i get the error "Unresolved reference"

python pycharm pyqt5
add a comment |
I'm trying to create a browser using Python and the library PyQt5
I installed correctly the library but i don't know why components can't be found.
Is there a reason why the components can't be found? Thank you in advance
This is my code
import PyQt5
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtNetwork import *
import sys
from optparse import OptionParser
class MyBrowser(QWebPage):
''' Settings for the browser.'''
def userAgentForUrl(self, url):
''' Returns a User Agent that will be seen by the website. '''
return "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
class Browser(QWebView):
def __init__(self):
# QWebView
self.view = QWebView.__init__(self)
# self.view.setPage(MyBrowser())
self.setWindowTitle('Loading...')
self.titleChanged.connect(self.adjustTitle)
# super(Browser).connect(self.ui.webView,QtCore.SIGNAL("titleChanged
(const QString&)"), self.adjustTitle)
def load(self, url):
self.setUrl(QUrl(url))
def adjustTitle(self):
self.setWindowTitle(self.title())
def disableJS(self):
settings = QWebSettings.globalSettings()
settings.setAttribute(QWebSettings.JavascriptEnabled, False)
app = QApplication(sys.argv)
view = Browser()
view.showMaximized()
view.load("https://pythonspot.com")
app.exec_()
This is where i get the error "Unresolved reference"

python pycharm pyqt5
How have you installed PyQt5 correctly?
– eyllanesc
Feb 18 '18 at 18:08
add a comment |
I'm trying to create a browser using Python and the library PyQt5
I installed correctly the library but i don't know why components can't be found.
Is there a reason why the components can't be found? Thank you in advance
This is my code
import PyQt5
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtNetwork import *
import sys
from optparse import OptionParser
class MyBrowser(QWebPage):
''' Settings for the browser.'''
def userAgentForUrl(self, url):
''' Returns a User Agent that will be seen by the website. '''
return "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
class Browser(QWebView):
def __init__(self):
# QWebView
self.view = QWebView.__init__(self)
# self.view.setPage(MyBrowser())
self.setWindowTitle('Loading...')
self.titleChanged.connect(self.adjustTitle)
# super(Browser).connect(self.ui.webView,QtCore.SIGNAL("titleChanged
(const QString&)"), self.adjustTitle)
def load(self, url):
self.setUrl(QUrl(url))
def adjustTitle(self):
self.setWindowTitle(self.title())
def disableJS(self):
settings = QWebSettings.globalSettings()
settings.setAttribute(QWebSettings.JavascriptEnabled, False)
app = QApplication(sys.argv)
view = Browser()
view.showMaximized()
view.load("https://pythonspot.com")
app.exec_()
This is where i get the error "Unresolved reference"

python pycharm pyqt5
I'm trying to create a browser using Python and the library PyQt5
I installed correctly the library but i don't know why components can't be found.
Is there a reason why the components can't be found? Thank you in advance
This is my code
import PyQt5
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWebKitWidgets import QWebView, QWebPage
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtNetwork import *
import sys
from optparse import OptionParser
class MyBrowser(QWebPage):
''' Settings for the browser.'''
def userAgentForUrl(self, url):
''' Returns a User Agent that will be seen by the website. '''
return "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
class Browser(QWebView):
def __init__(self):
# QWebView
self.view = QWebView.__init__(self)
# self.view.setPage(MyBrowser())
self.setWindowTitle('Loading...')
self.titleChanged.connect(self.adjustTitle)
# super(Browser).connect(self.ui.webView,QtCore.SIGNAL("titleChanged
(const QString&)"), self.adjustTitle)
def load(self, url):
self.setUrl(QUrl(url))
def adjustTitle(self):
self.setWindowTitle(self.title())
def disableJS(self):
settings = QWebSettings.globalSettings()
settings.setAttribute(QWebSettings.JavascriptEnabled, False)
app = QApplication(sys.argv)
view = Browser()
view.showMaximized()
view.load("https://pythonspot.com")
app.exec_()
This is where i get the error "Unresolved reference"

python pycharm pyqt5
python pycharm pyqt5
asked Feb 18 '18 at 17:52
Filippo MomentèFilippo Momentè
528
528
How have you installed PyQt5 correctly?
– eyllanesc
Feb 18 '18 at 18:08
add a comment |
How have you installed PyQt5 correctly?
– eyllanesc
Feb 18 '18 at 18:08
How have you installed PyQt5 correctly?
– eyllanesc
Feb 18 '18 at 18:08
How have you installed PyQt5 correctly?
– eyllanesc
Feb 18 '18 at 18:08
add a comment |
1 Answer
1
active
oldest
votes
First, try to uninstall it from cmd:
pip uninstall pyqt5
then install it again:
pip install pyqt5
if it still not working try this method:
1) Install the binary file Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from here.
2) Get sip-4.14.7 (development snapshot) from here.
3) Extract the file and open the Developer Command Prompt for VS2012.
4) Execute these commands (in sip folder):
python configure.py
nmake
nmake install
5) Get the pyQt5 from here.
6) Extract the file and open the VS2012 x64 Native Tools Command Prompt.
7) Execute these commands:
python configure.py
I try it before and work for me
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48854809%2ferror-installing-pyqt5-library-unresolved-reference%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
First, try to uninstall it from cmd:
pip uninstall pyqt5
then install it again:
pip install pyqt5
if it still not working try this method:
1) Install the binary file Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from here.
2) Get sip-4.14.7 (development snapshot) from here.
3) Extract the file and open the Developer Command Prompt for VS2012.
4) Execute these commands (in sip folder):
python configure.py
nmake
nmake install
5) Get the pyQt5 from here.
6) Extract the file and open the VS2012 x64 Native Tools Command Prompt.
7) Execute these commands:
python configure.py
I try it before and work for me
add a comment |
First, try to uninstall it from cmd:
pip uninstall pyqt5
then install it again:
pip install pyqt5
if it still not working try this method:
1) Install the binary file Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from here.
2) Get sip-4.14.7 (development snapshot) from here.
3) Extract the file and open the Developer Command Prompt for VS2012.
4) Execute these commands (in sip folder):
python configure.py
nmake
nmake install
5) Get the pyQt5 from here.
6) Extract the file and open the VS2012 x64 Native Tools Command Prompt.
7) Execute these commands:
python configure.py
I try it before and work for me
add a comment |
First, try to uninstall it from cmd:
pip uninstall pyqt5
then install it again:
pip install pyqt5
if it still not working try this method:
1) Install the binary file Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from here.
2) Get sip-4.14.7 (development snapshot) from here.
3) Extract the file and open the Developer Command Prompt for VS2012.
4) Execute these commands (in sip folder):
python configure.py
nmake
nmake install
5) Get the pyQt5 from here.
6) Extract the file and open the VS2012 x64 Native Tools Command Prompt.
7) Execute these commands:
python configure.py
I try it before and work for me
First, try to uninstall it from cmd:
pip uninstall pyqt5
then install it again:
pip install pyqt5
if it still not working try this method:
1) Install the binary file Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from here.
2) Get sip-4.14.7 (development snapshot) from here.
3) Extract the file and open the Developer Command Prompt for VS2012.
4) Execute these commands (in sip folder):
python configure.py
nmake
nmake install
5) Get the pyQt5 from here.
6) Extract the file and open the VS2012 x64 Native Tools Command Prompt.
7) Execute these commands:
python configure.py
I try it before and work for me
answered Feb 18 '18 at 18:28
Fady AlfredFady Alfred
1289
1289
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48854809%2ferror-installing-pyqt5-library-unresolved-reference%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How have you installed PyQt5 correctly?
– eyllanesc
Feb 18 '18 at 18:08