lib 2)将python3的软链接指向python3.9 具体如下: ln /usr/local/python39/bin/python3.9 -s /usr/bin/python3 图片 3)配置python-config -release/libs/esl/python3 目录: mv python-config python-config-bak cp /usr/local/python39/bin/python3.9 -config python-config 3、编译ESL库 1) 生成Makefile文件 进入 freeswitch-1.10.9.
install 配置 Python 更新系统默认 Python 版本 先把系统默认的旧版 Python 重命名 mv /usr/bin/python /usr/bin/python.old 再删除系统默认的 python-config 软链接 rm -f /usr/bin/python-config 最后创建新版本的 Python 软链接 ln -s /usr/local/bin/python /usr/bin/python ln -s /usr/local/bin/python-config /usr/bin/python-config ln -s /usr/local/include/python2.7/ /usr/include
mv /usr/bin/python /usr/bin/python.old 再删除系统默认的 python-config 软链接。] rm -f /usr/bin/python-config 最后创建新版本的 Python 软链接。 ln -s /usr/local/bin/python /usr/bin/python ln -s /usr/local/bin/python-config /usr/bin/python-config
安装cython 2. cython test.py --embed 3. gcc `python-config --cflags` `python-config --ldflags` test.c -
localhost ~]# vim lyshark.py [root@localhost ~]# cython lyshark.py --embed [root@localhost ~]# gcc `python-config --cflags` `python-config --ldflags` lyshark.c -o lyshark C语言调用shell命令,并返回结果 #include <stdio.h> int
执行文件删掉 # sudo rm /usr/bin/pydoc # sudo rm /usr/bin/python # sudo rm /usr/bin/pythonw # sudo rm /usr/bin/python-config sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config /usr/bin/python-config
usr/bin/python2-config -> python2.7-config lrwxrwxrwx 1 root root 14 2019/03/26 17:13:24 /usr/bin/python-config usr/bin/python2-config -> python2.7-config lrwxrwxrwx 1 root root 14 2019/03/26 17:13:24 /usr/bin/python-config usr/bin/python2-config -> python2.7-config lrwxrwxrwx 1 root root 14 2019/03/26 17:13:24 /usr/bin/python-config
local/bin/python2-config -> python2.7-config lrwxrwxrwx 1root root 1410月 1217:17 /usr/local/bin/python-config 先把系统默认的旧版 Python 重命名 [root@localhost Python-2.7.13]# mv /usr/bin/python /usr/bin/python.old ##再删除系统默认的 python-config 软链接 [root@localhost Python-2.7.13]# rm -f /usr/bin/python-config ##最后创建新版本的 Python 软链接 [root@localhost
/python27/bin/ 2to3 ipcluster ipengine iptest irunner pydoc python2 python2.7-config python-config /python27/bin/ 2to3 ipcluster ipengine iptest irunner pydoc python2 python2.7-config python-config
使用下面的命令先删除 sudo rm /usr/bin/pydoc sudo rm /usr/bin/python sudo rm /usr/bin/pythonw sudo rm /usr/bin/python-config sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3m-config /usr/bin/python-config
Python has been installed as /usr/local/bin/python3 Unversioned symlinks `python`, `python-config`
指定对应的cgo CFLAGS 和 LDFLAGS 选项 对于未由 c 包装的 python 代码,python-dev 包中内置了 python-config 工具用于查看编译选项。 -lutil -lm -xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions 低版本的 python 也可以在安装开发包后,使用对应的 python-config
python2.7 /usr/bin/python2-pbr /usr/bin/python3.7-config /usr/bin/python3-config /usr/bin/python-config
同时,用python3的话,把pse/Makefile文件中的, 第一行:(shell python-config --cflags)改成(shell python3-config --cflags) 第二行:(shell python-config --ldflags)改成(shell python3-config --ldflags) 不要去下载源码编译,很浪费时间。
iptest ipython irunner pycolor pydoc python python2 python2.7 python2.7-config python2-config python-config
example_module); } 然后,我们可以使用以下命令将源文件编译为共享库文件: shellCopy code gcc -o example.so -shared -fPIC example.c $(python-config --includes) $(python-config --ldflags) 完成编译之后,我们可以在Python中导入和使用这个模块,示例代码如下: pythonCopy code import example
\ && ln -s pydoc3 pydoc \ && ln -s python3 python \ && ln -s python3-config python-config
root 16 Sep 11 08:37 python2-config -> python2.7-config lrwxrwxrwx 1 root root 14 Sep 11 08:37 python-config
dh_python3 python python2 python2.7 python2.7-config python2-config python3 python3.5 python3.5m python3m python-config
root 10 Mar 18 00:34 python3m -> python3.6m lrwxrwxrwx 1 root root 16 Sep 23 2017 python-config