Monast error module twisted not found

I tried with python3 and I am getting the following error. root@izzyai monast]# python3.6 monast.py File "monast.py", line 22 print "Monast ERROR: Module twisted not found." ^ S...

@isravelraja

I tried with python3 and I am getting the following error.

root@izzyai monast]# python3.6 monast.py
File «monast.py», line 22
print «Monast ERROR: Module twisted not found.»
^
SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(«Monast ERROR: Module twisted not found.»)?

I have installed twisted 16.0, however, the same issue persists

pip-3 install Twisted==16.0.0

@dagmoller

Monast is not compatible with python 3

Em qui, 23 de jan de 2020 13:19, isravelraja <notifications@github.com>
escreveu:

I tried with python3 and I am getting the following error.

***@***.*** monast]# python3.6 monast.py
File «monast.py», line 22
print «Monast ERROR: Module twisted not found.»
^
SyntaxError: Missing parentheses in call to ‘print’. Did you mean
print(«Monast ERROR: Module twisted not found.»)?

I have installed twisted 16.0, however, the same issue persists

pip-3 install Twisted==16.0.0


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#15?email_source=notifications&email_token=AAI7WGL75Q7XMBXJIIZRPLTQ7G7RLA5CNFSM4KKZEHGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IIJLJFQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI7WGII5VYZCW6RO45VIYDQ7G7RLANCNFSM4KKZEHGA>
.

@isravelraja

Do we have any plans to support python3future?

On Fri, 24 Jan 2020, 12:27 am Diego Aguirre, ***@***.***> wrote:
Monast is not compatible with python 3

Em qui, 23 de jan de 2020 13:19, isravelraja ***@***.***>
escreveu:

> I tried with python3 and I am getting the following error.
>
> ***@***.*** monast]# python3.6 monast.py
> File «monast.py», line 22
> print «Monast ERROR: Module twisted not found.»
> ^
> SyntaxError: Missing parentheses in call to ‘print’. Did you mean
> print(«Monast ERROR: Module twisted not found.»)?
>
> I have installed twisted 16.0, however, the same issue persists
>
> pip-3 install Twisted==16.0.0
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <
#15?email_source=notifications&email_token=AAI7WGL75Q7XMBXJIIZRPLTQ7G7RLA5CNFSM4KKZEHGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IIJLJFQ
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AAI7WGII5VYZCW6RO45VIYDQ7G7RLANCNFSM4KKZEHGA
>
> .
>


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15?email_source=notifications&email_token=AEMAPVXYGCEV5DTK6Q7EFE3Q7HAPBA5CNFSM4KKZEHGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJX6L6I#issuecomment-577758713>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEMAPVTU5WXVISDDOUQNBHLQ7HAPBANCNFSM4KKZEHGA>
.

@dagmoller

No time for it at moment

Em qui, 23 de jan de 2020 13:29, isravelraja <notifications@github.com>
escreveu:

Do we have any plans to support python3 yet?

On Fri, 24 Jan 2020, 12:27 am Diego Aguirre, ***@***.***>
wrote:

> Monast is not compatible with python 3
>
> Em qui, 23 de jan de 2020 13:19, isravelraja ***@***.***>
> escreveu:
>
> > I tried with python3 and I am getting the following error.
> >
> > ***@***.*** monast]# python3.6 monast.py
> > File «monast.py», line 22
> > print «Monast ERROR: Module twisted not found.»
> > ^
> > SyntaxError: Missing parentheses in call to ‘print’. Did you mean
> > print(«Monast ERROR: Module twisted not found.»)?
> >
> > I have installed twisted 16.0, however, the same issue persists
> >
> > pip-3 install Twisted==16.0.0
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <
>
#15?email_source=notifications&email_token=AAI7WGL75Q7XMBXJIIZRPLTQ7G7RLA5CNFSM4KKZEHGKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IIJLJFQ
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AAI7WGII5VYZCW6RO45VIYDQ7G7RLANCNFSM4KKZEHGA
> >
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <
#15?email_source=notifications&email_token=AEMAPVXYGCEV5DTK6Q7EFE3Q7HAPBA5CNFSM4KKZEHGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJX6L6I#issuecomment-577758713
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AEMAPVTU5WXVISDDOUQNBHLQ7HAPBANCNFSM4KKZEHGA
>
> .
>


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#15?email_source=notifications&email_token=AAI7WGMFCA2LME75BSOMYUDQ7HAVDA5CNFSM4KKZEHGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJX6R5A#issuecomment-577759476>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI7WGLY3T275PRLOI4MKTDQ7HAVDANCNFSM4KKZEHGA>
.

