Using UCI on Ubuntu

The following HOWTO introduces the building of UCI (Unified Configuration Interface) on Ubuntu.

  1. Some extra package are required:

    sudo apt-get install cmake lua5.2

  2. The libubox library is required. It should to compiled from source. To do this, first you have to get the source from git:  

    git clone git://nbd.name/luci2/libubox.git libubox
    cd libubox


  3. Please follow the next steps to build libubox:

    mkdir build
    cd build
    cmake ..
    make ubox


  4. Install libubox:

    sudo mkdir -p /usr/local/include/libubox
    sudo cp ../*.h /usr/local/include/libubox
    sudo cp libubox.so /usr/local/lib
    sudo ldconfig


  5. Get UCI source from git:

    git clone git://nbd.name/uci.git uci
    cd uci


  6. Please follow the next steps to build uci:

    mkdir build
    cd build
    cmake ..
    make uci cli


  7. Install uci:

    sudo mkdir -p /usr/local/include/uci
    sudo cp ../uci.h ../uci_config.h /usr/local/include/uci
    sudo cp ../uci_blob.h ../ucimap.h /usr/local/include/uci
    sudo cp libuci.so /usr/local/lib
    sudo cp uci /usr/local/bin
    sudo ldconfig


  8. Testing:

    mkdir test
    cat > test/test << EOF
    > config 'test' 'abc'
    > option 'test_var' 'value'
    > EOF


    uci -c `pwd`/test show test
    Output:
    test.abc=test
    test.abc.test_var=value


    uci -c `pwd`/test set test.abc.test_var=foobar
    uci -c `pwd`/test commit test


    uci -c `pwd`/test show test
    Output:
    test.abc=test
    test.abc.test_var=foobar
安装face_recognition的时候提示下面报错信息: Building wheels for collected packages: dlib Building wheel for dlib (setup.py) … error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [47 lines of output] C:\Users\dltsz\AppData\Local\Temp\pip-install-liqyha4o\dlib_943d38e4a62c4e52914ec6f7e8bcbde9\setup.py:234: SyntaxWarning: invalid escape sequence ‘(’ major = re.findall(“set(CPACK_PACKAGE_VERSION_MAJOR."(.)"”, open(cmake_file).read())[0] C:\Users\dltsz\AppData\Local\Temp\pip-install-liqyha4o\dlib_943d38e4a62c4e52914ec6f7e8bcbde9\setup.py:235: SyntaxWarning: invalid escape sequence ‘(’ minor = re.findall(“set(CPACK_PACKAGE_VERSION_MINOR."(.)"”, open(cmake_file).read())[0] C:\Users\dltsz\AppData\Local\Temp\pip-install-liqyha4o\dlib_943d38e4a62c4e52914ec6f7e8bcbde9\setup.py:236: SyntaxWarning: invalid escape sequence ‘(’ patch = re.findall(“set(CPACK_PACKAGE_VERSION_PATCH."(.)"”, open(cmake_file).read())[0] running bdist_wheel running build running build_ext CMake is not installed on your system! Or it is possible some broken copy of cmake is installed on your system. It is unfortunately very common for python package managers to include broken copies of cmake. So if the error above this refers to some file path to a cmake file inside a python or anaconda or miniconda path then you should delete that broken copy of cmake from your computer. Instead, please get an official copy of cmake from one of these known good sources of an official cmake: - cmake.org (this is how windows users should get cmake) - apt install cmake (for Ubuntu or Debian based systems) - yum install cmake (for Redhat or CenOS based systems) On a linux machine you can run `which cmake` to see what cmake you are actually using. If it tells you it's some cmake from any kind of python packager delete it and install an official cmake. More generally, cmake is not installed if when you open a terminal window and type cmake --version you get an error. So you can use that as a very basic test to see if you have cmake installed. That is, if cmake --version doesn't run from the same terminal window from which you are reading this error message, then you have not installed cmake. Windows users should take note that they need to tell the cmake installer to add cmake to their PATH. Since you can't run commands that are not in your PATH. This is how the PATH works on Linux as well, but failing to add cmake to the PATH is a particularly common problem on windows and rarely a problem on Linux. ================================================================================ ================================================================================ ================================================================================ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for dlib Running setup.py clean for dlib Failed to build dlib ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)
03-21
但是我pip的时候却报错:Installing build dependencies ... error error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> [71 lines of output] Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation == "CPython"' don't match your environment Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation != "CPython"' don't match your environment Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment Collecting setuptools Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl (1.2 MB) Collecting wheel Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0b/2c/87f3254fd8ffd29e4c02732eee68a83a1d3c346ae39bc6822dcbcb697f2b/wheel-0.45.1-py3-none-any.whl (72 kB) Collecting Cython>=0.28.5 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c2/94/65ba40faeafe74845ba22b61aff7d73475671c3bd24bffc6cba53f3b0063/cython-3.1.2-cp313-cp313-win_amd64.whl (2.7 MB) ---------------------------------------- 2.7/2.7 MB 11.0 MB/s eta 0:00:00 Collecting numpy==1.17.3 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe/numpy-1.17.3.zip (6.4 MB) ---------------------------------------- 6.4/6.4 MB 11.1 MB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error Preparing metadata (pyproject.toml) did not run successfully. exit code: 1 [28 lines of output] Running from numpy source directory. <string>:418: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates Traceback (most recent call last): File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() ~~~~^^ File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "C:\Users\18982\AppData\Local\Temp\pip-build-env-iylv62ta\overlay\Lib\site-packages\setuptools\build_meta.py", line 374, in prepare_metadata_for_build_wheel self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-iylv62ta\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-iylv62ta\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 443, in <module> File "<string>", line 422, in setup_package File "C:\Users\18982\AppData\Local\Temp\pip-install-cnhfnw94\numpy_33d7182cc1bd44368e579191210a5ae4\numpy\distutils\__init__.py", line 6, in <module> from . import ccompiler File "C:\Users\18982\AppData\Local\Temp\pip-install-cnhfnw94\numpy_33d7182cc1bd44368e579191210a5ae4\numpy\distutils\ccompiler.py", line 111, in <module> replace_method(CCompiler, 'find_executables', CCompiler_find_executables) ^^^^^^^^^ NameError: name 'CCompiler' is not defined. Did you mean: 'ccompiler'? [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed Encountered error while generating package metadata. See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. [notice] A new release of pip is available: 23.2.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 23.2.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip (base) (.venv) PS D:\Python\Projects\SymbolicRegression> pip uninstall scikit-learn Found existing installation: scikit-learn 1.7.1 Uninstalling scikit-learn-1.7.1: Would remove: d:\python\projects\symbolicregression\.venv\lib\site-packages\scikit_learn-1.7.1.dist-info\* d:\python\projects\symbolicregression\.venv\lib\site-packages\sklearn\* Proceed (Y/n)? y Successfully uninstalled scikit-learn-1.7.1 (base) (.venv) PS D:\Python\Projects\SymbolicRegression> pip install scikit-learn==0.20.4 -i https://pypi.tuna.tsinghua.edu.cn/simple Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting scikit-learn==0.20.4 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/20/a0/5ec20d7e460d8ebde9ec5e40cda4339c5f546871c3a5bf9228f615b25618/scikit-learn-0.20.4.tar.gz (11.7 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.7/11.7 MB 11.5 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] <string>:12: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. Partial import of sklearn during the build process. Traceback (most recent call last): File "<string>", line 153, in get_numpy_status ModuleNotFoundError: No module named 'numpy' Traceback (most recent call last): File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() ~~~~^^ File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Python\Projects\SymbolicRegression\.venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "C:\Users\18982\AppData\Local\Temp\pip-build-env-uqmyyyrx\overlay\Lib\site-packages\setuptools\build_meta.py", line 374, in prepare_metadata_for_build_wheel self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-uqmyyyrx\overlay\Lib\site-packages\setuptools\build_meta.py", line 512, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\18982\AppData\Local\Temp\pip-build-env-uqmyyyrx\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "<string>", line 250, in <module> File "<string>", line 238, in setup_package ImportError: Numerical Python (NumPy) is not installed. scikit-learn requires NumPy >= 1.8.2. Installation instructions are available on the scikit-learn website: http://scikit-learn.org/stable/install.html [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
最新发布
07-28
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值