Panda3d unable to open directx window - python-2.7

I recently installed panda3d version 1.8.1 which was termed as latest stable release.But when I typed the following code
from direct.showbase.ShowBase import ShowBase
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
app = MyApp()
app.run()
The above code generated the following error message :
:ShowBase(warning): Unable to open 'onscreen' window.
Traceback (most recent call last):
File "D:\delme.py", line 8, in <module>
app = MyApp()
File "D:\delme.py", line 6, in __init__
ShowBase.__init__(self)
File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 244, in __init__
self.openDefaultWindow(startDirect = False, props=props)
File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 880, in openDefaultWindow
self.openMainWindow(*args, **kw)
File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 916, in openMainWindow
self.openWindow(*args, **kw)
File "C:\Panda3D-1.8.1\direct\showbase\ShowBase.py", line 671, in openWindow
raise StandardError, 'Could not open window.'
StandardError: Could not open window.
Any ideas why is this happening and how do I resolve it??

I solved the problem myself.
I edited panda3d1.8.1/etc/config.txt
I changed : load-display pandadx9
to : load-display p3tinydisplay

Related

ERAlchemy cannot connect to database

I don't understand the syntax to call the render feature of ERAlchemy (https://pypi.org/project/ERAlchemy see "Usage for Python"). I am using Python 2.7, sqlite3, and PyCharm. I have ERAlchemy, GraphViz, and PyGraphViz installed.
I am trying the following, but it cannot connect to the database:
from eralchemy import render_er
render_er("sqlite:///C:\\Users\\myname\\Documents\\Work\\pythonsqlite.db", 'erd_from_sqlite.png')
And this is the error:
Traceback (most recent call last):
File "C:/Users/myname/Documents/Work/_sql_functions_rev0.py", line 81, in <module>
render_er("sqlite:///C:\\Users\\myname\\Documents\\Work\\pythonsqlite.db", 'erd_from_sqlite.png')
File "C:\Python27\ArcGISx6410.6\lib\site-packages\eralchemy\main.py", line 236, in render_er
intermediary_to_output(tables, relationships, output)
File "C:\Python27\ArcGISx6410.6\lib\site-packages\eralchemy\main.py", line 75, in intermediary_to_schema
graph.draw(path=output, prog='dot', format=extension)
File "C:\Python27\ArcGISx6410.6\lib\site-packages\pygraphviz\agraph.py", line 1474, in draw
data = self._run_prog(prog, args)
File "C:\Python27\ArcGISx6410.6\lib\site-packages\pygraphviz\agraph.py", line 1308, in _run_prog
runprog = r'"%s"' % self._get_prog(prog)
File "C:\Python27\ArcGISx6410.6\lib\site-packages\pygraphviz\agraph.py", line 1295, in _get_prog
raise ValueError("Program %s not found in path." % prog)
ValueError: Program dot not found in path.
Ah! Found the answer here
had to find the folder with "dot.exe" and add it to the environment variables -> system variables -> path

Q: Sonos Python Self Test error: No handlers could be found for logger "smapi"

I am trying to run the SONOS self test for a music service on Sonos.
After getting the dependencies, and filling out the config file, I try to run the python Sonos selftest, however it runs into an error and I have no clue what the underlying issue might be to get it running:
No handlers could be found for logger "smapi"
Traceback (most recent call last):
File "suite_selftest.py", line 226, in <module>
nightly_mode(parser.config_file)
File "suite_selftest.py", line 51, in nightly_mode
development_mode(config_file)
File "suite_selftest.py", line 186, in development_mode
fixtures.append(getlastupdate.PollingIntervalTest(suite.client, suite.smapiservice))
File "/Users/thomas/Desktop/PythonSelfTest/smapi/content_workflow/getlastupdate.py", line 20, in __init__
self.poll_interval = self.smapiservice.get_polling_interval()
File "../../sonos-1.1.0.dev_r300235-py2.7.egg/sonos/smapi/smapiservice.py", line 465, in get_polling_interval
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 362, in getfloat
return self._get(section, float, option)
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 356, in _get
return conv(self.get(section, option))
ValueError: could not convert string to float:
Found the fix already, forgot to add the Polling Interval in the config file...

Python 2.7.12, trying to build an executable file using pyinstaller. I keep getting the below error

Trying to build an executable file using pyinstaller. I keep getting the below error
Traceback (most recent call last):
File "Inventory_Computation\app.py", line 145, in <module>
File "flask\app.py", line 843, in run
File "werkzeug\serving.py", line 692, in run_simple
File "werkzeug\_reloader.py", line 248, in run_with_reloader
File "werkzeug\_reloader.py", line 129, in run
File "werkzeug\_reloader.py", line 22, in _iter_module_files
File "Lib\email\__init__.py", line 79, in __getattr__
ImportError: No module named message
Failed to execute script app
found the solution finally...
Go to "C:\Python27\Lib\email"
And find the "init.py"
Comment out below lines.
'Audio',
'Base',
'Image',
'Message',
'Multipart',
'NonMultipart',
'Text',
Try pyinstaller again

nltk lookup error in Stanford Neural Dependency Parser

