py安装程序olap xmla urllib2.URLE

2024-06-13 13:00:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我想从python脚本创建一个独立的exe。脚本运行得很好,但是当我执行创建的exe文件时,我得到一个urlopen错误,这很奇怪,因为我没有打开任何文件。 我在Windows上使用了anaconda环境和python2.7。 欢迎提出任何建议

财务报表

import olap.xmla.xmla as xmla

if __name__ == '__main__':
    provider = xmla.XMLAProvider()
    connect = provider.connect(location='https://example_url/',username='username',password='pass')
    source = connect.getOLAPSource()
    print source.getDatasources()

输出fin.exe

No handlers could be found for logger "olap.xmla.requests_kerberosauth"
Traceback (most recent call last):
  File "fin.py", line 7, in <module>
  File "site-packages\olap\xmla\xmla.py", line 27, in connect
  File "site-packages\olap\xmla\xmla.py", line 137, in __init__
  File "site-packages\olap\xmla\connection.py", line 87, in __init__
  File "site-packages\suds\client.py", line 112, in __init__
  File "site-packages\suds\reader.py", line 152, in open
  File "site-packages\suds\wsdl.py", line 136, in __init__
  File "site-packages\suds\reader.py", line 79, in open
  File "site-packages\suds\reader.py", line 95, in download
  File "site-packages\olap\xmla\http.py", line 90, in open
  File "site-packages\olap\xmla\http.py", line 128, in doOpen
  File "urllib2.py", line 429, in open
  File "urllib2.py", line 447, in _open
  File "urllib2.py", line 407, in _call_chain
  File "urllib2.py", line 1336, in file_open
  File "site-packages\olap\xmla\http.py", line 57, in open_local_file
  File "urllib2.py", line 1376, in open_local_file
urllib2.URLError: <urlopen error [Error 3] Das System kann den angegebenen Pfad nicht finden: ''>
[8828] Failed to execute script fin

输出pyinstaller—onefile fin.py

