Tim Edelmann Posted December 4, 2017 Report Posted December 4, 2017 Hey there, we are recently creating an executable file (.exe) for windows from the sources at https://bitbucket.org/ftrack/ftrack-connect.git. Having together all packages needed, this works great using Python 2.7.14, but there seems to be a major drawback. When trying to start Nuke via ftrack-connect-action, we get an error on hashlib saying: Nuke 10.5v4, 64 bit, built May 4 2017. Copyright (c) 2017 The Foundry Visionmongers Ltd. All Rights Reserved. Traceback (most recent call last): File "C:/Program Files/Nuke10.5v4/plugins/init.py", line 22, in <module> import nukescripts.ViewerProcess File "C:/Program Files/Nuke10.5v4/plugins\nukescripts\__init__.py", line 5, in <module> from autobackdrop import * File "C:/Program Files/Nuke10.5v4/plugins\nukescripts\autobackdrop.py", line 3, in <module> import nuke, random File "c:\python2.7.14\Lib\random.py", line 49, in <module> import hashlib as _hashlib File "c:\python2.7.14\Lib\hashlib.py", line 138, in <module> _hashlib.openssl_md_meth_names) AttributeError: 'module' object has no attribute 'openssl_md_meth_names' This can be fixed via editing c:\python2.7.14\Lib\hashlib.py on line 137, 138, by commenting these lines: algorithms_available = algorithms_available.union( _hashlib.openssl_md_meth_names) So we would omit the union of 'opensl_md_meth_names' then... Is here anybody having the same or a similar problem? I'd be greatfull for some insight. Thanks in advance Tim
Eric Hermelin Posted December 4, 2017 Report Posted December 4, 2017 Hi Tim, it looks strange that it would pickup your external hashlib, I believe it should be picking up the version shipped with Nuke. Could you try running the below inside of a "clean" Nuke and one launched within your configured environment import random import hashlib print random.__file__ print hashlib.__file__ print random._hashlib.__file__ cheers Eric
Tim Edelmann Posted December 4, 2017 Author Report Posted December 4, 2017 Hi, and thenks for the fast answer! Here is the outcome of the commands you gave: # Result: C:\Users\tedelmann\dev\Py2.7.13\ftrack-connect\build\lib\ftrack_connect\build\exe.win32-2.7\lib\library.zip\random.pyc C:\Users\tedelmann\dev\Py2.7.13\ftrack-connect\build\lib\ftrack_connect\build\exe.win32-2.7\lib\library.zip\hashlib.pyc C:\Users\tedelmann\dev\Py2.7.13\ftrack-connect\build\lib\ftrack_connect\build\exe.win32-2.7\lib\library.zip\hashlib.pyc and the 'clean' nuke gives me: # Result: C:\Program Files\Nuke10.5v4\lib\random.py C:\Program Files\Nuke10.5v4\lib\hashlib.py C:\Program Files\Nuke10.5v4\lib\hashlib.py It looks like, that hashlib bundled with our .exe-file is used. This one comes from a fresh python 2.7.13 install (yeah, we're using 2.7.13 instead of 2.7.14 now, because here we don't get another error saying: "ImportError: cannot import name _remove_dead_weakref"). Could this come from the fact, that we're creating the exe inside a virtual environment?? Thanks again
Tim Edelmann Posted December 5, 2017 Author Report Posted December 5, 2017 ADD:We already tried to alter sys.path and/or nuke.pluginPath() via an init.py in .nuke folder, so that it points to 'c:\Program Files\Nuke10.5v4\lib' in first place of execution order, but with no luck. For some reason these folders aren't relevant, when evaluating which hashlib.pyc should be used..
Tim Edelmann Posted December 5, 2017 Author Report Posted December 5, 2017 ADD:We already tried to alter sys.path and/or nuke.pluginPath() via an init.py in .nuke folder, so that it points to 'c:\Program Files\Nuke10.5v4\lib' in first place of execution order, but with no luck. For some reason these folders aren't relevant, when evaluating which hashlib.pyc should be used..
Eric Hermelin Posted December 5, 2017 Report Posted December 5, 2017 Hi Tim, could you send me the content of the PYTHONPATH, PYTHONHOME and PATH environment variables from inside of nuke or if your ok with it the full content of your environment. import os import pprint pprint.pprint( os.environ ) cheers Eric
Tim Edelmann Posted December 5, 2017 Author Report Posted December 5, 2017 Hey again, my environment looks like this: # Result: {'FSHARPINSTALLDIR': 'C:\\Program Files (x86)\\Microsoft SDKs\\F#\\4.1\\Framework\\v4.0\\', 'TMP': 'C:\\TEMP\\', 'COMPUTERNAME': 'REALTIME02', 'PROCESSOR_LEVEL': '6', 'UNREAL_SHARED_CACHE_PATH': '//INFSAN/Library/30_Unreal/Cache', 'FOUNDRY_HEARTBEAT_DISABLE': 'TRUE', 'NUKE_LOCAL_PRJ_DIR': 'D:/Projects', 'FTRACK_EVENT_PLUGIN_PATH': 'c:\\Users\\tedelmann\\AppData\\Local\\ftrack\\ftrack-connect-default-plugins', 'PSMODULEPATH': 'C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules', 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 158 Stepping 9, GenuineIntel', 'VBOX_MSI_INSTALL_PATH': 'C:\\Program Files\\Oracle\\VirtualBox\\', 'PROGRAMFILES': 'C:\\Program Files', 'PROCESSOR_REVISION': '9e09', 'HOME': 'C:\\Users\\tedelmann', ;C:\\Program Files\\The Foundry\\RLM;C:\\ProgramData\\The Foundry\\RLM;C:\\Program Files (x86)\\The Foundry\\RLM;C:\\Users\\tedelmann\\FoundryLicensing', 'SYSTEMROOT': 'C:\\Windows', 'PROGRAMFILES(X86)': 'C:\\Program Files (x86)', 'TEMP': 'C:\\TEMP\\', 'COMMONPROGRAMFILES(X86)': 'C:\\Program Files (x86)\\Common Files', 'PROCESSOR_ARCHITECTURE': 'AMD64', 'ALLUSERSPROFILE': 'C:\\ProgramData', 'USERPROFILE': 'C:\\Users\\tedelmann', 'HDRLS_HOME_V5': 'C:\\Program Files\\Lightmap\\HDR Light Studio 5', 'HOMEPATH': '\\Users\\tedelmann', 'CONFIGURATION_SYNC_PATH': 'C:\\ConfigurationSync', 'PROGRAMW6432': 'C:\\Program Files', 'UNREAL_SHARED_TEMPLATES_PATH': '//INFSAN/Library/30_Unreal/Templates', 'USERNAME': 'TEdelmann', 'OS': 'Windows_NT', 'LOCALAPPDATA': 'C:\\Users\\tedelmann\\AppData\\Local', 'ADSK_CLM_WPAD_PROXY_CHECK': 'FALSE', 'PROGRAMDATA': 'C:\\ProgramData', 'NUKE_TEMP_DIR': 'C:/TEMP/nuke', 'PYTHONPATH': 'C:\\Users\\tedelmann\\dev\\Py2.7.13\\Lib\\site-packages\\ftrack_python_api-1.3.3-py2.7.egg', 'ONEDRIVE': 'C:\\Users\\tedelmann\\OneDrive', 'DRIVE': 'C:', 'PATH': 'C:\\Python2.7.13\\;C:\\Python2.7.13\\Scripts;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\GtkSharp\\2.12\\bin;C:\\Program Files\\Perforce;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\WinMerge;C:\\Python2.7.13\\Lib\\site-packages\\PySide\\;C:\\Users\\tedelmann\\AppData\\Local\\Microsoft\\WindowsApps;', 'MARI_CACHE': 'D:\\Cache\\Mari', 'SESSIONNAME': 'Console', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', 'NUKE_PATH': '//INFSAN/Configuration/04_Software/47_Nuke/Workgroups/', 'FP_NO_HOST_CHECK': 'No', 'WINDIR': 'C:\\Windows', 'APPDATA': 'C:\\Users\\tedelmann\\AppData\\Roaming', 'HOMEDRIVE': 'C:', 'UNREAL_SHARED_ASSETS_PATH': '//INFSAN/Library/30_Unreal/Assets', 'GTK_BASEPATH': 'C:\\Program Files (x86)\\GtkSharp\\2.12\\', 'SYSTEMDRIVE': 'C:', 'MAYA_APP_DIR': 'C:\\Users\\tedelmann\\AppData\\Roaming\\MayaSettings', 'COMSPEC': 'C:\\Windows\\system32\\cmd.exe', 'NUMBER_OF_PROCESSORS': '8', 'OPTICAL_FLARES_PRESET_PATH': '\\\\INFSAN\\Configuration\\04_Software\\47_Nuke\\Workgroups\\Nuke10\\Windows\\Plugins', 'COMMONPROGRAMW6432': 'C:\\Program Files\\Common Files', 'PUBLIC': 'C:\\Users\\Public', 'UNREAL_SHARED_PLUGINS_PATH': '//INFSAN/Library/30_Unreal/Plugins/<VersionMinor>'} As you can see PYTHONHOME is not set in my environment.. I removed a few entries belonging to my company's network-architecture Thank you very much Tim
Eric Hermelin Posted December 6, 2017 Report Posted December 6, 2017 Hi Tim, I am not too familiar with python on windows, I would however start with making sure your PATH environment variable does not contain references to your standalone python interpreter, you could "sanitize" the environment in the base application launcher for nuke in the ftrack_connect_nuke_hook updating the _getApplicationEnvironment method. cheers Eric
Tim Edelmann Posted December 7, 2017 Author Report Posted December 7, 2017 Hi Eric, thanks alot for your help!
Tim Edelmann Posted December 7, 2017 Author Report Posted December 7, 2017 Hi Eric, thanks alot for your help!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.