william

Keep Calm and Markdown.

使用 zoxide

zoxide 是一款类比 cd 的目录导航工具,但是提供了基于使用频率的快速跳转功能。

Ubuntu 升级 ffmpeg

今天使用 yt-dlp 下载视频时,遇到一个报错

1
2
3
4
5
[youtube] Extracting URL: https://youtu.be/_dLLIjKz9MY
[youtube] _dLLIjKz9MY: Downloading webpage
...........................................
[Merger] Merging formats into "Fear in Tech - Titus Winters - Keynote Meeting C++ 2024 [_dLLIjKz9MY].mp4"
ERROR: Postprocessing:   Stream #1:0 -> #0:1 (copy)

查找一遍,发现这个是因为 yt-dlpffmpeg 版本冲突导致的,导致yt-dlp --merge-output-format mp4 无法合成 mp4 格式。因此需要升级 ffmpeg

R 调用 python

利用 reticulate 接口,我们可以在 R 中调用 python 封装的函数。

安装 python ldap

问题

安装 python-ldap 失败,报错如下:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
~/miniconda3/bin/python -m pip install python-ldap
                                                                                                                                            [Nov15 17:37:32]
Looking in indexes: https://mirrors.cloud.tencent.com/pypi/simple
Collecting python-ldap
  Using cached https://mirrors.cloud.tencent.com/pypi/packages/fd/8b/1eeb4025dc1d3ac2f16678f38dec9ebdde6271c74955b72db5ce7a4dbfbd/python-ldap-3.4.4.tar.gz (377 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pyasn1>=0.3.7
  Using cached https://mirrors.cloud.tencent.com/pypi/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl (83 kB)
Collecting pyasn1-modules>=0.1.5
  Using cached https://mirrors.cloud.tencent.com/pypi/packages/77/89/bc88a6711935ba795a679ea6ebee07e128050d6382eaa35a0a47c8032bdc/pyasn1_modules-0.4.1-py3-none-any.whl (181 kB)
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for python-ldap (pyproject.toml) did not run successfully.
exit code: 1
  ╰─> [83 lines of output]
      /tmp/ycm.lfang/pip-build-env-e1c2lubs/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-311
      copying Lib/slapdtest/__init__.py -> build/lib.linux-x86_64-cpython-311/slapdtest
      ...................................................................................
      copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-cpython-311/slapdtest
      running egg_info
      writing Lib/python_ldap.egg-info/PKG-INFO
      writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
      writing requirements to Lib/python_ldap.egg-info/requires.txt
      writing top-level names to Lib/python_ldap.egg-info/top_level.txt
      reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'Doc/.build'
      adding license file 'LICENCE'
      writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
      creating build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-cpython-311/slapdtest/certs
      running build_ext
      building '_ldap' extension
      creating build/temp.linux-x86_64-cpython-311/Modules
      gcc -pthread -B /home/lfang/miniconda3/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/lfang/miniconda3/include -fPIC -O2 -isystem /home/lfang/miniconda3/include -fPIC -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=3.4.4 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -I/home/lfang/miniconda3/include/python3.11 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-cpython-311/Modules/LDAPObject.o
      In file included from Modules/LDAPObject.c:3:0:
      Modules/common.h:15:18: fatal error: lber.h: No such file or directory
       #include <lber.h>
                        ^
      compilation terminated.
      error: command '/shared/trading/lib/gcc/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: Failed building wheel for python-ldap
Failed to build python-ldap
ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects

解决

安装 ldap 相关依赖包

1
yum install openldap-devel python-devel

安装 python-ldap

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
~/miniconda3/bin/python -m pip install python-ldap
                                                                                                                                            [Nov15 17:39:07]
Looking in indexes: https://mirrors.cloud.tencent.com/pypi/simple
Collecting python-ldap
  Using cached https://mirrors.cloud.tencent.com/pypi/packages/fd/8b/1eeb4025dc1d3ac2f16678f38dec9ebdde6271c74955b72db5ce7a4dbfbd/python-ldap-3.4.4.tar.gz (​‌​
377 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pyasn1>=0.3.7
  Using cached https://mirrors.cloud.tencent.com/pypi/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.​‌​
whl (83 kB)
Collecting pyasn1-modules>=0.1.5
  Using cached https://mirrors.cloud.tencent.com/pypi/packages/77/89/bc88a6711935ba795a679ea6ebee07e128050d6382eaa35a0a47c8032bdc/pyasn1_modules-0.4.1-py3-n​‌​
one-any.whl (181 kB)
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (pyproject.toml) ... done
  Created wheel for python-ldap: filename=python_ldap-3.4.4-cp311-cp311-linux_x86_64.whl size=286532 sha256=24023d98304c16abd74cebc2da6264630dc5514eb86ce72b​‌​
f45eb9c700f9ab3b
  Stored in directory: /home/lfang/.cache/pip/wheels/e1/1e/2b/95497b4a8f153525aa61c184a47e2fbf35ed9bba349a9c3b08
Successfully built python-ldap
Installing collected packages: pyasn1, pyasn1-modules, python-ldap
Successfully installed pyasn1-0.6.1 pyasn1-modules-0.4.1 python-ldap-3.4.4

Linux 安装 input leap

安装 libc(3.38)

1
2
3
4
5
6
## 添加源
echo "deb http://th.archive.ubuntu.com/ubuntu jammy main    #添加该行到文件" >> /etc/apt/sources.list

## 升级
sudo apt update
sudo apt install libc6

安装 libqt6

1
2
3
4
5
sudo add-apt-repository ppa:okirby/qt6-backports
sudo apt update
apt-get update
sudo apt install qt6-base-dev
apt --fix-broken install

安装 Input-Leap

github 项目主页 下载

0%