Problems getting SDK running on Python - SOLVED!

Post general discussions on using our drivers to write your own software here
Post Reply
strangequark
User
User
Posts: 2
Joined: Tue Mar 05, 2019 2:48 pm

Problems getting SDK running on Python - SOLVED!

Post by strangequark »

I am running windows 64 bit with python 64 bit and am not able to import the SDK library into python and it's probably because the command line keeps throwing me an error that I have to install SDK even though I did several times. What is going on here? See screen cap when I try to install the setup. When I type "python install setup.py" like in the install instructions, it throws an error that the file cannot be found. Can we please have more detailed instructions as to how to get this working? Thanks
Attachments
screencaperror.png

tsassonx
Newbie
Posts: 0
Joined: Mon Aug 12, 2019 11:33 am

Re: Problems getting SDK running on Python - SOLVED!

Post by tsassonx »

Hi,
I have the same issue, I installed the SDK but setup.py replies:

Code: Select all

Please install the PicoSDK in order to use this wrapper.Visit https://www.picotech.com/downloads
How is the problem solved and what am I supposed to do?

tsassonx
Newbie
Posts: 0
Joined: Mon Aug 12, 2019 11:33 am

Re: Problems getting SDK running on Python - SOLVED!

Post by tsassonx »

Update:
I removed the try...except section in setup.py, then ran again

Code: Select all

python setup.py install
And the package was installed.

To investigate the phenomenon, I ran setup.py in debug mode, tracked the find_library method and in debug mode it works, it finds ps2000.dll in its lib folder.
However, when I run it regularly as stated above, I receive the above error.

cjkraz
Newbie
Posts: 0
Joined: Mon Oct 29, 2018 2:55 pm

Re: Problems getting SDK running on Python - SOLVED!

Post by cjkraz »

Hi,

I second this, we need better documentation on install for windows.

I followed the instruction for the install of the picoSDK and downloaded the python binding library for my 64 bit windows system.

Even after installing and re-installing the picoSDK multiple times I still get the following error when running >python setup.py install.
Please install the PicoSDK in order to use this wrapper.Visit https://www.picotech.com/downloads.

Can you give more info about exactly which try...except section you uncommented to get it to run? threes quite a few in the file.

Greatly appreciated!
Thanks

tsassonx
Newbie
Posts: 0
Joined: Mon Aug 12, 2019 11:33 am

Re: Problems getting SDK running on Python - SOLVED!

Post by tsassonx »

Are you sure you saw quite a few? Perhaps we're looking at different versions, but this is the newest version of setup.py file, use this one (with commented part as my edit):

Code: Select all

#
# Copyright (C) 2017-2018 Pico Technology Ltd.
#
from __future__ import print_function
from distutils.core import setup

import ctypes
from ctypes import *
from ctypes.util import find_library
import sys
import os.path


# signalfile = ".sdkwarning"
# if not os.path.exists(signalfile):
#     name = 'ps2000'
#     try:
#         if sys.platform == 'win32':
#             result = ctypes.WinDLL(find_library(name))
#         else:
#             result = cdll.LoadLibrary(find_library(name))
#     except OSError:
#         print("Please install the PicoSDK in order to use this wrapper."
#               "Visit https://www.picotech.com/downloads")
#         exit(1)
#     open(signalfile, 'a').close()


setup(name='PicoSDK',
      version='1.0',
      description='PicoSDK Python wrapper',
      author='Pico Technology Ltd',
      author_email='support@picotech.com',
      url='https://www.picotech.com',
      packages=['picosdk'])


Christin
Newbie
Posts: 0
Joined: Sun Apr 19, 2020 11:01 am

Re: Problems getting SDK running on Python - SOLVED!

Post by Christin »

emmm,it's amazing,I have tried so many different methods,but all didn't work until I restart my computer.....So may be you can try.

Best wishes

sir_oslay
Newbie
Posts: 0
Joined: Mon Sep 07, 2020 2:47 pm

Re: Problems getting SDK running on Python - SOLVED!

Post by sir_oslay »

I had the same issue installing the python wrappers. Turns out it was as simple as changing the line

Code: Select all

name = 'ps2000'
in setup.py to

Code: Select all

name = 'ps5000'
. I had only installed the SDK for the 5000 series because that's the only one I need and so the 2000 series libraries didn't exist, which is why the setup kept saying I needed to install the SDK.

And restarting your computer may be required for Windows if the SDK lib directory was added to the system PATH variable when the SDK was installed.

Post Reply