it is likely that pythonnet .NET DLL (*Python.Runtime.dll*) is not pip-installed or PyInstaller-bundled correctly.
1. Can you run your "import clr" script from python interpreter? 2. Can you check if it is in dist or any subfolders? 3. Provide how you installed pythonnet and which version? On Tuesday, January 26, 2016 at 3:06:12 AM UTC-6, Igor Futritski wrote: > > Hello, > > It looks like pyinstaller and pythonnet are not "friends". > > My test program (file clr_min_test.py) is 2 lines only: > > *import clr* > *print 'ok'* > > See messages below, where I build and then execute it. > > *Microsoft Windows [Version 6.1.7601]* > *Copyright (c) 2009 Microsoft Corporation. All rights reserved.* > > *C:\Projects\clr_test>dir* > * Volume in drive C has no label.* > * Volume Serial Number is EAEE-BF09* > > * Directory of C:\Projects\clr_test* > > *01/25/2016 11:22 AM <DIR> .* > *01/25/2016 11:22 AM <DIR> ..* > *01/23/2016 01:36 PM 26 clr_min_test.py* > * 1 File(s) 26 bytes* > * 2 Dir(s) 12,898,578,432 bytes free* > > *C:\Projects\clr_test>pyinstaller -F clr_min_test.py* > *46 INFO: PyInstaller: 3.1* > *46 INFO: Python: 2.7.11* > *46 INFO: Platform: Windows-7-6.1.7601-SP1* > *46 INFO: wrote C:\Projects\clr_test\clr_min_test.spec* > *46 INFO: UPX is not available.* > *46 INFO: Extending PYTHONPATH with paths* > *['C:\\Projects\\clr_test', 'C:\\Projects\\clr_test']* > *46 INFO: checking Analysis* > *46 INFO: Building Analysis because out00-Analysis.toc is non existent* > *46 INFO: Initializing module dependency graph...* > *46 INFO: Initializing module graph hooks...* > *140 INFO: running Analysis out00-Analysis.toc* > *140 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final > executable* > * required by c:\anaconda\python.exe* > *201 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest* > *201 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest* > *201 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest* > *201 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest* > *201 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest* > *279 INFO: Searching for assembly > amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.3* > *0729.6161_none ...* > *279 INFO: Found manifest > C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1f* > *c8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251.manifest* > *279 INFO: Searching for file msvcr90.dll* > *279 INFO: Found file > C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b* > *_9.0.30729.6161_none_08e61857a83bc251\msvcr90.dll* > *279 INFO: Searching for file msvcp90.dll* > *279 INFO: Found file > C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b* > *_9.0.30729.6161_none_08e61857a83bc251\msvcp90.dll* > *279 INFO: Searching for file msvcm90.dll* > *279 INFO: Found file > C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b* > *_9.0.30729.6161_none_08e61857a83bc251\msvcm90.dll* > *358 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest* > *358 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest* > *358 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest* > *358 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest* > *358 INFO: Found > C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt_* > *1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest* > *358 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> > (9, 0,* > *30729, 6161)* > *404 INFO: Analyzing C:\Projects\clr_test\clr_min_test.py* > *404 INFO: Looking for import hooks ...* > *404 INFO: Processing hook hook-clr.py* > *404 INFO: Processing hook hook-encodings.py* > *3028 INFO: Processing hook hook-httplib.py* > *3028 INFO: Looking for ctypes DLLs* > *3043 INFO: Analyzing run-time hooks ...* > *3043 INFO: Looking for dynamic libraries* > *3186 INFO: Looking for eggs* > *3186 INFO: Using Python library c:\anaconda\python27.dll* > *3186 INFO: Found binding redirects:* > *[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, > arch=u'amd64', oldVe* > *rsion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 6161), > publicKeyToken=u'1fc8b3b* > *9a1e18e3b')]* > *3201 INFO: Warnings written to > C:\Projects\clr_test\build\clr_min_test\warnclr_m* > *in_test.txt* > *3247 INFO: checking PYZ* > *3247 INFO: Building PYZ because out00-PYZ.toc is non existent* > *3247 INFO: Building PYZ (ZlibArchive) > C:\Projects\clr_test\build\clr_min_test\ou* > *t00-PYZ.pyz* > *3545 INFO: checking PKG* > *3545 INFO: Building PKG because out00-PKG.toc is non existent* > *3545 INFO: Building PKG (CArchive) out00-PKG.pkg* > *3575 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, > 0, 307* > *29, 6161)* > *5107 INFO: Bootloader > c:\anaconda\lib\site-packages\PyInstaller\bootloader\Windo* > *ws-64bit\run.exe* > *5107 INFO: checking EXE* > *5107 INFO: Building EXE because out00-EXE.toc is non existent* > *5107 INFO: Building EXE from out00-EXE.toc* > *5107 INFO: Appending archive to EXE > C:\Projects\clr_test\dist\clr_min_test.exe* > > *C:\Projects\clr_test>cd dist* > > *C:\Projects\clr_test\dist>dir* > * Volume in drive C has no label.* > * Volume Serial Number is EAEE-BF09* > > * Directory of C:\Projects\clr_test\dist* > > *01/25/2016 11:23 AM <DIR> .* > *01/25/2016 11:23 AM <DIR> ..* > *01/25/2016 11:23 AM 5,081,903 clr_min_test.exe* > * 1 File(s) 5,081,903 bytes* > * 2 Dir(s) 12,652,199,936 bytes free* > > *C:\Projects\clr_test\dist>clr_min_test.exe* > > *Unhandled Exception: System.IO.FileNotFoundException: Could not load file > or ass* > *embly 'file:///c:\temp\_MEI589642\Python.Runtime.dll' or one of its > dependencies* > *. The system cannot find the file specified.* > * at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, > String cod* > *eBase, Evidence assemblySecurity, RuntimeAssembly locationHint, > StackCrawlMark&* > *stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean > forIntro* > *spection, Boolean suppressSecurityChecks)* > * at > System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName as* > *semblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, > StackCrawlMar* > *k& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, > Boolean forIn* > *trospection, Boolean suppressSecurityChecks)* > * at > System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName as* > *semblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, > StackCrawlMar* > *k& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, > Boolean sup* > *pressSecurityChecks)* > * at System.Reflection.RuntimeAssembly.InternalLoadFrom(String > assemblyFile, Ev* > *idence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm > hashAlgorithm,* > *Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& > stackM* > *ark)* > * at System.Reflection.Assembly.LoadFrom(String assemblyFile)* > * at clrModule.initclr()* > > *C:\Projects\clr_test\dist>* > > Please help, > Igor > -- You received this message because you are subscribed to the Google Groups "PyInstaller" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pyinstaller. For more options, visit https://groups.google.com/d/optout.
