No module named autobahn.twisted.websocket - openfaces

./demos/web/start-servers.sh
Traceback (most recent call last):
File "./demos/web/websocket-server.py", line 25, in <module>
from autobahn.twisted.websocket import WebSocketServerProtocol, \
ImportError: No module named autobahn.twisted.websocket
but I is already installed like this:
pip install twisted
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Requirement already satisfied: twisted in /usr/lib/python2.7/dist-packages (16.0.0)
But why?please...

The Traceback tells you all you need. You are missing autobahn.twisted.websockets. So basically the first thing you need is the autobahn package. Also you will need twisted. So do the following to install it.
pip install autobahn twisted

Related

from _curses import * ModuleNotFoundError: No module named '_curses

This is the error I am getting:
Traceback (most recent call last):
File "c:\Users\brook\python_practice\snake.py", line 1, in
import curses
File "C:\Users\brook\AppData\Local\Programs\Python\Python310\lib\curses_init_.py", line 13, in
from _curses import *
ModuleNotFoundError: No module named '_curses'
I tried pip install windows-curses and a few other things I found on stack overflow, nothing has worked.
I'm using VSCode.

Installing ZPsycopgDA on Zope

So, I'm trying to install ZPsycopgDA on Zope, but it keeps giving me the following error on the log file:
2022-02-13T02:11:01 ERROR Application Couldn't install ZPsycopgDA
Traceback (most recent call last):
File "/home/rubens/zope/lib64/python2.7/site-packages/OFS/Application.py", line 660, in install_product
global_dict, global_dict, silly)
File "/home/rubens/zope/instance/Products/ZPsycopgDA/__init__.py", line 21, in <module>
import DA
File "/home/rubens/zope/instance/Products/ZPsycopgDA/DA.py", line 21, in <module>
import db
File "/home/rubens/zope/instance/Products/ZPsycopgDA/db.py", line 18, in <module>
from Shared.DC.ZRDB.TM import TM
ImportError: No module named ZRDB.TM
I added the Zope lib directory to PYTHONPATH (/home/rubens/zope/lib64) as instructed, but still gives me this error. Any clues? I'm using Zope2==2.13.30.
Found the solution. Had to install Products.ZSQLMethods (pip install Products.ZSQLMethods==2.13.4). I've installed this version because of Zope2==2.13.30 compatibility.

Wagtailtrans 2.2 install fails

I've read all the tutorials for setting up wagtailtrans 2.2.
I set the languages in my base.py according to the tutorials. I cannot install wagtailtrans. I get error output about Pillow.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/2f/rfv6v0056c58r9w83rzw30n00000gn/T/pip-install-yn4w0un0/pillow_5e7e668306de465dbfb8730b888585f9/setup.py", line 918, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
I tried to reinstall Pillow according to their docs and reinstall wagtailtrans but it doesn't work. The error doesn't mention anything about wagtailtrans but when I go to makemigrations I get the error ModuleNotFoundError: No module named 'wagtailtrans'
I haven't found anything online about this so any help would be most appreciated. Sorry if this is a N00b question
If you're on a Mac, install Xcode tools, amongst other useful libraries, it will also bring the missing zlib. To install Xcode tools, run the following command in a terminal:
xcode-select --install

create_task = asyncio.async: SyntaxError: invalid syntax

I'm creating a bot for Discord, and I just wrote this simple code:
import discord
TOKEN = "token"
client = discord.Client()
#client.event
async def on_ready():
print('Bot is ready.')
client.run(TOKEN)
and it produces the following error:
Traceback (most recent call last):
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/Main.py", line 1, in <module>
import discord
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/__init__.py", line 20, in <module>
from .client import Client, AppInfo, ChannelPermissions
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/client.py", line 38, in <module>
from .state import ConnectionState
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/state.py", line 36, in <module>
from . import utils, compat
File "/Users/pcaires/Desktop/Programação/Python/Discord Bots/venv/lib/python3.7/site-packages/discord/compat.py", line 32
create_task = asyncio.async
^
SyntaxError: invalid syntax
I searched and searched in the internet, and most of the people say to use Python 3.7, and that's what I've been using. Also, I've been using PyCharm as my IDE for Python.
Where does the error come from?
The version of discord.py you are using does not support Python 3.7 (in which async becomes a reserved keyword), as explained in this issue.
This version of discord.py, which is the default branch on the GitHub repo, is sadly the one installed by Pip.
How to fix it
You can either:
downgrade your version of Python to 3.6.
install another version of discord.py, based on the rewrite branch which is under active development, for example with the command : python3 -m pip install --user -U https://github.com/Rapptz/discord.py/archive/rewrite.zip
You can manually edit the file and change that line from create_task = asyncio.async to create_task = getattr(asyncio, 'async')
See more info here: https://github.com/Rapptz/discord.py/issues/1249
Do NOT add asyncio in your requirements, it's already in Python (since 3.5).
It is only relevant for Python 3.3, which does not include asyncio in its stdlib.
As a quick fix you can change asyncio.async to asyncio.ensure_future in the installed offending module and run it. Obviously the right thing to do is get the module updated, but when that's not possible the above will get it running again.
fix it with
pip install --upgrade aiohttp
pip install --upgrade websockets

SOAPpy installation error

Hi i was trying to install SOAPpy module on my mac for python......
i installed xml and fpconst and tried installing this SOAPpy module, but i was getting the error... as below:
venj:SOAPpy-0.12.0 venkata$ python setup.py build
Traceback (most recent call last):
File "setup.py", line 8, in
from SOAPpy.version import version
File "/Applications/SOAPpy-0.12.0/SOAPpy/init.py", line 5, in
from Client import *
File "/Applications/SOAPpy-0.12.0/SOAPpy/Client.py", line 46
from future import nested_scopes
SyntaxError: from future imports must occur at the beginning of the file
venj:SOAPpy-0.12.0 venkata$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 8, in
from SOAPpy.version import version
File "/Applications/SOAPpy-0.12.0/SOAPpy/init.py", line 5, in
from Client import *
File "/Applications/SOAPpy-0.12.0/SOAPpy/Client.py", line 46
from future import nested_scopes
SyntaxError: from future imports must occur at the beginning of the file
Hey please suggest me how to solve this error.
Had the same problem.
You have to "future import" to the beginning of everyfile where it's stated.
There should be a patch for that.
That looks like a bug in SOAP.py from future must be at the beginning of the file SOAP.py bug see python language docs

Resources