[Resolved] Distributing a Python module that uses C shared libs?

I did some research on distutils, and I managed to find fairly detailed instructions for how one could distribute a Python module with C extensions. However, I have a Python module which uses ctypes to run code from C shared libraries (more specifically: SDL, and related libraries).
Basically, this is what I have:
pslab.py # requires ctypes wrapper modules below
sdl.py # ctypes wrapper modules require respective shared libs below
sdlmixer.py
sdlimage.py
sdlttf.py
# This is for Linux -- .dll for Windows, .dylib for OSX.
libSDL.so
libSDL_mixer.so
libSDL_image.so
libSDL_ttf.so
Is there a "standard" way to distribute modules of this type (maybe some undocumented distutils method, or something I failed to find)?
The Python files are not the problem (distutils can handle them), but I need a way to install the appropriate shared libs for the platform in question (if necessary), so that ctypes wrapper modules can find and load them.
Last edited by Goran (2012-08-14 08:51:19)

You could distribute those files ... but I wouldn't recommend it.
I believe the closest thing to a "standard" is simply to list sdl as a dependency.  A package distributor should not try to manage dependencies for users (only inform them of the dependencies).  That is either up to the user, or (more often) the distro's package management system.
If I download a program that uses gtk, I don't expect it to include all of the gtk too.  Rather, the documentation would simply specify that gtk is a dependency.  Are you going to also distribute copies of the python interpreter?  Perhaps I'm missing something, but why would sdl be any different than python itself?  It's assumed (or speficied) that the user needs to have these installed for your package to work.
Last edited by Trilby (2012-08-13 23:44:44)

Similar Messages

  • Reg: Function Module thats used to check the status of JOBS and mail it

    Hi Experts,
    Is there any Standard Function module thats going to find the status of the jobs and mail this status to specied email ID in .xls format. While checking status function module should give whether job is - Aborted, Successful, Running, Waiting, Locked, Error, Warning, Starting Date, Ending Date of the Job.
    Please help me,

    Hello Nagaraj,
    You can find out the status of a job with the SHOW_JOBSTATE function module. You provide this function module with a job name and job number. It returns one of the six possible statuses of the job:
    ABORTED TYPE C,
    FINISHED TYPE C,
    PRELIMINARY TYPE C,
    READY TYPE C,
    RUNNING TYPE C,
    SCHEDULED TYPE C.
    Following is the link for the same:
    http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e10543b11d1898e0000e8322d00/content.htm
    Warm Regards,
    Riki Dash

  • Doing news module that uses Entities and VOs in a dynamic way

    Hi dears,
    I'm developing a Web Center Application with JDev 11.1.1.6.0. And I'm trying a make a news module that can be controlled by an admin with the interaction of database.
    In the main page, there's a JQuery and has 5 titles, bodies and pictures. It's changes in 5 seconds.
    I have News table in my database and I created the EO and VOs of News. Now I'm locked in a situation. I want to show the news one by one in JQ frames.
    I mean
    First News -> RowID % 5 == 1
    Second News -> RowID %5 == 2
    ... (From the same EO)
    If I change the SQL Query of EO, this effects all of them always it brings me the 1st news for example. How can i do that? Does ADF allow me to do that?
    Thanks in advance.
    Erdo

    repost

  • Using older shared libs for games ?

    Hi fellow archers,
    I like to play the enhanced Quake engine DarkPlaces (http://icculus.org/twilight/darkplaces/) together with a few mods (namely SDQuake and Kleshik).
    Under Ubuntu 9.04 x64 DarkPlaces runs nicely as native x64 Linux app. Under the most recent version of arch64 DarkPlaces bombed out with an error message that the libjpeg version is too new. Something like Version 0.80 found but Version 0.62 is expected. Seems to me that even the newest version of Darkplaces is build against an older version of libjpeg than the one included in arch64. Libpng is also used by DarkPlaces since textures are stored as PNG.
    My Ubuntu 9.04 x64 shows the following libs:
    /usr/lib/libpng12.a
    /usr/lib/libpng12.so.0.27.0
    /usr/lib/libjpeg.a
    /usr/lib/libjpeg.so.62.0.0
    Is it "wise" to use a custom lib folder for DarkPlaces and set it via LD_LIBRARY_PATH ?
    e.g.
    export LD_LIBRARY_PATH=/home/ds/dplibs
    Or can I simply install older versions of libjpeg and libpng without screwing up my arch64 installation ? I can remember that I also did install a few older libs on my Ubuntu 10.04 in order to get UT2k4 running.
    BTW: I would prefer not to recompile DarkPlaces against newer versions of libpng/libjpeg.
    TIA,
    D$

    Ok, thanks for all your replies !
    I will try out the approach using a dedicated lib directory for DarkPlaces under arch64.
    Unfortunately my 500GB HDD which I used for arch died
    So I have to wait until my new 1TB HDD arrives.
    stqn wrote:... but I guess if you want to play (and not rebuild) this game you don't have a choice..
    Well, the other not so slick option would be using the Windows version of the DarkPlaces engine inside a 32 chrooted WINE since for Windows all requiered libs (aka dll) are included in the right version.
    As usual shared libs also do have their disadvantages compared to statically linked stuff
    Last edited by Darksoul71 (2010-07-28 22:16:20)

  • How to trace a module that uses shared server sessions?

    I have an app (Esri's ArcGIS Server 9.3.1) that I want to trace. Oracle is at 11.2.0.2.0. Our OEM is is at 10.2.0.4.0.
    When I initiate a trace for the module (ArcSOC.exe) in OEM, I can see a trace file start to grow larger. But it seems to be a trace file that already exists (example: <instance>s00022493.trc). To isolate activity to just the duration of time I'm interested in, I'd like to start with a fresh trace file. Is there any way to do that? Must I delete currently active trace files or would that cause a failure?
    When tracing a dedicated server session, I've noticed that a new trace file will be generated with "ora" in its name. Evidently not so with shared server stuff, whether it's tracing a module or a particular session. When the shared server model is used, it seems Oracle wants to reuse existing trace files. And since trace files an get quite large, it would be difficult to open the trace file in an editor and remove the pre-existing, older activity that I don't want to work with.

    See http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php for various ways. Delete the trace file before you begin. See http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#i20110

  • Using C++ shared libs

    I have a developer that has used the Rogue Wave libraries.
    Is there an easy way to use these libraries on other machines
    without installing SunWorkshop on all machines that need it?
    We are using SunWorkshop 5.0.
    Thanks!
    -Dan

    Why don't you rephrase your question???

  • Distributing an application that uses componentworks++

    I am new to using MS. 
    I am going to distribute a Visual C++ application to a remote site, sending the customer a DVD.
    The application is an MFC application that uses ComponentWorks++ (from Measurement Studio)  and NiDaq.
    What do I need to be able to distribute this application?  Do I need to license each  target for MS?  Do I need to separately install Component Works++ on the target?
    Thanks,
    Menchar

    I'm still having some issues ...
    We went ahead and used InstallShield 12.0 to create a release file (setup.exe).  We're using MS 1.0.1 so we didn't have merge modules, but rather a bunch of .ocx and .dll files in a /redist    folder that looks to be the stuff you distribute to get a ComponentWorks++ application deployed.  So we included all of those and InstallShield deployed them into the WinNT system folder.
    Our app also uses NI-DAQ 6.9, and my understanding is that NI-DAQ must be run on its own installer as provided by NI.  So we didn't include any NI-DAQ stuff.
    We tried testing our release on a WindowsNT virtual machine (clean machine).  We first installed NI-DAQ, then ran our app installer (setup.exe).  Install of NI-DAQ and our app appears to go OK, but when we run the application in the virtual machine it fails to start, giving us a popup that says it can't find the CVI rte!  We installed the CVI RTE just for giggles but it still died on startup.  Does NI-DAQ 6.9 use the CVI runtime engine?
    My question now is, can we expect our app to start on the virtual machine?  The app is designed to run without any NI-DAQ HW present.  I am able to run it on an XP machine without any NI-DAQ HW, but that machine also has ComponentWorks++ 1.0.1 installed, VC++ 6.0 SP 5, and NI-DAQ of course as well (but no NI DAQ HW), and I didn't install the application, I just ran the executable after building it on the XP machine.  The app also runs OK on the intended WinNT 4.0 target - but the target has NI-DAQ HW & SW, all of MS 1.0.1 (including CVI), and VC++ 6.0 SP5 installed.
    So I can't say I've been able to create a distribution that will install and run on a system that doesn't already have NI-DAQ, CW++ and VC++ installed.  I can't find any relevant help on the NI site for these old versions of CW++.
    I'm also curious if there's a dependency between CW++ and CW?  I.e., from a VC++ application, could it have a dependency on CW (my understanding CW is for VB only).
    I see what looks like a VC6 runtime of some sort in the CW /redist folder - is this an extension of the Microsoft VC runtme dll? 
    Thanks for any help with this, it's funky working with these old versions - I have to support some long-lived systems deployed overseas.
    Menchar

  • Is there a way to play video clips that use adobe flash and if not when are you going to resolve your problem with them ? I won't buy another apple product until you do and I Know I,m not the online.

    Is there a way to play video clips that use adobe flash and if not when are you going to resolve your problem with them ? I won't buy another apple product until you do and I Know I,m not the only one.

    Use the search feature and type in Flash and there are like thousands of posts on this.
    You seem to think you are addressing Apple with your post.  This is a user forum and we are all users just like you.

  • Compile a project that uses Spark modules (SDK 4.5) with FB4.1?

    Is it possible to compile a project that uses Spark modules with Flash Builder 4.1?
    I've added SDK 4.5 to FB and selected it in the project properties (no problems here).
    But how about the 'Flex modules' tab in the project properties window, will it be able to add Spark modules to the application?

    Yes, you will be able to use s:Module with FB 4. You'll have to do a new MXML component, then go to Flex Modules and click on the add button. (The new module wizard there won't support the spark module)
    However, please note that this is unsupported in the sense that we haven't tried that out at our end. (But I personally have and it works )
    -Anirudh

  • Impact on using function modules that are flagged as obsolete

    Hi Gurus,
    I'm working on a SAP 4.7 instance and we are soon to be going Unicode enabled. I noticed when running transaction UCCHECK that there are a number of function modules such as "POPUP_TO_CONFIRM_WITH_MESSAGE" and "POPUP_TO_DECIDE" as well as others that are flagged as obsolete, I'm not sure why these are not picked up in UCCHECK. However, can someone tell me what the impact would be if these obsolete functions were left as is and not changed?
    Thanks in advance
    C

    Thanks for your responses, I agree with you both.
    my view was that after we go unicode enabled all function modules that are flagged for deletion will still perform as they do now, however, as Praveen says this may not be the case in later versions.
    Thanks
    C

  • Unable to create dimensions in schemas that use synonyms

    I have three schemas (s1, s2 and s3) that use synonyms to reference different tables. S1 and S2 have all tables, equally distributed in their schema. S3 is an end user who has just synonyms.
    I tried creating dimensions in any of them, table or view not found error is encountered.
    I created required tables in my schema (user: meka) and I was successfully able to create dimensions. The following command worked in "meka", not any of the three schemas (s1, s2 and s3).
    CREATE DIMENSION country
         level city_id is lu_city.CITY_ID
              level state_id is lu_state.STATE_ID
              level country_id is lu_country.COUNTRY_ID
    hierarchy country_hier (
    city_id CHILD OF
    state_id CHILD OF
    country_id
    JOIN KEY lu_city.STATE_ID references state_id
    JOIN KEY lu_state.COUNTRY_ID references country_id
    ATTRIBUTE city_id DETERMINES (lu_city.CITY_NAME)
    ATTRIBUTE state_id DETERMINES (lu_state.STATE_NAME)
    I tried a few combinations, including specifying fully qualified table names (s1.lu_city.city_id, etc); created views at user S3 tried the same. All of them were unsuccessful. I am using Oracle 11g R2, here is screen shot:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    Q: How can I create a dimension in a schema where tables do not exist. They exist in another schema.
    Edited by: user8967661 on Jan 12, 2010 2:12 PM

    This is resolved.

  • [SOLVED]No osgeo python module after GDAL build -- enabled filegdb

    I compiled GDAL 1.10 from [community] using "yaourt -Sb gdal" and modified the PKGBUILD so that ./configure would include --with-fgdb=<path to filegdb libs>
    The program compiled and installed fine with FileGDB support but now QGIS, or python doesn't have the much needed osgeo module anymore.
    The plugin error when starting qgis says:
    Unable to load GdalTools plugin.
    The required "osgeo [python-gdal]" module is missing.
    Install it and try again.
    I can't import it from python using "import osgeo" - no surprise since QGIS complains it can't either.
    There isn't an osgeo folder in /usr/lib/python2.7/site-packages anymore either or any of the gdal*.py files.
    If I re-install gdal from the community repo, it's all back to normal in both QGIS and python but without ESRI FileGDB support.
    Anyone know or can help me figure out what's wrong and why my custom build (with only an added configure option) doesn't include the osgeo python module like the gdal from the community repo does?
    If there's any more info I can share that'd be helpful, just let me know.
    Last edited by saultdon (2013-07-07 07:02:14)

    In a paste of the compile output I can see the osgeo module being installed for python3 instead.
    The PKGBUILD has a portion that looks like it should be installing for python2 instead:
    package () {
      cd "${srcdir}/$pkgname-$pkgver"
      install -d "${pkgdir}/usr/lib/python2.7/site-packages/"
      make DESTDIR="${pkgdir}" install
    At least it's installing because I can import the osgeo module in python3, but QGIS uses python2.
    I'm not sure why it's installing for python3.
    Python3 is the default python on this system by default, that might have something to do with it.
    uname -a
    Linux alienix 3.9.9-1-ARCH #1 SMP PREEMPT Wed Jul 3 22:45:16 CEST 2013 x86_64 GNU/Linux

  • Can't import python modules anymore: Problems with PyQt4.Qt

    Hallo,
    at the beginning: Sorry for my horrible english!
    I made a big mistake and a possible stupid thing:
    I yesterday try to install SIP and Ppyqt4 under a virutal enviroment because I want to use SIP for creating
    generator codes between pyhton and C++.
    I got SIP from the AUR's:
    archlinux.org/packages/extra/x86_64/python-sip/
    and installed it this way:
    lucacerone.net/2013/08/installing-pyqt4 … yx-dGd_phF   
    I did it this way because on the official SIP-documentation site I didn't understand, WHERE to install this:
    pyqt.sourceforge.net/Docs/sip4/installa … onfiguring
    I know now, that was a very stupid idea because when I try to run a pyhton script with:
    python programm_file.py
    , I got the follwing errors importing a module in a python script:
    [vain@chinchi2 python_programme]$ python test.py
    Traceback (most recent call last):
    File "test.py", line 25, in <module>
    import matplotlib.pyplot as plt
    File "/usr/lib/python3.3/site-packages/matplotlib/pyplot.py", line 98, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
    File "/usr/lib/python3.3/site-packages/matplotlib/backends/__init__.py", line 28, in pylab_setup
    globals(),locals(),[backend_name],0)
    File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_qt4agg.py", line 13, in <module>
    from .backend_qt4 import QtCore, QtGui, FigureManagerQT, FigureCanvasQT,\
    File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_qt4.py", line 21, in <module>
    import matplotlib.backends.qt4_editor.figureoptions as figureoptions
    File "/usr/lib/python3.3/site-packages/matplotlib/backends/qt4_editor/figureoptions.py", line 13, in <module>
    import matplotlib.backends.qt4_editor.formlayout as formlayout
    File "/usr/lib/python3.3/site-packages/matplotlib/backends/qt4_editor/formlayout.py", line 51, in <module>
    from matplotlib.backends.qt4_compat import QtGui,QtCore
    File "/usr/lib/python3.3/site-packages/matplotlib/backends/qt4_compat.py", line 56, in <module>
    from PyQt4 import QtCore, QtGui
    RuntimeError: the sip module implements API v11.0 but the PyQt4.QtCore module requires API v10.1
    [vain@chinchi2 python_programme]$
    I then upgraded PyQt4 to PyQt 5 with pacman and
    pyqt5-common 5.2-1 [installed]
    python-qscintilla-common 2.8-1 [installed]
    qscintilla 2.8-1 [installed]
    But there is still the same RuntimeErroe with PyQt4. Maybe there exists false dependencies for the shared libraries? How can I get
    rid of these errors, I need pyhton for programming a project. What can I do to solve it?
    Every answer which could help is welcome!
    Last edited by chinchi (2014-03-21 20:59:25)

    Lone_Wolf wrote:
    Note : i know very little about the packages involved here.
    Both of those guides you mention deal with MANUALLY installing sip & pyqt, and that is almost always a BAD idea on archlinux.
    Since you also seem to have installed both with pacman, you likely now have a mix of 2 different sip & pyqt installs in one system.
    to make things work again, you'll have to clean up your system.
    basically that would mean removing the sip & pyqt with pacman, then figuring out what those manual installs added and remove that also.
    it will be tricky and time consuming, reinstaling seems like a much easier and faster method.
    Once you have succesfully re-installed or cleaned up, just install sip & pyqt through pacman and you should be good to go.
    Hi,
    I uninstall sip with:
    sudo pacman -Rsc sip
    also Pyqt and reinstalled them again with Pyqt5 and the new version of sip 4.15.4, so have not more errors like:
    from PyQt4 import QtCore, QtGui
    RuntimeError: the sip module implements API v11.0 but the PyQt4.QtCore module requires API v10.1
    It improved. But I can't still load several Python modules like matplotlib:
    File "erstenprog.py", line 26, in <module>
    import matplotlib.pyplot as plt
    ImportError: No module named 'matplotlib'
    Any idea?
    chinchi

  • Python module under db 4.3.29

    According to the documentation for the python module, version 4.3 of db is sufficient for building the module. However, when I try python setup.py build I get the following error:
    dbxml_python_wrap.cpp: In function ‘void init_dbxml()’:
    dbxml_python_wrap.cpp:36842: error: ‘DB_READ_UNCOMMITTED’ was not declared in this scope
    dbxml_python_wrap.cpp:36848: error: ‘DB_READ_COMMITTED’ was not declared in this scope
    I see that the two missing declarations are in the db.h from 4.5.20 included with dbxml, but they aren't in the db.h I have installed here.
    What am I to do? I'm working on packaging this for a Linux distribution, and unfortunately they're pretty insistent of using installed libraries instead of packaged ones.

    Now everything is compiling successfully (with some warnings about -R being an unknown option) but I get the following error when trying to import the module. Any idea where I should start tracking this down?
    Python 2.4.3 (#1, Feb 20 2007, 15:36:44)
    [GCC 4.1.1 (Gentoo 4.1.1-r3)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    import bsddb3
    import dbxmlTraceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/usr/lib/python2.4/site-packages/dbxml.py", line 5, in ?
    import _dbxml
    ImportError: /usr/lib/libdbxml-2.3.so: undefined symbol: _ZTI11DbException                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Python module for Adaptive Server compatibility with ASE 12

    I discovered that the Python module in the SDK can't pass datetime as a parameter to an ASE 12 server, most likely because it is trying to use bigdatetime. Is this intentional? It was generally expected for OpenClient to be backwards compatible after all.

    Hi,
    ASE 12 is very old and since no Eng support maybe decision made to not use datetime. However, you can certainly request feature - if you are able to create incident we can create Feature and then incident can be used for tracking purposes, etc.
    If unable to create incident please provide details:
    ASE version (exact with select @@version)
    SDK version being used
    code sample to demonstrate problem and the output from such a test
    If you used TDS please provide that trace as well if possible
    Cheers,
    -Paul

Maybe you are looking for

  • Data activation in ODS taking too long

    Hi gurus, I have loaded data into PSA. From there I have loaded this data into ODS. However, the data is not being activated. So, I have to do manual activation on it. The problem is, I have to wait for a very long time. I started the data activation

  • RFC to PI Junk Payload

    We are having typical issue in RFC-PI integration. SAP sending data to PI via RFC. For which we have imported the BAPI. When the data is send by SAP, it is coming to PI as truncated one. For eg First field SAP is of 8 char length internal table but i

  • Help please - 10.1.0.4 aggregation dying

    Hi, I have an aggregation that is dying and I'm not sure exactly what is going on. I have a pretty large cube (12 dimensions - 1 dense and 11 sparse), and was trying to solve it with COMPRESSION turned on. Below I've attached the POUTFILEUNIT results

  • HT201274 What can I do if the glass starts to lift up around the edge?

    I've noticed that the screen is starting to lift off around the edge on my iPhone, is there any way to fix this problem? PS Being a pensioner I reeeaallly can't afford a newer phone Sic please help

  • Requested delivery date is emtpy

    We use business process creating quotation (AG) on CRM and sending its to R/3 system (SD). We try to create quotation in CRM system. Its quotation without problem go to R/3. We fill requested delivery date (REQ_DLV_DATE) in CRM system in quote - and