Neutree / COMTool

Cross platform communicate assistant(Serial/network/terminal tool)( 跨平台 串口调试助手 网络调试助手 终端工具 linux windows mac Raspberry Pi )支持插件和二次开发
https://neucrack.com/p/186
GNU Lesser General Public License v3.0
1.8k stars 330 forks source link

can't run on mac #1

Closed jerryyip closed 5 years ago

jerryyip commented 6 years ago

I got the following error on my macos 10.13, but i could run a pyqt5 program on mac before. Do you know how to fix this?

Traceback (most recent call last):
  File "/usr/local/bin/comtool", line 7, in <module>
    from COMTool.Main import main
  File "/usr/local/lib/python3.6/site-packages/COMTool/Main.py", line 3, in <module>
    from COMTool.Combobox import ComboBox
  File "/usr/local/lib/python3.6/site-packages/COMTool/Combobox.py", line 1, in <module>
    from PyQt5.QtWidgets import QComboBox,QListView
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/PyQt5/QtWidgets.so, 2): Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /usr/local/lib/python3.6/site-packages/PyQt5/QtWidgets.so
  Reason: image not found
jerryyip commented 6 years ago

It is fine now. I am able to run it in an virtualenv. Feel free to close the issue. It works well for me, except a little bug:

bug

The combobox shows all the usb devices, but all we need is the serial devices with a name "/dev/cu.usb*". Anyway, thank you very much!

Neutree commented 6 years ago

I havent test on mac just for I have no mac machine, you are welcome to use this software

jerryyip commented 6 years ago

Hi my old iron, I have package this application with pyinstaller. Here is the link: COMTool.app.zip Anyone with mac os 10.13 is able to use this app without installing the environment(py3, pyqt5, etc.), just double click the app bundle. And I met a problem when doing this, it was about the absolute path and the relative path. An absolute path is better in any case, it won't cause weird issues. (I edit a bit code to make it work as an app bundle)

# pathDirList = sys.argv[0].replace("\\", "/").split("/")
# pathDirList.pop()
if getattr(sys, 'frozen', False):
    self.app_path = os.path.dirname(sys.executable)
else:
    self.app_path = os.path.dirname(os.path.realpath(__file__))