Showing results for 
Search instead for 
Did you mean: 

Python VM not starting from Darwin NCS install on M1 Macbook

The NSO Darwin install of NSO for my M1 Macbook works fine for ncs and java, however the python vm fails to load. Looking in the ncs-python-vm.log, it states that the mach-o file is of type x86_64.


ImportError: dlopen(/Users/sam/Documents/ncs/install-, 0x0002): tried: '/Users/sam/Documents/ncs/install-' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))


I tried going into the src/ncs/pyapi/ directory to try to remake the files, however the make of the pyapi fails with the following error.


❯ make confd-py3
make: *** No rule to make target `_confd/_confd.c', needed by `_confd/'.  Stop.

❯ make ncs-py3
make: *** No rule to make target `../ncs/dm/tailf-ncs.yang', needed by `tmp_fxs/tailf-ncs.fxs'.  Stop.

Which I'm guessing is because I don't have a local install of the ConfD library. 


The build requires gcc and GNU make and the development libraries
for Python 3.5 or greater.

It's also necessary to have access to a built libconfd library.

When I go to the tailf site, ConfD basic installs are no longer available (currently).



5 Replies 5

Alex Stevenson
Cisco Employee
Cisco Employee



Yes, the download page has downloads temporarily disabled. Did you email and ask for help? I looked around the Cisco mailing lists and that is the best place to ask directly.



       Alex S.



I'm having the same issue:

From logs/ncs-python-vm.log I can see:

<INFO> 2-Nov-2022::14:07:03.970 MAC ncs[30773]: l2vpn :: Starting python3 -u /Users/user/nso-5.8/src/ncs/pyapi/ncs_pyvm/ -l info -f ./logs/ncs-python-vm -i l2vpn
Traceback (most recent call last):
 File "/Users/user/nso-5.8/src/ncs/pyapi/ncs_pyvm/", line 6, in <module>
 import ncsctlsock
 File "/Users/user/nso-5.8/src/ncs/pyapi/ncs_pyvm/", line 5, in <module>
 import _ncs
 File "/Users/user/nso-5.8/src/ncs/pyapi/_ncs/", line 12, in <module>
 from ._ncs_py3 import cdb

I installed confd and compiled it. I then tried to compile ncs, but I get this error:

❰user❙~/n/s/n/pyapi❱✘≻ make ncs-py3
PROD=NCS /Library/Developer/CommandLineTools/usr/bin/make src/gen_add_lib_const.c
# Clean all Python 3 so files, including possible leftovers. Possibly built
# with a previous Python 3 version, which might make them differ in naming.
Building NCS Python 3.x bindings
running build_ext
building '_ncs._ncs_py3' extension
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DCONFD_PY_PRODUCT_NCS=1 -DCONFD_C_PRODUCT_NCS=1 -D_TM=\"_ncs\" -UNDEBUG -I/Users/user/confd/include -Iinclude -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c _ncs/_ncs.c -o build/_ncs/ -std=c99
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DCONFD_PY_PRODUCT_NCS=1 -DCONFD_C_PRODUCT_NCS=1 -D_TM=\"_ncs\" -UNDEBUG -I/Users/user/confd/include -Iinclude -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/_cdb.c -o build/_ncs/ -std=c99
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DCONFD_PY_PRODUCT_NCS=1 -DCONFD_C_PRODUCT_NCS=1 -D_TM=\"_ncs\" -UNDEBUG -I/Users/user/confd/include -Iinclude -I/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/_dp.c -o build/_ncs/ -std=c99
src/_dp.c:6200:26: error: use of undeclared identifier 'CONFD_ERRTYPE_NCS'
if (errinfo->type == CONFD_ERRTYPE_NCS) {
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
make: *** [_ncs/] Error 1

Is this a known issue?

Make sure you use the Python version that comes with MacOS on M1. That works. No recompiling is necessary. I.e. use the following settings:

$ arch -x86_64 bash -l
$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.
$ arch
$ which python3
$ python3 --version
Python 3.9.6
$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)


That did the trick! Thanks!

Can you maybe update the documentation to cover this? It would help other avoid the traditional google-fu.

Cisco Employee
Cisco Employee

Agree those steps could be added to the installation guide. Generic M1 Mac Rosetta 2 dependant commands however that may be different tomorrow. And the need for them will be obsoleted when NSO for Darwin ARM64 is supported (not only x86_64) in the not-so-distant future.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community:

Recognize Your Peers