VisaIOError: VI_ERROR_RSRC_NFOUND (-1073807343): Insufficient location information or the requested device or resource is not present in the system - pyvisa

I am running a code to connect Keithley multimeter to my laptop. I am using windows 10 and python 2.7. But when I try to run the code, this appears. Help me, i am very basic in programming and computer and I am in need of help. I have been searching for solution for days but to no avail , after I have fixed one error, another error pops up. this is the latest error. I hope after this one is solved i can use it . This is the message from iPython
runfile('C:/Users/user/Downloads/program (2).py',
wdir='C:/Users/user/Downloads') initializing Traceback (most recent
call last):
File "", line 1, in
runfile('C:/Users/user/Downloads/program (2).py', wdir='C:/Users/user/Downloads')
File
"C:\Users\user\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py",
line 710, in runfile
execfile(filename, namespace)
File
"C:\Users\user\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py",
line 86, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/user/Downloads/program (2).py", line 422, in
dmm = DMM()
File "C:/Users/user/Downloads/program (2).py", line 40, in init
self.A=self.rm.open_resource('ASRL3::INSTR')
File "C:\Users\user\Anaconda2\lib\pyvisa\highlevel.py", line 1656,
in open_resource
res.open(access_mode, open_timeout)
File "C:\Users\user\Anaconda2\lib\pyvisa\resources\resource.py",
line 209, in open
self.session, status = self._resource_manager.open_bare_resource(self._resource_name,
access_mode, open_timeout)
File "C:\Users\user\Anaconda2\lib\pyvisa\highlevel.py", line 1613,
in open_bare_resource
return self.visalib.open(self.session, resource_name, access_mode, open_timeout)
File "C:\Users\user\Anaconda2\lib\pyvisa\ctwrapper\functions.py",
line 1213, in open
ret = library.viOpen(session, resource_name, access_mode, open_timeout, byref(out_session))
File "C:\Users\user\Anaconda2\lib\pyvisa\ctwrapper\highlevel.py",
line 188, in _return_handler
raise errors.VisaIOError(ret_value)
VisaIOError: VI_ERROR_RSRC_NFOUND (-1073807343): Insufficient location
information or the requested device or resource is not present in the
system.

Related

Generated Ebook throws error when trying to read it with ebook readers using Ebooklib

While the epub is being generated successfully, but when I try to read the epub using readers like Calibre or Sigil. They throw errors like certain files are missing.
Here's my code to generate the epub file:
book = epub.EpubBook()
book.set_title(novelName)
book.set_language("en")
book.set_cover('temp.jpg', content=open('temp.jpg','rb').read())
book.set_identifier("test")
for i in authorNames:
book.add_author(i)
for i in range(1):
driver.get(chapterLinks[i])
try:
content=driver.find_element_by_id('chr-content').get_attribute("innerHTML")
time.sleep(5)
except Exception as e:
driver.close()
driver = webdriver.Chrome(ChromeDriverManager().install(),options=options)
driver.get(chapterLinks[i])
content=driver.find_element_by_id('chr-content').get_attribute("innerHTML")
time.sleep(5)
soup = BeautifulSoup(content)
ads=soup.find("div", class_="ads-holder")
if(ads!=None):
ads.decompose()
print(chapterNames[i], chapterLinks[i])
chapterName=chapterNames[i].replace("-","")
c=epub.EpubHtml(title=chapterName,
file_name='{}.xhtml'.format(chapterName),
lang='en')
c.set_content(str(soup).encode('utf-8'))
book.add_item(c)
chapterList.append(c)
book.toc = chapterList
book.spine = chapterList
book.add_item(epub.EpubNcx())
book.add_item(epub.EpubNav())
epub.write_epub('test.epub', book)
and here are the errors:
Calibre :
calibre, version 5.20.0
ERROR: Loading book failed: Failed to open the book at C:\Users\xxxxx\Documents\Visual Studio 2019\PersonalProjects\Novel Grabber\test.epub. Click "Show details" for more info.
Failed to convert book: C:\Users\xxxxx\Documents\Visual Studio 2019\PersonalProjects\Novel Grabber\test.epub with error:
InputFormatPlugin: EPUB Input running
on C:\Users\xxxxx\Documents\Visual Studio 2019\PersonalProjects\Novel Grabber\test.epub
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "site.py", line 82, in <module>
File "site.py", line 77, in main
File "site.py", line 49, in run_entry_point
File "calibre\utils\ipc\worker.py", line 197, in main
File "<string>", line 1, in <module>
File "calibre\srv\render_book.py", line 824, in viewer_main
File "calibre\srv\render_book.py", line 815, in render_for_viewer
File "calibre\srv\render_book.py", line 793, in render
File "calibre\srv\render_book.py", line 601, in process_exploded_book
File "calibre\srv\render_book.py", line 604, in <setcomp>
File "calibre\ebooks\oeb\polish\container.py", line 561, in has_name_and_is_not_empty
File "genericpath.py", line 50, in getsize
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\xxxxxx\\AppData\\Local\\calibre-cache\\ev2\\t\\c0-vdo66nim\\EPUB\\Chapter 2 '
Sigil:
Files exist in epub that are not listed in manifest, they will be ignored
Does anybody know what could be the cause for this?

