Python-uniconvertor: error converting cdr documents - python

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

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

Is there a way to copy a string to clipboard that works on any operating system/device?

Goal: copy a string to clipboard using Python on Android Linux 11
I tried pyperclip but it doesn't work on Linux yet.
import pyperclip
pyperclip.copy("Hello World")
Error:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 3, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pyperclip/__init__.py", line 659, in lazy_load_stub_copy
return copy(text)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pyperclip/__init__.py", line 336, in __call__
raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException:
Pyperclip could not find a copy/paste mechanism for your system.
For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error
I also tried pandas but it didn't work too (code from https://stackoverflow.com/a/41191377/15754341)
import pandas as pd
df = pd.DataFrame("Hello World")
df.to_clipboard(index = False, header = False)
Error:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 3, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pandas/core/generic.py", line 2785, in to_clipboard
clipboards.to_clipboard(self, excel=excel, sep=sep, **kwargs)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pandas/io/clipboards.py", line 123, in to_clipboard
clipboard_set(text)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pandas/io/clipboard/__init__.py", line 627, in lazy_load_stub_copy
copy, paste = determine_clipboard()
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pandas/io/clipboard/__init__.py", line 525, in determine_clipboard
with open("/proc/version", "r") as f:
PermissionError: [Errno 13] Permission denied: '/proc/version'
Question: Is there a universal method to copy a string to clipboard that would work on any operating system and device?

Error when trying example Autocad usage

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

distutils.dir_util.copy_tree expects a file in destination before copying

I want to copy the contents of one directory to another, using copy_tree function for doing this. Below is my code:
copy_tree('/opt/Deployment/scripts/image', '/opt/Deployment/dist-packages/job-123')
A couple of files from the directory image are getting copied into job-123, but after that, I get this error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 305, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 535, in _handle_call
return self._local_objects[oid](*args, **dict(kwargs))
File "/usr/local/lib/python2.7/dist-packages/rpyc/core/service.py", line 157, in exposed_execute
execute(text, self.exposed_namespace)
File "<string>", line 2, in execute
File "<string>", line 5, in <module>
File "../installModel.py", line 17, in <module>
copy_tree('/opt/Deployment/scripts/image', '/opt/Deployment/dist-packages/job-123')
File "/usr/lib/python2.7/distutils/dir_util.py", line 163, in copy_tree
verbose=verbose, dry_run=dry_run))
File "/usr/lib/python2.7/distutils/dir_util.py", line 167, in copy_tree
dry_run=dry_run)
File "/usr/lib/python2.7/distutils/file_util.py", line 148, in copy_file
_copy_file_contents(src, dst)
File "/usr/lib/python2.7/distutils/file_util.py", line 44, in _copy_file_contents
fdst = open(dst, wb)
IOError: [Errno 2] No such file or directory: /opt/Deployment/dist-packages/job-123/lib/utils.pyc
Now this file utils.pyc is in the source directory in the lib subdirectory, it should get copied to the same subdirectory in the destination. Why is copy_tree expecting it to be there already and throwing an error?

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