Error running twisted application - python

I am trying to run a simple twisted application echo bot that metajack blogged about, everything looks like it is going to load fine, but at the very end I get an error:
2009/07/12 15:46 -0600 [-] ImportError: cannot import name toResponse
2009/07/12 15:46 -0600 [-] Failed to load application: cannot import name toResponse
Any ideas on what might be causing this?
I've not played with wokkel/twisted/python at all and dont know where to start to look.
It is worth nothing that I've tried another wokkel/twisted app and got this very same error.

This error is caused because I have an outdated version of Twisted. Off to find a way to update twisted itself as the installer doesnt seem to be doing the trick.

There's not really enough information to go on, but if I had to guess, I'd say that you've given your program the same name as one of the modules that it relies on. Try renaming it to anthonys_echo_bot.py and re-running it. Do this:
rm *.pyc
in the directory in which you're running it first.
If that doesn't help, you'll need to track down the piece of code that's trying import toResponse - is that all the error you get? No traceback, pointing to lines of code?

Related

Cannot find module "qfi" for running JdeRobot drone_cat_mouse exercise from source

I want to run JdeRobot drone_cat_mouse on my Ubuntu 20.04. I'm using ROS Noetic and has faithfully followed these installation instructions. Everything it told me to test was working properly.
When I first ran roslaunch drone_cat_mouse.launch, there was an import error for teleopWidget and sensorsWidget which I fixed by using relative imports. Then I had an error No module named qfi.
Unlike teleopWidget and sensorsWidget, I couldn't find the qfi module in the JdeRobot/drones source code. So I googled it, and the only relevant result that popped up was this, which led to this link. They said to:
sudo touch /usr/lib/python2.7/dist-packages/qfi/__init__.py
But I ran that command and this happened!
Not even pip has a "qfi" module!
So I thought to check JdeRobot's entire repository. Turns out it was in JdeRobot/base, and that repo is not maintained anymore!
After further digging, there was this issue which basically tells us forget about it and move to the web release! But I can't, circumstances forced me to use the source code option (deliverables are drone_cat_mouse.world and my_solution.py, it's impossible for me to get the former in the docker web version and the latter's format is different between the source code version and the web version).
In a nutshell, how do I fix this qfi module problem so that I can run the exercises from source like these people?
I'm just stupid, as usual. all I need to do was clone https://github.com/JdeRobot/ThirdParty, get the qfi module, copy it to
~/catkin_ws/src/drones/rqt_drone_teleop/src/rqt_vel_teleop/ and replace all qfi imports with its relative import version. All common sense
No errors in terminal, gazebo runs, but somehow the rqt widget for drone vision never appears.
Forget it, I'm giving up on this dumpster fire of a program.
Edit: I did another fresh install, followed the steps, noticed troubleshooting for qfi which required qmake, but same end result
If you're trying to launch drone_cat_mouse there is an issue with the namespace of the RQT widget that occurs when you try to launch it.
Namely, the topics that exist for drone_cat_mouse are prefixed by cat/ or mouse/. But RQT will try to access these topics without the prefix and run into an error. Alternatively, since you have a local install, you can try to run the code manually by running
python my_solution.py
Just make sure the change the area where the DroneWrapper class was called in the following manner:
HAL = DroneWrapper('drone', 'cat/')
Here 'drone' is the name of the node you are creating and 'cat/' is the namespace given to the DroneWrapper Class.

ImportError: No module named psycopg2.extensions

I am trying to create an app using GeoDjango and I am completely new to this. After some (failing) attempts at making SpatiaLite work, I decided to try out PostgreSQL. I am following the GeoDjango tutorial, and I am stuck at the python manage.py sqlall world line. When I ran that command (or python manage.py syncdb), I got ImportError: No module named psycopg2.extensions. I looked online and realized I needed to install psycopg2, which I did via MacPorts with sudo port install py27-psycopg2. I reran the program and got the same error. I restarted my computer and ran the program again, and still got the same error. Does anyone know anything else that might have caused this?
Thanks!
PS. If anyone cared to know, I was stuck at the same command while testing out SpatiaLite. I consistently received the 'DatabaseOperations' object has no attribute 'geo_db_type'error. I looked around the internet, didn't find any answer and decided to move on for the time being and maybe try again later.
PSS. I am working on Mac OS X 10.7.5