RobotFramework RIDE not opening

I have installed robotframework and robotframework-ride using pip. All the other required components are also updated. I am using Python 3.7.6 and Windows 10.
When I run RIDE, I get the following error:
Traceback (most recent call last):
File "C:\Python37-32\lib\site-packages\robotide\application\application.py", line 62, in OnInit
self._plugin_loader.enable_plugins()
File "C:\Python37-32\lib\site-packages\robotide\application\pluginloader.py", line 43, in enable_plugins
p.enable_on_startup()
File "C:\Python37-32\lib\site-packages\robotide\application\pluginconnector.py", line 52, in enable_on_startup
self.enable()
File "C:\Python37-32\lib\site-packages\robotide\application\pluginconnector.py", line 57, in enable
self._plugin.enable()
File "C:\Python37-32\lib\site-packages\robotide\recentfiles\recentfiles.py", line 44, in enable
self._add_recent_files_to_menu()
File "C:\Python37-32\lib\site-packages\robotide\recentfiles\recentfiles.py", line 114, in _add_recent_files_to_menu
self.register_action(action)
File "C:\Python37-32\lib\site-packages\robotide\pluginapi\plugin.py", line 204, in register_action
action = self.__frame.actions.register_action(action_info)
File "C:\Python37-32\lib\site-packages\robotide\ui\mainframe.py", line 751, in register_action
self._menubar.register(action)
File "C:\Python37-32\lib\site-packages\robotide\ui\actiontriggers.py", line 60, in register
menu.add_menu_item(action)
File "C:\Python37-32\lib\site-packages\robotide\ui\actiontriggers.py", line 98, in add_menu_item
menu_item = self._construct_menu_item(action)
File "C:\Python37-32\lib\site-packages\robotide\ui\actiontriggers.py", line 107, in _construct_menu_item
menu_item = self._create_menu_item(action)
File "C:\Python37-32\lib\site-packages\robotide\ui\actiontriggers.py", line 139, in _create_menu_item
pos = action.get_insertion_index(self.wx_menu)
File "C:\Python37-32\lib\site-packages\robotide\action\action.py", line 40, in get_insertion_index
return self._insertion_point.get_index(menu)
File "C:\Python37-32\lib\site-packages\robotide\action\actioninfo.py", line 286, in get_index
index = self._find_position_in_menu(menu)
File "C:\Python37-32\lib\site-packages\robotide\action\actioninfo.py", line 296, in _find_position_in_menu
if self._get_menu_item_name(item).lower() == self._item.lower():
File "C:\Python37-32\lib\site-packages\robotide\action\actioninfo.py", line 301, in _get_menu_item_name
return self._shortcut_remover.split(item.GetLabel())[0]
AttributeError: 'MenuItem' object has no attribute 'GetLabel'
OnInit returned false, exiting...
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at ..\..\src\common\wincmn.cpp(475) in wxWindowBase::~wxWindowBase(): any pushed event handlers must have been removed
I can't deduce whether I am doing something wrong. I have installed RIDE previously on this PC and others as well and this is the first time I am running into this error.
Kindly help.
To use newest wxPython version 4.1.0, you will have to install the current development version of RIDE (2.0b1.dev1) from source code, Otherwise, you should install version 4.0.7.post2.
See project page at https://github.com/robotframework/RIDE

Every "az" commands are now failing, how do I fix it?

I managed to break az, by using CTRL-C after the command "az login". Now, all I can get is this message :
Traceback (most recent call last):
File "runpy.py", line 193, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "C:\Users\trdai\AppData\Local\Temp\pip-install-8jgnm5o1\azure-cli\azure\cli\__main__.py", line 32, in <module>
File "C:\Users\trdai\AppData\Local\Temp\pip-install-8jgnm5o1\azure-cli-core\azure\cli\core\__init__.py", line 509, in get_default_cli
File "C:\Users\trdai\AppData\Local\Temp\pip-install-8jgnm5o1\azure-cli-core\azure\cli\core\__init__.py", line 52, in __init__
File "C:\Users\trdai\AppData\Local\Temp\pip-install-8jgnm5o1\azure-cli-core\azure\cli\core\_session.py", line 40, in load
File "json\__init__.py", line 299, in load
File "json\__init__.py", line 354, in loads
File "json\decoder.py", line 339, in decode
File "json\decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The command I use to get this message
Any idea on how to clean the cache? I already tried to reinstall, to repair, to remove and reinstall again, with no success.
Thanks in advance.
In this case cleaning the temp folder (/home/user/.azure) solved the problem