@Tolmino

please, dagmoller, can you consider php7 compatibility?
that maybe a more fast thing

I just installed Python to start experimenting a bit with Scrapy.
Found a tutorial to first install Miniconda and with this I was able to install Scrapy. Now the problem is that the software I’m trying to run also requires Twisted. So I installed twisted with pip.

Twisted seems to have been installed correctly but I’m still getting an error when running the script that the Twisted module could not be found.

Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
================ RESTART: C:xampphtdocscrawlercrawler.py ================
Traceback (most recent call last):
  File "C:xampphtdocscrawlercrawler.py", line 3, in <module>
    from scrapy.utils.project import get_project_settings
  File "C:xampphtdocscrawlerscrapy__init__.py", line 43, in <module>
    from twisted import version as _txv
ModuleNotFoundError: No module named 'twisted'
>>> 
================ RESTART: C:xampphtdocscrawlercrawler.py ================
Traceback (most recent call last):
  File "C:xampphtdocscrawlercrawler.py", line 3, in <module>
    from scrapy.utils.project import get_project_settings
  File "C:xampphtdocscrawlerscrapy__init__.py", line 43, in <module>
    from twisted import version as _txv
ModuleNotFoundError: No module named 'twisted'
>>> 

Anybody a suggestion?

Thanks in advance,

asked Dec 16, 2017 at 13:18

Frank W.'s user avatar

Frank W.Frank W.

7673 gold badges14 silver badges33 bronze badges

2

You installed twisted for python2. When you use the command pip , you are installing a package for python2. You are using python3 (3.6.3). To install twisted for python3, you have to do:

pip3 install twisted

I hope this helps.

answered Dec 16, 2017 at 13:25

Oqhax's user avatar

OqhaxOqhax

3991 gold badge3 silver badges16 bronze badges

9

To try if twisted correctly installed, start python interpreter and type

import twisted

If you can’t import twisted, you should check if it is in your python path.
Python path can be checked in the python interpreter as

import sys
print sys.path

The directory, where your twisted is installed has to be among those folders.

answered Dec 16, 2017 at 13:27

jshepherd's user avatar

jshepherdjshepherd

8801 gold badge9 silver badges22 bronze badges

Monast is a monitoring interface which acts as an operator panel for AsteriskTM.

What Monast can display (in realtime)?

  • Multiple Servers
  • Users and Peers (SIP, IAX, DAHDI, Khomp, etc…)
  • Channels and Calls (with channel name and callerid)
  • Meetmes (with connected users)
  • Parked Calls
  • Queues (with all statistics, members and waiting clients)

What Monast can do (in realtime)?

  • Originate Calls
  • Transfer Calls
  • Hangup Calls
  • Park Calls
  • Spy Calls
  • Invite Users or Numbers to Meetme
  • Kick Users on Meetme
  • Add User/Peer as Member of any Queue
  • Remove Member from Queues
  • Pause/Unpause Members in Queues
  • Execute CLI Commands

Monast was develop in Python (Starpy + Twisted), PHP (for integration of Web interface with Python) and uses prototype.js to handle AJAX calls and YUI (Yahoo User Interface) for the interface.