"No handler found" while loading OpenERP 7 on localhost

I have been working on a custom module of OpenERP 7 on localhost:8069, but today when I try to load the OpenERP7 on localhost it is giving me the error "no handler found". I dont' understand the problem because db postgresql is working fine. I'd rather not reinstall the application.
Check with openerp-server.log. it's generally caused when your server is unable to start properly. Reason could be anything, any buggy module, missing library etc.
I simply replaced the addons folder and it worked for me i suspect there are modules i had installed that had bugs

Python ImportError (Cannot import name Variables)

I have done some research on this question and nothing seems to fix it, I suspect I may be accidentally circularly importing somewhere, but this one has stumped me.
This package is a Python IRC Service framework. The issue occurs when dynamically loading a module (via imp.load_source()), and the new module tries to import something from the src folder (Variables.py). It fails with "Cannot import name Variables", yet, it imports another module from the same directory without complaint.
Here is the specific error:
**ERROR: ModLoad(): Unable to load module
/home/sam/workspace/Affinity/bin/../modules/ircd_affinity.py:
cannot import name Variables
**
This is the full file for modules/ircd_affinity.py: ircd_affinity.py, and src/Variables.py: Variables.py
If it helps. browse the entire repository... this (https://github.com/miniCruzer/Affinity/blob/master/src/Affinity.py) module (starting at line 123) loads modules.
I would appreciate if all responses were kept relevant to the specific issue at hand. Yes, it may be tempting to suggest other things I'm doing wrong or otherwise throughout the entire package - I am welcome to suggestions: please e-mail them to me.
Show the full traceback. Look through it for evidence of (attempted) circular import.
Run Python with the -v option ... what does that tell you?
Look at the contents of sys.path and sys.modules just before the error happens.
"**ERROR: ModLoad(): Unable to ..." doesn't look line a Python-raised error. Is that in your code? If so, dig deeper; why is it raised?

Mod_Python + Django library import issue

I recently had a site that was running perfect for months, all of a sudden it decided to dump itself for no approximate reason.
I am running django + mod_python + apache, and the system decided it was time to start ignoring the import of the pycurl library, my intial first thought was that somehow the library had become corrupted, or the paths were uncached by apache or mod_python.
After checking the paths, symbolic links, permissions and reinstalling the exact build of pycurl I am still recieving the same error. The strange thing is, is that I can load the library within python itself and run tests with no issues, but not within mod_python. I know for a fact that the paths are correctly pointed as I have checked them numerous times and updated the system cache accordingly.
Django now will not load or throw any errors, nor will apache log anything if I try and import the library it will just silently fail... I have been exploring this issue for 2 days now and have not come up with anything.
Any help would be greatly appreciated.
Just to add some here, the server has not been touched in any way since the final revision and launch.
I have checked every log that would indicate some type of attack against the server and there is nothing, the only thing that exists is request from my hosting provider which is where the error in question first started to appear.
Also the similar issue: stackoverflow.com/questions/1099981/… - does not work in this case.
Incase anyone is wondering the versions are as follows
Python 2.4.3
Mod_Python 3.2.8
Apache 2.2.3
Redhat Red Hat Enterprise Linux Server release 5.4
Linux Kernal 2.6.18-128.7.1.el5 x86_64
If the problem is a failing import when running under Apache but the import works when running from your login shell, double-check that there isn't a directory/file permission problem with the failing module(s). They must be read-accessible and in some cases also execute-accessible from the user id that Apache is running under.
The httpd process could be running into the open file limit; see help ulimit in bash for the relevant option to change.
Well now ... I have debugged this issue ... and the answer is quite surprising.
R**kspace decided to do a few updates to the box, updating the dependent library in question and it caused the issues ... after reinstalling the library it would try to load the c module and it was not a comp version with the current pycurl ... and they couldn't figure this out themselves for 2 days.

Categories

Resources