TypeError: can't pickle memoryview objects when running basic add.delay(1,2) test

Trying to run the most basic test of add.delay(1,2) using celery 4.1.0 with Python 3.6.4 and getting the following error:
[2018-02-27 13:58:50,194: INFO/MainProcess] Received task:
exb.tasks.test_tasks.add[52c3fb33-ce00-4165-ad18-15026eca55e9]
[2018-02-27 13:58:50,194: CRITICAL/MainProcess] Unrecoverable error:
SystemError(' returned a result with an error set',) Traceback (most
recent call last): File
"/opt/myapp/lib/python3.6/site-packages/kombu/messaging.py", line 624,
in _receive_callback
return on_m(message) if on_m else self.receive(decoded, message) File
"/opt/myapp/lib/python3.6/site-packages/celery/worker/consumer/consumer.py",
line 570, in on_task_received
callbacks, File "/opt/myapp/lib/python3.6/site-packages/celery/worker/strategy.py",
line 145, in task_message_handler
handle(req) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/worker.py", line
221, in _process_task_sem
return self._quick_acquire(self._process_task, req) File "/opt/myapp/lib/python3.6/site-packages/kombu/async/semaphore.py",
line 62, in acquire
callback(*partial_args, **partial_kwargs) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/worker.py", line
226, in _process_task
req.execute_using_pool(self.pool) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/request.py",
line 531, in execute_using_pool
correlation_id=task_id, File "/opt/myapp/lib/python3.6/site-packages/celery/concurrency/base.py",
line 155, in apply_async
**options) File "/opt/myapp/lib/python3.6/site-packages/billiard/pool.py", line 1486,
in apply_async
self._quick_put((TASK, (result._job, None, func, args, kwds))) File
"/opt/myapp/lib/python3.6/site-packages/celery/concurrency/asynpool.py",
line 813, in send_job
body = dumps(tup, protocol=protocol) TypeError: can't pickle memoryview objects
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File
"/opt/myapp/lib/python3.6/site-packages/celery/worker/worker.py", line
203, in start
self.blueprint.start(self) File "/opt/myapp/lib/python3.6/site-packages/celery/bootsteps.py", line
119, in start
step.start(parent) File "/opt/myapp/lib/python3.6/site-packages/celery/bootsteps.py", line
370, in start
return self.obj.start() File "/opt/myapp/lib/python3.6/site-packages/celery/worker/consumer/consumer.py",
line 320, in start
blueprint.start(self) File "/opt/myapp/lib/python3.6/site-packages/celery/bootsteps.py", line
119, in start
step.start(parent) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/consumer/consumer.py",
line 596, in start
c.loop(*c.loop_args()) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/loops.py", line
88, in asynloop
next(loop) File "/opt/myapp/lib/python3.6/site-packages/kombu/async/hub.py", line 354,
in create_loop
cb(*cbargs) File "/opt/myapp/lib/python3.6/site-packages/kombu/transport/base.py", line
236, in on_readable
reader(loop) File "/opt/myapp/lib/python3.6/site-packages/kombu/transport/base.py", line
218, in _read
drain_events(timeout=0) File "/opt/myapp/lib/python3.6/site-packages/librabbitmq-2.0.0-py3.6-linux-x86_64.egg/librabbitmq/init.py",
line 227, in drain_events
self._basic_recv(timeout) SystemError: returned a result with an error set
I cannot find any previous evidence of anyone hitting this error. I noticed from the celery site that only python 3.5 is mentioned as supported, is that the issue or is this something I am missing?
Any help would be much appreciated!
UPDATE: Tried with Python 3.5.5 and the problem persists. Tried with Django 4.0.2 and the problem persists.
UPDATE: Uninstalled librabbitmq and the problem stopped. This was seen after migration from Python 2.7.5, Django 1.7.7 to Python 3.6.4, Django 2.0.2.
After uninstalling librabbitmq, the problem was resolved.

BLE: Executing the bluez test "test-proximity"

Hey i got some trouble running the ./test-proximity. I'm using bluez-5.16 and dbus-1.8.0.
In the folder test/ is the BLE text for PXP profile.
To call it i wrote: ./test-proximity -i 0 -b 88:33:14:E5:EE:A1 LinkLossAlertLevel mild
Error:
Traceback (most recent call last):
File "./test-proximity", line 52, in <module>
device = bluezutils.find_device(options.address, options.dev_id)
File "/home/pi/bluez-5.16/test/bluezutils.py", line 29, in find_device
return find_device_in_objects(get_managed_objects(), device_address,
File "/home/pi/bluez-5.16/test/bluezutils.py", line 9, in get_managed_objects
manager = dbus.Interface(bus.get_object("org.bluez", "/"),
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files
It seems like there is something wrong with .service files. But i can'f find them.
thanks in advance

Resources