-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run nut.py and nut_gui.py on M1 & M2 Mac (solution inside) #443
Comments
Also encountered a lot of errors and could not get it to compile on mac. |
I would appreciate if the developers follow the requested suggestion from @blacklein about to add it in the releases page for macOS users (M1 and Intel) |
+1 for Intel |
Tested on Python 3.9.13 via pyenv
Create virtualenv
install dependecies
make folder if there is no lib directory
Link libusb to default bin diretory
set curl env for current shell window
set openssl env for current shell window
Copy pyqt@5 to virtualenv
install pyurl with openssl
Copy key.txt to nut working directory
Show info if successful
Run nut GUI
|
@blacklein, I've got it working on my Intel machine thanks to your guide. Almost all commands work, I've replaced all of
Understandable because I don't see the folder testvenv in the master folder. All other commands work and NUT seems to work well. Not sure if I miss something here? Just to be sure/safe. For me, the only thing I have to do when I relaunch a terminal:
|
testnut is the name of virtual enviroment created for this project under nut folder, so it can be any name depends on what you use in |
Ah I found the folder, thanks again. It weirdly works without it. |
if you use |
I did, thanks! |
Mac M1 I follow the solution of @blacklein then found this error when installing pycurl Installing collected packages: pycurl
DEPRECATION: pycurl is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451
Running setup.py install for pycurl ... error
error: subprocess-exited-with-error
× Running setup.py install for pycurl did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Using curl-config (libcurl 7.79.1)
Using SSL library: OpenSSL/LibreSSL/BoringSSL
running install
/Users/thiennq/workspace/pet/nut/testnut/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.macosx-12-arm64-cpython-39
creating build/lib.macosx-12-arm64-cpython-39/curl
copying python/curl/__init__.py -> build/lib.macosx-12-arm64-cpython-39/curl
running build_ext
building 'pycurl' extension
creating build/temp.macosx-12-arm64-cpython-39
creating build/temp.macosx-12-arm64-cpython-39/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/docstrings.c -o build/temp.macosx-12-arm64-cpython-39/src/docstrings.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/easy.c -o build/temp.macosx-12-arm64-cpython-39/src/easy.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/easycb.c -o build/temp.macosx-12-arm64-cpython-39/src/easycb.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/easyinfo.c -o build/temp.macosx-12-arm64-cpython-39/src/easyinfo.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/easyopt.c -o build/temp.macosx-12-arm64-cpython-39/src/easyopt.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/easyperform.c -o build/temp.macosx-12-arm64-cpython-39/src/easyperform.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/module.c -o build/temp.macosx-12-arm64-cpython-39/src/module.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/multi.c -o build/temp.macosx-12-arm64-cpython-39/src/multi.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/oscompat.c -o build/temp.macosx-12-arm64-cpython-39/src/oscompat.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/pythoncompat.c -o build/temp.macosx-12-arm64-cpython-39/src/pythoncompat.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/share.c -o build/temp.macosx-12-arm64-cpython-39/src/share.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/stringcompat.c -o build/temp.macosx-12-arm64-cpython-39/src/stringcompat.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/threadsupport.c -o build/temp.macosx-12-arm64-cpython-39/src/threadsupport.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I /opt/homebrew/opt/openssl@3/include -DPYCURL_VERSION=\"7.45.2\" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/Users/thiennq/workspace/pet/nut/testnut/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/util.c -o build/temp.macosx-12-arm64-cpython-39/src/util.o
gcc -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -L /opt/homebrew/opt/openssl@3/lib -I /opt/homebrew/opt/openssl@3/include build/temp.macosx-12-arm64-cpython-39/src/docstrings.o build/temp.macosx-12-arm64-cpython-39/src/easy.o build/temp.macosx-12-arm64-cpython-39/src/easycb.o build/temp.macosx-12-arm64-cpython-39/src/easyinfo.o build/temp.macosx-12-arm64-cpython-39/src/easyopt.o build/temp.macosx-12-arm64-cpython-39/src/easyperform.o build/temp.macosx-12-arm64-cpython-39/src/module.o build/temp.macosx-12-arm64-cpython-39/src/multi.o build/temp.macosx-12-arm64-cpython-39/src/oscompat.o build/temp.macosx-12-arm64-cpython-39/src/pythoncompat.o build/temp.macosx-12-arm64-cpython-39/src/share.o build/temp.macosx-12-arm64-cpython-39/src/stringcompat.o build/temp.macosx-12-arm64-cpython-39/src/threadsupport.o build/temp.macosx-12-arm64-cpython-39/src/util.o -lssl3 -lssl -lcrypto -lcurl -o build/lib.macosx-12-arm64-cpython-39/pycurl.cpython-39-darwin.so -flat_namespace
ld: library not found for -lssl3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pycurl
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure. |
did you run pip3 uninstall pycurl first? |
try this |
If you get the following error while running
this fixed it for me:
After this, try running the command again: |
After that I keep getting this error: QFactoryLoader::QFactoryLoader() checking directory path "/Users/marck/.pyenv/versions/3.9.13/bin/platforms" ...
objc[1083]: Class QMacAutoReleasePoolTracker is implemented in both /usr/local/Cellar/qt@5/5.15.8_2/lib/QtCore.framework/Versions/5/QtCore (0x106341a08) and /Users/marck/Documents/github/nut/testnut/lib/python3.9/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore (0x11432f198). One of the two will be used. Which one is undefined.
objc[1083]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /usr/local/Cellar/qt@5/5.15.8_2/lib/QtCore.framework/Versions/5/QtCore (0x106341a80) and /Users/marck/Documents/github/nut/testnut/lib/python3.9/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore (0x11432f210). One of the two will be used. Which one is undefined.
objc[1083]: Class KeyValueObserver is implemented in both /usr/local/Cellar/qt@5/5.15.8_2/lib/QtCore.framework/Versions/5/QtCore (0x106341aa8) and /Users/marck/Documents/github/nut/testnut/lib/python3.9/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore (0x11432f238). One of the two will be used. Which one is undefined.
objc[1083]: Class RunLoopModeTracker is implemented in both /usr/local/Cellar/qt@5/5.15.8_2/lib/QtCore.framework/Versions/5/QtCore (0x106341af8) and /Users/marck/Documents/github/nut/testnut/lib/python3.9/site-packages/PyQt5/Qt5/lib/QtCore.framework/Versions/5/QtCore (0x11432f288). One of the two will be used. Which one is undefined.
loaded library "/Users/marck/Documents/github/nut/testnut/lib/python3.9/site-packages/PyQt5/Qt5/plugins/platforms/libqcocoa.dylib"
QObject::moveToThread: Current thread (0x600002d58070) is not the object's thread (0x600002d50800).
Cannot move to target thread (0x600002d58070)
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. It looks like the Qt packages keep looking at two locations? I found this, but that discusses older versions. ronaldoussoren/py2app#380 I think it is because at some point we copy the files to the venv, so I think it looks there and at the system files: |
I followed the above steps and also the README guide but I'm getting the following error when running nut.py or nut_gui.py
|
Is your feature request related to a problem? Please describe.
after so many tries and errors of installation on my own macbook, would you please release macos cli and macos nut-gui for download
Describe the solution you'd like
download macos nut cli and nut gui from release page
Describe alternatives you've considered
A description of any alternative solutions or features you've considered.
The text was updated successfully, but these errors were encountered: