UNSOLVED: Python Wrapper Error DEFAULT_RESOLUTION

Post general discussions on using our drivers to write your own software here
Post Reply
pico_lost
Newbie
Posts: 0
Joined: Sun Jul 24, 2022 4:16 pm

UNSOLVED: Python Wrapper Error DEFAULT_RESOLUTION

Post by pico_lost »

Hello,

PicoSDK's Python Wrapper is throwing an "AttributeError" message when trying to run the test code, found here: https://github.com/picotech/picosdk-pyt ... -this-code

Error:
AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'

Hardware:
I'm connecting a PicoScope 6000 6824E to my Windows 10 (64-bit) PC, via USB.

Driver:
PicoSDK (64-bit), Mar/10/2022. Filename PicoSDK_64_10.7.22.241.exe.

Additional:
I'm running Python 3.9.7 (fellow troubleshooters, to determine your version, type `python --version` in bash). It is 64-bit. My Windows OS, driver and python "bitness" all match. I am running on conda.

Steps to Error:
I've walked many times through the Python Wrapper setup process documented here: https://github.com/picotech/picosdk-pyt ... ng-started

Download Driver
1. Installed PicoSDK 64-bit. Notably, many of the Pico driver downloads for different models (4000, 5000, 6000, etc) all link to the same SDK download driver.

Setup Wrapper
2. There are two possible paths to install the python wrapper. You can `pip install picosdk`. However, when examining the repo on PyPi (https://pypi.org/project/picosdk/), it appears this was last updated December 2020. As such, it seems preferable to install from the GitHub repo (https://github.com/picotech/picosdk-python-wrappers). At the time of posting, this repo was last updated July 22 2022. The last commit seems unrelated to this issue.

First, clone this repo to local. I then open Git Bash inside this local directory, and run `python setup.py install`. Then, install dependencies using `pip install -r requirements.txt`.

To confirm the package has installed, run command `pip list` and find `PicoSDK` in the list, version 1.0.

Run Code
3. Finally, launch python and run the code to determine drivers, found here:
https://github.com/picotech/picosdk-pyt ... -this-code

Code: Select all

from picosdk.discover import find_all_units

scopes = find_all_units()
Error
This produces error:

Code: Select all

>>> from picosdk.discover import find_all_units
>>> scopes = find_all_units()

  File "", line 1, in 
  File "C:\pico\picosdk-python-wrappers\picosdk\discover.py", line 46, in find_all_units
    device = driver.open_unit()
  File "C:\pico\picosdk-python-wrappers\picosdk\library.py", line 134, in open_unit
    return Device(self, self._python_open_unit(serial=serial, resolution=resolution))
  File "C:\pico\picosdk-python-wrappers\picosdk\library.py", line 146, in _python_open_unit
    handle, status = self._python_open_any_unit(resolution)
  File "C:\pico\picosdk-python-wrappers\picosdk\library.py", line 163, in _python_open_any_unit
    resolution = self.DEFAULT_RESOLUTION
AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'
Troubleshooting attempts:
Over the course of several days, I've walked through the above installation steps several times. I've also tried a few creative solutions such as:
1. Edited `test/test_helpers.py's`, by uncommenting line 37 (# 'ps6000').
2. Added ps6000a into that document where it seemed relevant.
3. Followed this install methodology on 2 PCs, one running Windows 10, another Windows 11.
4. Followed all forum posts and solutions (replug USB, editing discover.py). The following solution did not resolve the issue. topic41789.html?&p=147602&hilit=DEFAULT ... ON#p147602
5. Followed `pip install picosdk`
6. Installed into a new conda env, and installed into base env
7. Run the code with Pico 6 software running, and with it closed, restarting python each time.
8. Last but not least, I have restarted both the PC and PicoScope.

Preemptive Thank You for any ideas,
Lost Pico User.

Martyn
Site Admin
Site Admin
Posts: 4501
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: UNSOLVED: Python Wrapper Error DEFAULT_RESOLUTION

Post by Martyn »

Do any of the individual examples for the PicoScope 6824E work?
https://github.com/picotech/picosdk-pyt ... 0aExamples
Martyn
Technical Support Manager

Post Reply