Error when trying example Autocad usage - python

My autocad object has created well but getting error on acad.prompt(). Following is the error:
acad.prompt("Hello")
Hello
Traceback (most recent call last):
File "", line 1, in
File "c:\users\snehal\appdata\local\temp\easy_install-lipjer\pyautocad-0.2.0-py2.7-win32.egg.tmp\pyautocad\api.py", line 162, in prompt
File "c:\users\snehal\appdata\local\temp\easy_install-lipjer\pyautocad-0.2.0-py2.7-win32.egg.tmp\pyautocad\api.py", line 74, in doc
File "c:\users\snehal\appdata\local\temp\easy_install-lipjer\pyautocad-0.2.0-py2.7-win32.egg.tmp\pyautocad\api.py", line 63, in app
File "C:\Python27\lib\site-packages\comtypes-1.1.3-py2.7.egg\comtypes\client_init_.py", line 173, in GetActiveObject
clsid = comtypes.GUID.from_progid(progid)
File "C:\Python27\lib\site-packages\comtypes-1.1.3-py2.7.egg\comtypes\GUID.py", line 78, in from_progid
_CLSIDFromProgID(unicode(progid), byref(inst))
File "_ctypes/callproc.c", line 950, in GetResult
WindowsError: [Error -2147221005] Invalid class string

Related

Anaconda not letting me launch Spyder: MacOS

This is the error I get
Traceback (most recent call last):
File "/opt/anaconda3/bin/spyder", line 11, in
sys.exit(main())
File "/opt/anaconda3/lib/python3.9/site-packages/spyder/app/start.py", line 233, in main
from spyder.app import mainwindow
File "/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 42, in
requirements.check_qt()
File "/opt/anaconda3/lib/python3.9/site-packages/spyder/requirements.py", line 47, in check_qt
if parse_version(actual_ver) File "/opt/anaconda3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 121, in parse_version
return packaging.version.Version(v)
File "/opt/anaconda3/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object

Pyinstaller subprocess exception When running on windowed mode

I'm using pyinstaller to create my application.In my django app, I'm using subprocess. When i execute pyinstaller in noconsole mode its throwing errors.
Error log:
Traceback (most recent call last):
File "site-packages\django\core\handlers\base.py", line 149, in get_response
File "site-packages\django\core\handlers\base.py", line 147, in get_response
File "crumbs_tableau\views.py", line 1603, in parser
File "site-packages\django\shortcuts.py", line 67, in render
File "site-packages\django\template\loader.py", line 96, in render_to_string
File "site-packages\django\template\loader.py", line 43, in get_template
django.template.exceptions.TemplateDoesNotExist: helpers/error.html
Internal Server Error: /
Traceback (most recent call last):
File "crumbs_tableau\views.py", line 286, in parser
File "crumbs_tableau\views.py", line 248, in mac_list
File "subprocess.py", line 336, in check_output
File "subprocess.py", line 403, in run
File "subprocess.py", line 667, in __init__
File "subprocess.py", line 905, in _get_handles
File "subprocess.py", line 955, in _make_inheritable
OSError: [WinError 6] The handle is invalid
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages\django\core\handlers\base.py", line 149, in get_response
File "site-packages\django\core\handlers\base.py", line 147, in get_response
File "crumbs_tableau\views.py", line 1603, in parser
File "site-packages\django\shortcuts.py", line 67, in render
File "site-packages\django\template\loader.py", line 96, in render_to_string
File "site-packages\django\template\loader.py", line 43, in get_template
django.template.exceptions.TemplateDoesNotExist: helpers/error.html
Not Found: /static/parser/bootstrap.css.map
You need to define stdin and stderr when calling a subprocess in windowed mode.
Example:
p = subprocess.Popen(["netstat", "-a", "-n", "-o"], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL)
This is because windows tries to duplicate these handles if they're not set to null.

Robot Frame work: Error While running .robot file in python interpreter using robot.run (windows environment)

I am trying to execute Run_Keyword.robot made with RIDE file which is in directory 'Robot' from python interpreter and getting following error. I am able to run this .py file from cmd without any error and it gives expected results. What can be the reason for this. I am a newbie to Robot Framework. Please help with this.
from robot import run
run('C:\\Users\\uvijayac\\Desktop\\Robot')
The Error I am getting is as follows.
Traceback (most recent call last):
File "C:\Users\uvijayac\Desktop\Robot\rf.py", line 27, in <module>
run_tests()
File "C:\Users\uvijayac\Desktop\Robot\rf.py", line 23, in run_tests
report=report_file)
File "C:\Python27\lib\site-packages\robot\run.py", line 471, in run
return RobotFramework().execute(*datasources, **options)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 83, in execute
return self._execute(list(arguments), options)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 89, in _execute
return self._report_error(unicode(err), help=True)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 110, in _report_error
self._logger.error(message)
File "C:\Python27\lib\site-packages\robot\output\loggerhelper.py", line 59, in error
self.write(msg, 'ERROR')
File "C:\Python27\lib\site-packages\robot\output\loggerhelper.py", line 62, in write
self.message(Message(message, level, html))
File "C:\Python27\lib\site-packages\robot\output\logger.py", line 109, in message
logger.message(msg)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 66, in message
self._writer.error(msg.message, msg.level, clear=self._running_test)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 142, in error
self._highlight('[ ', level, ' ] ' + message, error=True)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 158, in _highlight
self._write(before, newline=False, error=error)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 154, in _write
stream.flush()
IOError: [Errno 9] Bad file descriptor
>>>

Python-uniconvertor: error converting cdr documents

I am trying to use Python-uniconvertor for converting cdr documents to pdf documents. But it is giving me an error. I am on Ubuntu 14.04.
$ uniconvertor CDIP_6.cdr CDIP.pdf
Cannot list directory /home/rashmi/.uniconvertor:[Errno 2] No such file or directory: '/home/rashmi/.uniconvertor'
ignoring it in font_path
Cannot list directory /home/rashmi/.uniconvertor:[Errno 2] No such file or directory: '/home/rashmi/.uniconvertor'
ignoring it in font_path
Cannot load plugin module cgmloader
Traceback (most recent call last):
File "/usr/lib/python2.7/dist- packages/uniconvertor/app/plugins/plugins.py", line 73, in load_module
desc)
File "/usr/lib/python2.7/dist- packages/uniconvertor/app/plugins/Filters/cgmloader.py", line 336, in <module>
init.text.fontindex = fntlst.index("Times-Roman")
ValueError: 'Times-Roman' is not in list
When importing plugin cgmloader
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/uniconvertor/app/plugins/plugins.py", line 147, in __call__
module = self.load_module()
File "/usr/lib/python2.7/dist-packages/uniconvertor/app/plugins/plugins.py", line 73, in load_module
desc)
File "/usr/lib/python2.7/dist-packages/uniconvertor/app/plugins/Filters/cgmloader.py", line 336, in <module>
init.text.fontindex = fntlst.index("Times-Roman")
ValueError: 'Times-Roman' is not in list
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/uniconvertor/__init__.py", line 82, in uniconv
doc = load.load_drawing(input_file)
File "/usr/lib/python2.7/dist-packages/uniconvertor/app/io/load.py", line 364, in load_drawing
return load_drawing_from_file(file, filename)
File "/usr/lib/python2.7/dist-packages/uniconvertor/app/io/load.py", line 325, in load_drawing_from_file
loader = info(file, filename, match)
File "/usr/lib/python2.7/dist-packages/uniconvertor/app/plugins/plugins.py", line 154, in __call__
'message':self.class_name})
app.events.skexceptions.SketchError: Cannot load filter cgmloader.CGMLoader

web2py Exception in sql rows

when i do the following code:
family_members =db(db.member.id == membership_id).select
(db.member.name,db.member.id)
family_members.colnames = ('Name','Membership ID')
It cause the following error...
Traceback (most recent call last):
File "/home/abeer/Desktop/web2py/New_version/web2py_src/web2py/gluon/
restricted.py", line 184, in restricted
File "/home/abeer/Desktop/resources/web2py/New_version/web2py_src/
web2py/applications/init/views/default/updateMember.html", line 142,
in <module>
File "/home/abeer/Desktop/web2py/New_version/web2py_src/web2py/gluon/
globals.py", line 112, in write
File "/home/abeer/Desktop/web2py/New_version/web2py_src/web2py/gluon/
html.py", line 103, in xmlescape
File "/home/abeer/Desktop/web2py/New_version/web2py_src/web2py/gluon/
sql.py", line 3326, in xml
File "/home/abeer/Desktop/web2py/New_version/web2py_src/web2py/gluon/
sqlhtml.py", line 980, in __init__
File "/home/abeer/Desktop/web2py/New_version/web2py_src/web2py/gluon/
sql.py", line 621, in __getattr__
KeyError: '_extra'
P.S. : when i commented the line (family_members.colnames = ('Name','Membership ID')), it works fine, but I don't understand why.
Do not use colnames. That attribute is internal to web2py. Use db.table.field.label='..' or SQLTABLE(rows, headers={...}) depending on what you need.

Categories

Resources