vboxapi COM API not working - python

I have the virtualbox 5.0.10 Python sdk in my source root, but when I run my code the program will fail:
Traceback (most recent call last):
File "C:/Users/xiao/.PyCharm50/config/scratches/scratch", line 2, in <module>
mgr=vboxapi.VirtualBoxManager()
File "C:\Users\xiao\Desktop\test\vboxapi\__init__.py", line 1018, in __init__
self.platform = PlatformMSCOM(dPlatformParams)
File "C:\Users\xiao\Desktop\test\vboxapi\__init__.py", line 513, in __init__
win32com.client.gencache.EnsureDispatch('VirtualBox.Session')
File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 540, in EnsureDispatch
disp_class = CLSIDToClass.GetClass(str(disp_clsid))
File "C:\Python27\lib\site-packages\win32com\client\CLSIDToClass.py", line 46, in GetClass
return mapCLSIDToClass[clsid]
KeyError: '{7844AA05-B02E-4CDD-A04F-ADE4A762E6B7}'
Here is my code: (really simple, right?)
import vboxapi
mgr=vboxapi.VirtualBoxManager()
This program is buggy under Python 2.7.6, but runabble under Python 3.4.0.
Why? How can I fix that?

Related

Problems with let otree devserver run

I have a Python Code to conduct an experiment. To ensure that the Code is working smoothly I wanted to run a trial round via 'otree devserver', but I always get an AttributeError message and I am stuck here. Can anyone help me out?
I have downloaded the Code from GitHub and downloaded all required packages. I am using macOS, otree-5.10.2 and django-4.1.7. Here is my full traceback / error message:
Traceback (most recent call last): File
"/Users/.otreevenv/bin/otree", line 8, in
sys.exit(execute_from_command_line()) File "/Users/.otreevenv/lib/python3.10/site-packages/otree/main.py", line
108, in execute_from_command_line
setup() File "/Users/.otreevenv/lib/python3.10/site-packages/otree/main.py", line
132, in setup
from otree import settings File "/Users/.otreevenv/lib/python3.10/site-packages/otree/settings.py",
line 50, in
OTREE_APPS = get_OTREE_APPS(settings.SESSION_CONFIGS) File "/Users/.otreevenv/lib/python3.10/site-packages/django/conf/__init__.py",
line 94, in __getattr__
val = getattr(_wrapped, name) File "/Users/.otreevenv/lib/python3.10/site-packages/django/conf/__init__.py",
line 270, in __getattr__
return getattr(self.default_settings, name) AttributeError: module 'django.conf.global_settings' has no attribute 'SESSION_CONFIGS'. Did
you mean: 'SESSION_ENGINE'?

Vpython on Raspberry Pi 4b

i bought a rapberry pi 4 to code, i know is not the best platform, but recently my computer got stolen and its all i can afford right know.
im trying to get vpython to run.
these is the code that im trying to run
import vpython
ball=vpython.sphere()
while True:
pass
but it gives me these error.
Traceback (most recent call last):
File "/home/maviles/Documents/py-course/Vputhon/vppython.py", line 2, in <module>
ball=vpython.sphere()
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1172, in __init__
super(sphere, self).setup(args)
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 599, in setup
super(standardAttributes, self).__init__()
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 259, in __init__
from .no_notebook import _
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/no_notebook.py", line 12, in <module>
from autobahn.asyncio.websocket import WebSocketServerProtocol, WebSocketServerFactory
File "/home/maviles/.local/lib/python3.9/site-packages/autobahn/asyncio/__init__.py", line 32, in <module>
from autobahn.asyncio.websocket import \
File "/home/maviles/.local/lib/python3.9/site-packages/autobahn/asyncio/websocket.py", line 36, in <module>
from autobahn.util import public, hltype
File "/home/maviles/.local/lib/python3.9/site-packages/autobahn/util.py", line 49, in <module>
from OpenSSL import SSL
File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1556, in <module>
class X509StoreFlags(object):
File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 1577, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
exit
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 22, in Exit
a = 1.0/zero
ZeroDivisionError: float division by zero
Exception ignored in: <function standardAttributes.__del__ at 0x7f93664550>
Traceback (most recent call last):
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 1159, in __del__
super(standardAttributes, self).__del__()
File "/home/maviles/.local/lib/python3.9/site-packages/vpython/vpython.py", line 340, in __del__
cmd = {"cmd": "delete", "idx": self.idx}
AttributeError: 'sphere' object has no attribute 'idx'
please help.
i could not find anything on these topic for the raspberry 4b
i try to run the code and expec it to open a window with a sphere

