失败的 pjsua python 模块

failing pjsua python module

我尝试在 Ubuntu 16.04 上为 Python 使用 pjsua 模块。 当我尝试调用 AccountConfig 时,它会 return 并显示以下错误消息:

>>> import pjsua
>>> t=pjsua.AccountConfig()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pjsua.py", line 802, in __init__
    self._cvt_from_pjsua(default)
  File "pjsua.py", line 859, in _cvt_from_pjsua
    for cred in cfg.cred_info:
MemoryError

使用以下内容编译 pjsip:

sudo apt-get install build-essential python-dev libpjsua2
wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
sudo rm -fr pjproject-2.7.2
tar -xf pjproject-2.7.2.tar.bz2 && cd pjproject-2.7.2/
export CFLAGS="$CFLAGS -fPIC"
./configure --enable-shared  --disable-sound  && make dep && make
cd pjsip-apps/src/python/
sudo python setup.py install

如果有任何想法,我将不胜感激,我做错了什么。

通过以下方式编译解决了问题:

sudo apt-get update
sudo apt-get -y install build-essential python-dev libpjsua2 libssl-dev libasound2-dev
wget http://www.pjsip.org/release/2.7.2/pjproject-2.7.2.tar.bz2
tar -xf pjproject-2.7.2.tar.bz2 && cd pjproject-2.7.2/
export CFLAGS="$CFLAGS -fPIC"
./configure && make dep && make
cd pjsip-apps/src/python/
sudo python setup.py install