I am trying to use the Stanford Neural Dependency Parser provided by nltk. The problem I'm having is that when I call st = nltk.parse.stanford.StanfordNeuralDependencyParser(), I get the following error:
>>> st = nltk.parse.stanford.StanfordNeuralDependencyParser()
Traceback (most recent call last):
File "C:\Users\<user>\Anaconda2\lib\site-packages\IPython\core\interactiveshell.py", line 2885, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-5-ca2dec4f3c1f>", line 1, in <module>
st = nltk.parse.stanford.StanfordNeuralDependencyParser()
File "C:\Users\<user>\Anaconda2\lib\site-packages\nltk\parse\stanford.py", line 378, in __init__
super(StanfordNeuralDependencyParser, self).__init__(*args, **kwargs)
File "C:\Users\<user>\Anaconda2\lib\site-packages\nltk\parse\stanford.py", line 51, in __init__
key=lambda model_name: re.match(self._JAR, model_name)
File "C:\Users\<user>\Anaconda2\lib\site-packages\nltk\internals.py", line 714, in find_jar_iter
raise LookupError('\n\n%s\n%s\n%s' % (div, msg, div))
LookupError:
===========================================================================
NLTK was unable to find stanford-corenlp-(\d+)(\.(\d+))+\.jar! Set
the CLASSPATH environment variable.
For more information, on stanford-corenlp-(\d+)(\.(\d+))+\.jar, see:
<http://nlp.stanford.edu/software/lex-parser.shtml>
===========================================================================
But, when I run os.environ.get('CLASSPATH') I get the result
`C:\nltk_data\;C:\nltk_data\stanford\;C:\nltk_data\stanford\stanford-ner\`
I know that I have the corenlp jar file in C:\nltk_data\stanford\ so I run the following and end up with a slightly different error.
>>> st = nltk.parse.stanford.StanfordNeuralDependencyParser('C:\\nltk_data\\stanford\\')
Traceback (most recent call last):
File "C:\Users\<user>\Anaconda2\lib\site-packages\IPython\core\interactiveshell.py", line 2885, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-22-28d797d702d9>", line 1, in <module>
st = StanfordNeuralDependencyParser('C:\\nltk_data\\stanford\\')
File "C:\Users\<user>\Anaconda2\lib\site-packages\nltk\parse\stanford.py", line 378, in __init__
super(StanfordNeuralDependencyParser, self).__init__(*args, **kwargs)
File "C:\Users\<user>\Anaconda2\lib\site-packages\nltk\parse\stanford.py", line 51, in __init__
key=lambda model_name: re.match(self._JAR, model_name)
File "C:\Users\<user>\Anaconda2\lib\site-packages\nltk\internals.py", line 635, in find_jar_iter
(name_pattern, path_to_jar))
LookupError: Could not find stanford-corenlp-(\d+)(\.(\d+))+\.jar jar file at C:\nltk_data\stanford\
I have downloaded the jar stanford-english-corenlp-2016-01-10-models.jar from the Stanford NLP website and also renamed it to stanford-corenlp-2016-01-10.jar to try and match the pattern but I was still end up with the same errors. I have also downloaded the Stanford Parser version 3.6.0 but it doesn't contain any corenlp files.
Is there any way to get this to work, or am I misunderstanding something?

Attempting to debug terminal applications made with Python+Blessed using ipdb breaks IPython?

I am using the Blessed library to build a simple terminal application.
My application builds upon the following simple example for a dumb editor: https://github.com/jquast/blessed/blob/master/bin/editor.py
Warning: the following steps will break your IPython, and I don't know how to fix it!
For the purposes of this question, I'll just use editor.py. Let's make a couple of changes to allow debugging:
1) import ipdb
2) put in ipdb.set_trace() on line 224
Run editor.py now: python editor.py. The following error should be produced:
Traceback (most recent call last):
File "editor.py", line 14, in <module>
from manager import Manager
File "/home/abcd/python_scripts/editor.py", line 25, in <module>
import ipdb
File "/usr/local/lib/python2.7/dist-packages/ipdb/__init__.py", line 7, in <module>
from ipdb.__main__ import set_trace, post_mortem, pm, run, runcall, runeval, launch_ipdb_on_exception
File "/usr/local/lib/python2.7/dist-packages/ipdb/__main__.py", line 47, in <module>
ipapp.initialize([])
File "<decorator-gen-110>", line 2, in initialize
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 332, in initialize
self.init_shell()
File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 348, in init_shell
ipython_dir=self.ipython_dir, user_ns=self.user_ns)
File "/usr/lib/python2.7/dist-packages/IPython/config/configurable.py", line 354, in instance
inst = cls(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py", line 328, in __init__
**kwargs
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 483, in __init__
self.init_readline()
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 1843, in init_readline
self.readline_startup_hook = readline.set_startup_hook
AttributeError: 'module' object has no attribute 'set_startup_hook'
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev#scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
c.Application.verbose_crash=True
Now, whenever one runs IPython by executing the ipython command, this error will be produced:
Traceback (most recent call last):
File "/usr/bin/ipython", line 5, in <module>
start_ipython()
File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 564, in launch_instance
app.initialize(argv)
File "<decorator-gen-110>", line 2, in initialize
File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 332, in initialize
self.init_shell()
File "/usr/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line 348, in init_shell
ipython_dir=self.ipython_dir, user_ns=self.user_ns)
File "/usr/lib/python2.7/dist-packages/IPython/config/configurable.py", line 354, in instance
inst = cls(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.py", line 328, in __init__
**kwargs
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 483, in __init__
self.init_readline()
File "/usr/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 1843, in init_readline
self.readline_startup_hook = readline.set_startup_hook
AttributeError: 'module' object has no attribute 'set_startup_hook'
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev#scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
c.Application.verbose_crash=True
So, IPython seems to be globally broken. I have gotten this issue on both Cygwin and Ubuntu.
What's going wrong?