torchfile.T7ReaderException

I'm working on Windows 10. I get this issue:
DATAPATH: ../data/coco/test/val_captions.t7
Traceback (most recent call last):
File "main.py", line 77, in <module>
algo.sample(datapath, cfg.STAGE)
File "D:\documenti\Monica\StackGAN-Pytorch\code\trainer.py", line 243, in sample
t_file = torchfile.load(datapath)
File "C:\Users\Utente\venv\lib\site-packages\torchfile.py", line 424, in load
return reader.read_obj()
File "C:\Users\Utente\venv\lib\site-packages\torchfile.py", line 386, in read_obj
v = self.read_obj()
File "C:\Users\Utente\venv\lib\site-packages\torchfile.py", line 386, in read_obj
v = self.read_obj()
File "C:\Users\Utente\venv\lib\site-packages\torchfile.py", line 414, in read_obj
"unknown object type / typeidx: {}".format(typeidx))
torchfile.T7ReaderException: unknown object type / typeidx: -1112529805
Can anyone help me?
I installed python 3.6.8, pytorch, torchfile, torchvision, etc., and I'm working on virtualenv.

Error when trying to compile chromium on Ubuntu 14.04

I am following this link to compile Chromium Browser and I successfully walked through each step but I get the following error at the 17th step: gclient sync:
mrgrj#mrgrj:~/chromium/buildhost/src$ gclient sync
Syncing projects: 4% ( 3/72) src/chrome/tools/test/reference_build/chrome_linSyncing projects: 5% ( 4/72) src/sdch/open-vcdiff Syncing projects: 100% (75/75), done.
________ running '/usr/bin/python src/build/landmines.py' in '/home/mrgrj/chromium/buildhost'
________ running '/usr/bin/python src/build/download_nacl_toolchains.py --mode nacl_core_sdk sync --extract' in '/home/mrgrj/chromium/buildhost'
Traceback (most recent call last):
File "src/build/download_nacl_toolchains.py", line 59, in <module>
sys.exit(Main(sys.argv[1:]))
File "src/build/download_nacl_toolchains.py", line 29, in Main
import package_version
File "/home/mrgrj/chromium/buildhost/src/native_client/build/package_version/package_version.py", line 40, in <module>
import argparse
ImportError: No module named argparse
Traceback (most recent call last):
File "/home/mrgrj/chromium/depot_tools/gclient.py", line 2313, in <module>
sys.exit(main(sys.argv[1:]))
File "/home/mrgrj/chromium/depot_tools/gclient.py", line 2299, in main
return dispatcher.execute(OptionParser(), argv)
File "/home/mrgrj/chromium/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/home/mrgrj/chromium/depot_tools/gclient.py", line 2056, in CMDsync
ret = client.RunOnDeps('update', args)
File "/home/mrgrj/chromium/depot_tools/gclient.py", line 1528, in RunOnDeps
self.RunHooksRecursively(self._options)
File "/home/mrgrj/chromium/depot_tools/gclient.py", line 983, in RunHooksRecursively
hook, cwd=self.root.root_dir, always=True)
File "/home/mrgrj/chromium/depot_tools/gclient_utils.py", line 293, in CheckCallAndFilterAndHeader
return CheckCallAndFilter(args, **kwargs)
File "/home/mrgrj/chromium/depot_tools/gclient_utils.py", line 538, in CheckCallAndFilter
rv, args, kwargs.get('cwd', None), None, None)
File "/home/mrgrj/chromium/depot_tools/subprocess2.py", line 37, in __init__
super(CalledProcessError, self).__init__(returncode, cmd, output=stdout)
TypeError: __init__() got an unexpected keyword argument 'output'
Any hints on how can I get rid of it ? I will update this post with any necesarry information that you'll need.
Update the python version to 2.7 or greater. One of the problems is that you don't have argparse which is on the newest version of python.

OSError: Result too large

I'am playing around with scapy but i cant get it to work. I tried different code's but all gave me the same output:
Traceback (most recent call last):
File "<module1>", line 7, in <module>
File "C:\Python26\lib\site-packages\scapy\sendrecv.py", line 357, in srp
s = conf.L2socket(iface=iface, filter=filter, nofilter=nofilter, type=type)
File "C:\Python26\lib\site-packages\scapy\arch\pcapdnet.py", line 313, in __init__
self.outs = dnet.eth(iface)
File "dnet.pyx", line 112, in dnet.eth.__init__
OSError: Result too large
Iam using python 2.6 with all dependencies installed for scapy.
How to fix this?

Categories