Licensed under BSD, it has been created by Diego Aguirre (DagMoller).

You may find extra information about it on its Github.com project page, just click here.

Instalation Instructions:

1 - Configure the asterisk manager to create an user to use with monast.
    - Sample manager.conf user:
      [monast_user]
      secret=monast_secret
      writetimeout=100
      read=system,call,log,verbose,command,agent,user,config,originate,reporting
      write=system,call,log,verbose,command,agent,user,config,originate,reporting

2 - Configure apache to point to location where you extracted monast.
    - Sample:
      Alias /monast /path/to/monast
      
          Order allow,deny
          Allow from all
      

3 - Copy pymon/monast.conf.sampe to /etc/monast.conf and edit it 
    properly as documented inside of this file.

4 - Install dependencies:
    Twisted Python 10.1+ (http://twistedmatrix.com)
    zope.interface 3.6+ (http://pypi.python.org/pypi/zope.interface#download)
    Starpy SVN-Trunk (http://sourceforge.net/projects/starpy/) 
      - Trunk tarball: http://starpy.svn.sourceforge.net/viewvc/starpy/trunk/?view=tar
    PHP PEAR Packages: (HTTP_Client)

5 - Run monast.py:
    # cd pymon

    - Verify if is everything OK.
    # ./monast.py

    - If no ERRORS, stop monast.py pressing ctrl+c and run it as daemon.
    # ./monast.py --daemon

6 - Edit lib/config.php as documented inside this file.

7 - Point your browser to location that was configured in apache.
    http://server_addr/monast/index.php

If you want to file a bug on Monast you can do so using the integrated issue tracker from Github.com available here.

Or access #monast IRC channel on Freenode.

In case you do not want any stable release and prefer to obtain the newest features and bells, so that you can send your patches or suggestions on how to make Monast better, you can checkout the latest code of Monast by running the following command.

git clone https://github.com/dagmoller/monast.git

Just keep in mind that it is permanently in a beta state and unstable.

(Ubuntu 14.04 LTS, Asterisk 11, Apache2, MySQL5.5, PHP5.5, FreePBX 2.11 + MonAst3)

Проверяем установлен ли пакет python и его версию

# python —version

Python 2.7.6

Ставим пакет HTTP_Client:

# pear install HTTP_Client

WARNING: «pear/HTTP_Client» is deprecated in favor of «pear/HTTP_Request2»

WARNING: channel «pear.php.net» has updated its protocols, use «pear channel-update pear.php.net» to update

WARNING: «pear/HTTP_Request» is deprecated in favor of «pear/HTTP_Request2»

WARNING: «pear/Net_URL» is deprecated in favor of «pear/Net_URL2»

downloading HTTP_Client-1.2.1.tgz …

Starting to download HTTP_Client-1.2.1.tgz (10,269 bytes)

…..done: 10,269 bytes

downloading HTTP_Request-1.4.4.tgz …

Starting to download HTTP_Request-1.4.4.tgz (17,233 bytes)

…done: 17,233 bytes

downloading Net_URL-1.0.15.tgz …

Starting to download Net_URL-1.0.15.tgz (6,393 bytes)

…done: 6,393 bytes

downloading Net_Socket-1.0.14.tgz …

Starting to download Net_Socket-1.0.14.tgz (5,655 bytes)

…done: 5,655 bytes

install ok: channel://pear.php.net/Net_URL-1.0.15

install ok: channel://pear.php.net/Net_Socket-1.0.14

install ok: channel://pear.php.net/HTTP_Request-1.4.4

install ok: channel://pear.php.net/HTTP_Client-1.2.1

Как видим — в процессе установки говорит об устарении пакета и предлагает поставить более новый:

# pear install HTTP_Request2

WARNING: channel «pear.php.net» has updated its protocols, use «pear channel-update pear.php.net» to update

downloading HTTP_Request2-2.2.1.tgz …

Starting to download HTTP_Request2-2.2.1.tgz (109,716 bytes)

…………………….done: 109,716 bytes

downloading Net_URL2-2.2.0.tgz …

Starting to download Net_URL2-2.2.0.tgz (20,071 bytes)

…done: 20,071 bytes

install ok: channel://pear.php.net/Net_URL2-2.2.0

install ok: channel://pear.php.net/HTTP_Request2-2.2.1

Пакеты Twisted и StarPy будем ставить из исходников.

# cd /usr/src/

# wget https://pypi.python.org/packages/source/T/Twisted/Twisted-15.5.0.tar.bz2#md5=0831d7c90d0020062de0f7287530a285

# apt-get install python-starpy

# tar -xvf Twisted-15.5.0.tar.bz2

# cd Twisted-15.5.0/

# python setup.py install

Traceback (most recent call last):

File «setup.py», line 13, in <module>

import setuptools

ImportError: No module named setuptools

Выдало ошибку о недоступности пакета setuptools

Ставим его:

# wget https://bootstrap.pypa.io/ez_setup.py -O — | python

Finished processing dependencies for setuptools==19.2

Повторяем после установки соответствующего пакета

# python setup.py install

twisted/test/raiser.c:4:20: fatal error: Python.h: Нет такого файла или каталога

#include «Python.h»^

compilation terminated.

error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

Снова ругается

Применим команду на установку python с библиотеками

# apt-get install python-dev

После повторим ввод команды

# python setup.py install

Finished processing dependencies for Twisted==15.5.0

Готово!

Ну и самый главный виновник торжества. На момент написания актуальная версия — 3.0b4:

# wget http://downloads.sourceforge.net/project/monast/Monast%20for%20Asterisk%201.4%2C%201.6%20and%201.8/3.0b4/monast-3.0b4.tar.gz

# tar -xvf monast-3.0b4.tar.gz

# cd monast-3.0b4

# ./install.sh

Для Ubuntu — копируем скрипт от Debian и добавляем его в автозагрузку:

# cp contrib/init.d/rc.debian.monast /etc/init.d/monast

# chmod 755 /etc/init.d/monast

# update-rc.d monast defaults 91 60

Настроим /etc/monast.conf

[global]

# Bind client connetions on host:port

bind_host = 127.0.0.1

bind_port = 5039

# Use client autentication on browser.

#auth_required = false ; по умолчанию

auth_required = true ; Указываем что аутентификация обязательна

##

## Servers Definitions

##

[server: Amazon] # Server name can not contains space

hostname = 127.0.0.1

hostport = 5038

username = monast

password = password

# Default user context

#default_context = default ; по умолчанию

default_context = from-internal ; для FreePBX

# Context to use in transfer calls

#transfer_context = default ; по умолчанию

transfer_context = from-internal ; для FreePBX

# Context and prefix for meetme

#meetme_context = default ; по умолчанию

meetme_context = from-internal ; для FreePBX

meetme_prefix  =.

#[server: Server_2] # Server name can not contains space

#hostname = 192.168.0.2

#hostport = 5038

#username = ami_username

#password = ami_password

# Default user context

#default_context = default

# Context to use in transfer calls

T#ransfer_context = default

# Context and prefix for meetme

#meetme_context = default

#meetme_prefix  =

[user: ubuntu]

secret  = secret

roles   = originate,queue,command,spy

servers = ALL

Запуск

# /etc/init.d/monast start

Starting MonAst…                                                              [OK]

Все. Можно подключаться и проверять. Открываем браузер и в строке адреса вбиваем: http://localhost/monast/

Источники: http://habrahabr.ru/post/143053/

http://asterisk-pbx.ru/wiki/artikle/monast

Понравилась статья? Поделить с друзьями:
  • Mohw exe системная ошибка msvcp100 dll windows 10
  • Modx код 500 internal server error
  • Modx как изменить шаблон
  • Modx как изменить пароль администратора
  • Modx query error