Error installing PyQt5 library: unresolved reference












1















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"
This










share|improve this question























  • How have you installed PyQt5 correctly?

    – eyllanesc
    Feb 18 '18 at 18:08
















1















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"
This










share|improve this question























  • How have you installed PyQt5 correctly?

    – eyllanesc
    Feb 18 '18 at 18:08














1












1








1








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"
This










share|improve this question














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"
This







python pycharm pyqt5






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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



















  • 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












1 Answer
1






active

oldest

votes


















0














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






share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    0














    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






    share|improve this answer




























      0














      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






      share|improve this answer


























        0












        0








        0







        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






        share|improve this answer













        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 18 '18 at 18:28









        Fady AlfredFady Alfred

        1289




        1289
































            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            How to pass form data using jquery Ajax to insert data in database?

            National Museum of Racing and Hall of Fame

            Guess what letter conforming each word