192 INFO: PyInstaller: 3.5
192 INFO: Python: 2.7.16
194 INFO: Platform: Windows-10-10.0.18362
197 INFO: wrote C:\Users\User\Projekte\xmla\fin.spec
201 INFO: UPX is not available.
204 INFO: Extending PYTHONPATH with paths
['C:\\Users\\User\\Projekte\\xmla', 'C:\\Users\\User\\Projekte\\xmla']
205 INFO: checking Analysis
207 INFO: Building Analysis because Analysis-00.toc is non existent
207 INFO: Initializing module dependency graph...
220 INFO: Initializing module graph hooks...
359 INFO: running Analysis Analysis-00.toc
416 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  required by c:\users\User\anaconda3\envs\py22\python.exe
639 INFO: Found C:\WINDOWS\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_accdd623e1ddaffe.manifest
822 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.9619_none ...
823 INFO: Found manifest C:\WINDOWS\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_08e065a3a84109b0.manifest
826 INFO: Searching for file msvcr90.dll
826 INFO: Found file C:\WINDOWS\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_08e065a3a84109b0\msvcr90.dll
827 INFO: Searching for file msvcp90.dll
828 INFO: Found file C:\WINDOWS\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_08e065a3a84109b0\msvcp90.dll
829 INFO: Searching for file msvcm90.dll
830 INFO: Found file C:\WINDOWS\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_08e065a3a84109b0\msvcm90.dll
1004 INFO: Found C:\WINDOWS\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9619_none_accdd623e1ddaffe.manifest
1006 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9619)
1086 INFO: Caching module hooks...
1097 INFO: Analyzing C:\Users\User\Projekte\xmla\fin.py
5343 INFO: Processing pre-safe import module hook   _xmlplus
6955 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
10609 INFO: Processing pre-safe import module hook   six.moves
16034 INFO: Processing pre-find module path hook   distutils
16151 INFO: Loading module hooks...
16152 INFO: Loading module hook "hook-distutils.py"...
16154 INFO: Loading module hook "hook-sysconfig.py"...
16156 INFO: Loading module hook "hook-xml.py"...
16158 INFO: Loading module hook "hook-cryptography.py"...
19494 INFO: Loading module hook "hook-httplib.py"...
19497 INFO: Loading module hook "hook-encodings.py"...
20447 INFO: Loading module hook "hook-pkg_resources.py"...
21072 INFO: Processing pre-safe import module hook   win32com
21901 INFO: Loading module hook "hook-certifi.py"...
21906 INFO: Loading module hook "hook-pywintypes.py"...
22698 INFO: Loading module hook "hook-win32com.py"...
23845 INFO: Loading module hook "hook-pythoncom.py"...
24586 INFO: Looking for ctypes DLLs
24621 INFO: Analyzing run-time hooks ...
24630 INFO: Including run-time hook 'pyi_rth_certifi.py'
24634 INFO: Including run-time hook 'pyi_rth_pkgres.py'
24639 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
24656 INFO: Looking for dynamic libraries
25128 INFO: Searching for assembly amd64_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
25129 INFO: Found manifest c:\users\User\anaconda3\envs\py22\lib\site-packages\Pythonwin\Microsoft.VC90.MFC.manifest
25131 INFO: Searching for file mfc90.dll
25131 INFO: Found file c:\users\User\anaconda3\envs\py22\lib\site-packages\Pythonwin\mfc90.dll
25132 INFO: Searching for file mfc90u.dll
25134 INFO: Found file c:\users\User\anaconda3\envs\py22\lib\site-packages\Pythonwin\mfc90u.dll
25134 INFO: Searching for file mfcm90.dll
25135 INFO: Found file c:\users\User\anaconda3\envs\py22\lib\site-packages\Pythonwin\mfcm90.dll
25136 INFO: Searching for file mfcm90u.dll
25138 INFO: Found file c:\users\User\anaconda3\envs\py22\lib\site-packages\Pythonwin\mfcm90u.dll
25332 INFO: Adding redirect Microsoft.VC90.MFC version (9, 0, 21022, 8) -> (9, 0, 21022, 8)
25857 INFO: Looking for eggs
25858 INFO: Using Python library c:\users\User\anaconda3\envs\py22\python27.dll
25860 INFO: Found binding redirects:
[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'amd64', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 9619), publicKeyToken=u'1fc8b3b9a1e18e3b'), BindingRedirect(name=u'Microsoft.VC90.MFC', language=None, arch=u'amd64', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 21022, 8), publicKeyToken=u'1fc8b3b9a1e18e3b')]
25878 INFO: Warnings written to C:\Users\User\Projekte\xmla\build\fin\warn-fin.txt
26021 INFO: Graph cross-reference written to C:\Users\User\Projekte\xmla\build\fin\xref-fin.html
26203 INFO: checking PYZ
26204 INFO: Building PYZ because PYZ-00.toc is non existent
26205 INFO: Building PYZ (ZlibArchive) C:\Users\User\Projekte\xmla\build\fin\PYZ-00.pyz
27684 INFO: Building PYZ (ZlibArchive) C:\Users\User\Projekte\xmla\build\fin\PYZ-00.pyz completed successfully.
27922 INFO: checking PKG
27924 INFO: Building PKG because PKG-00.toc is non existent
27925 INFO: Building PKG (CArchive) PKG-00.pkg
28050 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 9619)
32286 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
32327 INFO: Bootloader c:\users\User\anaconda3\envs\py22\lib\site-packages\PyInstaller\bootloader\Windows-64bit\run.exe
32328 INFO: checking EXE
32329 INFO: Building EXE because EXE-00.toc is non existent
32330 INFO: Building EXE from EXE-00.toc
32334 INFO: Appending archive to EXE C:\Users\User\Projekte\xmla\dist\fin.exe
32365 INFO: Building EXE from EXE-00.toc completed successfully.

Tags: inpyinfoforpackageslinesitehook