Anaconda not letting me launch Spyder: MacOS - python

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

Related

CXFreeze: python code with PyFiglet module occurs TypeError

if I use the Figlet class of the PyFiglet (PyPi) module in a python code, freeze it with CXFreeeze (PyPi) and run it a TypeError occurs.
Example code
from pyfiglet import Figlet
Figlet()
Error that occured
Traceback (most recent call last):
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 120, in run
module_init.run(name + "__main__")
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\Lib\site-packages\cx_Freeze\initscripts\Console.py", line 16, in run
exec(code, module_main.__dict__)
File "C:\Users\MrAnonymous\Desktop\main.py", line 3, in <module>
Figlet()
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 794, in __init__
self.setFont()
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 801, in setFont
self.Font = FigletFont(font=self.font)
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 126, in __init__
self.data = self.preloadFont(font)
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pyfiglet\__init__.py", line 136, in preloadFont
if pkg_resources.resource_exists('pyfiglet.fonts', fn):
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1131, in resource_exists
return get_provider(package_or_requirement).has_resource(resource_name)
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 360, in get_provider
return _find_adapter(_provider_factories, loader)(module)
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\site-packages\pkg_resources\__init__.py", line 1390, in __init__
self.module_path = os.path.dirname(getattr(module, '__file__', ''))
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\ntpath.py", line 223, in dirname
return split(p)[0]
File "C:\Users\MrAnonymous\AppData\Local\Programs\Python\Python39\lib\ntpath.py", line 185, in split
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Generate Error
Create a python file with the code shown above: main.py
Freeze it with CXFreeze in CMD: cxfreeze -c "main.py"
Run it in CMD: main.exe

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

Using PyGreSQL: 'bytes' object has no attribute 'encode'

I'm trying to import PyGreSQL in Python. I've successfully installed it with pip, and also have GLFW3 installed, but I run into the following error when I import
>>> import pg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/py
thon3.5/site-packages/pg/__init__.py", line 1, in <module>
from .core import (
File "//anaconda/lib/python3.5/site-packages/pg/core.py", line 6, in <module>
from . import glfw
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 138, in <module>
['', '/usr/lib', '/usr/local/lib'], _glfw_get_version)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 74, in _load_library
version = version_check_callback(filename)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 130, in _glfw_get_version
out = process.communicate(_to_char_p(filename))[0]
File "//anaconda/lib/python3.5/subprocess.py", line 801, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "//anaconda/lib/python3.5/subprocess.py", line 1428, in _communicate
self._save_input(input)
File "//anaconda/lib/python3.5/subprocess.py", line 1501, in _save_input
self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'>>> import pg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python3.5/site-packages/pg/__init__.py", line 1, in <module>
from .core import (
File "//anaconda/lib/python3.5/site-packages/pg/core.py", line 6, in <module>
from . import glfw
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 138, in <module>
['', '/usr/lib', '/usr/local/lib'], _glfw_get_version)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 74, in _load_library
version = version_check_callback(filename)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 130, in _glfw_get_version
out = process.communicate(_to_char_p(filename))[0]
File "//anaconda/lib/python3.5/subprocess.py", line 801, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "//anaconda/lib/python3.5/subprocess.py", line 1428, in _communicate
self._save_input(input)
File "//anaconda/lib/python3.5/subprocess.py", line 1501, in _save_input
self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'
What can I do to fix this and get PyGreSQL working?

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

Categories

Resources