Executing python setup.py install in Conda Env

Post general discussions on using our drivers to write your own software here
Post Reply
DavidB
Newbie
Posts: 0
Joined: Tue Jul 11, 2023 1:41 pm

Executing python setup.py install in Conda Env

Post by DavidB »

Hello,

I am experienced with Python, but not at all with C, and I am also new to Pico instruments. I have a Datalogger TC8 and plan to read multiple thermocouples voltages into my Python code.

I installed the PicoSDK 10.7.25 (64-bit) software and downloaded/unpacked your (
picosdk-python-wrappers) GitHub repository.
Generally, I am working with Conda environments. However, when I activate my Conda environment, move to the top-level directory of the GitHub repository and execute python setup.py install, I receive an error.

Code: Select all

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "", line 2, in 
        File "", line 34, in 
        File "C:\Users\db321\PycharmProjects\picosdk-python-wrappers-master\setup.py", line 19, in 
          result = ctypes.WinDLL(find_library(name))
        File "C:\Users\db321\.conda\envs\PyVSA\lib\ctypes\__init__.py", line 364, in __init__
          if '/' in name or '\\' in name:
      TypeError: argument of type 'NoneType' is not iterable
      [end of output]
From this I can understand that line 19

Code: Select all

result = ctypes.WinDLL(find_library(name))
respectively find_library() does not return anything, i.e. None.

Am I doing something generally wrong or could somebody help me with this issue? I would appreciate any form of support.

Best regards,
David

eklektek
User
User
Posts: 2
Joined: Wed Sep 21, 2022 3:56 pm

Re: Executing python setup.py install in Conda Env

Post by eklektek »

Hi David,

It's a while since you posted this. I was wondering if you recall how you resolved it?

Many thanks.

callen
Newbie
Posts: 0
Joined: Fri Apr 26, 2024 4:34 pm

Re: Executing python setup.py install in Conda Env

Post by callen »

Resurrecting this thread, as I had the exact same issue with my venv and found a temporary workaround on Windows. It was an error on line 19 of setup.py, where it cannot find ps2000.dll:

Code: Select all

signalfile = ".sdkwarning"
if not os.path.exists(signalfile):
    name = 'ps2000'
    try:
        if sys.platform == 'win32':
            result = ctypes.WinDLL(find_library(name))
By replacing the "find_library(name)" with the direct path to my ps2000.dll, the install succeeded in my venv. Like so:

Code: Select all

result = ctypes.WinDLL('C:\Program Files\Pico Technology\SDK\lib\ps2000.dll')

Post Reply