簡體   English   中英

ImportError:DLL加載失敗-嘗試導入spynner時

[英]ImportError: DLL load failed - when trying to import spynner

當我運行導入spynner的代碼時,出現以下錯誤:

> python .\spynner-test.py
Traceback (most recent call last):
  File ".\spynner-test.py", line 10, in <module>
    import spynner
  File "C:\Anaconda\lib\site-packages\spynner\__init__.py", line 2, in <module>
    from browser import *
  File "C:\Anaconda\lib\site-packages\spynner\browser.py", line 56, in <module>
    from PyQt4.QtNetwork import QNetworkCookie, QNetworkAccessManager, QSslConfiguration, QSslCipher
ImportError: DLL load failed: The specified procedure could not be found.

有趣的是,我可以將這些東西導入普通的python shell中而沒有任何問題:

> python
Python 2.7.5 |Anaconda 1.9.2 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtNetwork import QNetworkCookie, QNetworkAccessManager, QSslConfiguration, QSslCipher
>>>

但是在import spynner失敗后,

> python
Python 2.7.5 |Anaconda 1.9.2 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import spynner
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda\lib\site-packages\spynner\__init__.py", line 2, in <module>
    from browser import *
  File "C:\Anaconda\lib\site-packages\spynner\browser.py", line 56, in <module>
    from PyQt4.QtNetwork import QNetworkCookie, QNetworkAccessManager, QSslConfiguration, QSslCipher
ImportError: DLL load failed: The specified procedure could not be found.
>>> from PyQt4.QtNetwork import QNetworkCookie, QNetworkAccessManager, QSslConfiguration, QSslCipher
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified procedure could not be found.
>>>

好吧,我知道了。 問題是spynner首先嘗試導入PySide ,並且在從PyQt4.QtNetwork導入QSslConfiguration時遇到錯誤。 然后切換到PyQt4 ,顯然先前導入的PySide使PyQt4導入失敗。 當我刪除browser.py中的try:部分時,我可以導入spynner fine。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM