[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] HTCondor 23.0.10 Python Binding on EL9



On 5/30/2024 4:02 AM, Mathieu GAUTHIER-LAFAYE wrote:
Hello All,

I've got a problem with the python binding on EL9 (AlmaLinux).

I have the following package installed on the system :
python3-condor-23.0.10-1.el9.x86_64

I wrote this script to demonstrate the problem :

#!/usr/bin/env python3

import socket

import htcondor
import classad

host=socket.gethostname()

coll = htcondor.Collector()
scheddAd = coll.locate(htcondor.DaemonTypes.Schedd, host)
schedd = htcondor.Schedd(scheddAd)


When I execute it with the system package, I've got the following error :

Traceback (most recent call last):
  File "/root/./test2.py", line 11, in <module>
    scheddAd = coll.locate(htcondor.DaemonTypes.Schedd, host)
  File "/usr/lib64/python3.9/site-packages/htcondor/_lock.py", line 70, in wrapper
    rv = func(*args, **kwargs)
TypeError: No to_python (by-value) converter found for C++ type: boost::shared_ptr<ClassAdWrapper>


When I execute it from a virtualenv with the same version, I don't have any error.

I've created the virtualenv with the following commands :

python -m venv venv
source venv/bin/activate
pip install htcondor==23.0.10


Any idea why it's not working with the system package ?

Hi Mathieu,

Could it be that you have different python versions on your machine?  I noticed your script using "python3" from your path, but your venv was created running "python".

What is the output from the following commands:

  python3 --version
  /usr/bin/env python3 --version
  python --version

FWIW, I just tested your script above on fresh Alma9 install (in a container) using the system package HTCondor v 23.0.10 fetched from get.htcondor.org stable channel  and it worked fine for me.
Here is what I did:

$ docker run -it --rm almalinux/9-base bash
[root@f5b1fcb6c6ce /]# curl -fsSL https://get.htcondor.org | /bin/bash -s -- --no-dry-run --channel stable
[root@f5b1fcb6c6ce /]# condor_version
$CondorVersion: 23.0.10 2024-05-09 BuildID: 731952 PackageID: 23.0.10-1 $
$CondorPlatform: x86_64_AlmaLinux9 $
[root@f5b1fcb6c6ce /]# python3
Python 3.9.18 (main, Jan  4 2024, 00:00:00)
[GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> import htcondor
>>> import classad
>>> host=socket.gethostname()
>>> coll = htcondor.Collector()
>>> scheddAd = coll.locate(htcondor.DaemonTypes.Schedd, host)
>>> schedd = htcondor.Schedd(scheddAd)

Hope the above helps,
Todd

--
Todd Tannenbaum <tannenba@xxxxxxxxxxx>  University of Wisconsin-Madison
Center for High Throughput Computing    Department of Computer Sciences
Calendar: https://tinyurl.com/yd55mtgd  1210 W. Dayton St. Rm #4257