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 » Thu May 02, 2019 6:43 pm

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 » Mon Aug 12, 2019 11:35 am

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 » Mon Aug 12, 2019 12:09 pm

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 » Mon Sep 16, 2019 3:39 pm

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 » Wed Sep 18, 2019 8:24 am

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'])


Post Reply