tingbot / tingbot-python

🔩 Python APIs to write apps for Tingbot
Other
18 stars 9 forks source link

No module named _commoncrypto #51

Closed chetbox closed 7 years ago

chetbox commented 7 years ago

I just set up my Tingbot and installed Tide on Mac OS Sierra for the first time. I can run the "Hello world!" app in the simulator but when I try to run it on the device I get this error:

tbtool: Connecting to Pi...                                                         
tbtool: No module named _commoncrypto                                               

Process exited.    
chetbox commented 7 years ago

I thought it might be something to do with Python being set up incorrectly on my machine (though I believe I'm using the default Mac OS version) so I tried to connect to the pi using an SSHSession. This seems to work as expected so I'm not really sure what the problem is.

>>> session = SSHSession('192.168.1.11')
>>> session.exec_command('echo $HOME')
/home/pi
>>>
joerick commented 7 years ago

I suspect it's a Python environment issue as well. Could you paste this into Tide and let me know the output? (run on 'simulator')

import os, sys

print("sys.path=%s" % sys.path)
print("PYTHONPATH=%s" % os.environ['PYTHONPATH'])
import cryptography
print("cryptography version: %s" % cryptography.__version__)
print("cryptography file: %s" % cryptography.__file__)
chetbox commented 7 years ago
cryptography version: 1.4                                                           
cryptography file: /Applications/Tide.app/Contents/Resources/vendor/tide-packages/cryptography/__init__.pyc                                                             

Process exited.   

Hope that helps!

joerick commented 7 years ago

Hmm. Where's the sys.path line output?

chetbox commented 7 years ago

My bad, I failed to scroll. (I should probably have read what you asked me to run on my computer!)


sys.path=['/private/var/folders/kw/sk1_v3sn0ms4hqkbtgjvxy2r0000gn/T/tide/44936757ee34b0d39f0190feca622509/b52e8280-9901-11e6-a998-e915b4543ca3.tingapp', '/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg', '/Applications/Tide.app/Contents/Resources/vendor/tide-packages', '/Library/Python/2.7/site-packages/google_api_python_client-1.2-py2.7.egg', '/Library/Python/2.7/site-packages/httplib2-0.8-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC']                                                                                                                                   
PYTHONPATH=/Applications/Tide.app/Contents/Resources/vendor/tide-packages
cryptography version: 1.4                                                                                                                                    
cryptography file: /Applications/Tide.app/Contents/Resources/vendor/tide-packages/cryptography/__init__.pyc                                                  

Process exited.  
joerick commented 7 years ago

I think this problem isn't local to you - could you try this version? https://github.com/tingbot/tide-electron/releases/tag/v0.4.2

chetbox commented 7 years ago

Working with Tide 0.4.2 and also just upgraded to 0.4.5 and works there too. Thanks!

joerick commented 7 years ago

Thanks for following up- sorry it wasn't the best first-run experience!