1. Dashboard
  2. Artikel
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Dieses Thema
  1. HTML - Webmaster Forum
  2. Programmierung - Entwickler Forum
  3. Zope & Plone - das deutsche Hilfeforum

Pymat

  • 12. Januar 2007 um 12:24
  • Gast
    • 12. Januar 2007 um 12:24
    • #1

    Hallo!

    Ich habe Zope 2.7.4. installiert und möchte die Funktion PyMat (Schnittstelle Python und Matlab) integrieren. Hab die Funktion PyMat in den Ordner "Extensions" kopiert. Wenn ich nun ein neues Python Script erstelle und PyMat importieren will, dann kommt folgende Fehlermeldung: Error Type: ImportError
    Error Value: import of "pymat" is unauthorized
    Kann mir jemand einen Lösungsvorschlag machen??

    Danke!!

  • Torty
    Kaiserliche Hoheit
    Beiträge
    1.558
    • 12. Januar 2007 um 18:28
    • #2

    Ja - kann ich. Muss dazu aber mal in meinen Sourcen kramen.
    Melde mich später noch dazu. Falls ich's vergesse -> bitte erinnern.

    Torty

    "Carpe Diem" powered by positiv Feelings

  • Torty
    Kaiserliche Hoheit
    Beiträge
    1.558
    • 16. Januar 2007 um 14:03
    • #3

    Hehe - gut dass ich darauf hingewiesen habe, dass ich es vergessen könnte. *g*

    Ok meine damalige Lösung lautete:
    In der __init__.py deines Skins fügst du oben folgende Zeile ein

    Code
    allow_module('re')

    um bsp.weise reguläre Ausdrücke in Script-Python nutzen zu können.

    See also: http://plone.org/documentation/…ules-in-scripts

    Bei Pymat handelt es sich um kein Plone-Produkt, sondern um ein Modul, welches von Zope beim Start mitgeladen werden soll.
    Dazu gibt es im Verzeichnis /doc des PyMat die pymat.html. Dort findest du dies:

    Zitat

    Installation

    1. Win32

    Simply place the pymat.pyd file somewhere on your Python search path. Also ensure that MATLAB's BIN directory is somewhere on your DOS path, or else that you have copied MATLAB's LIBENG.DLL and LIBMX.DLL files somewhere on this path.
    2. Unix

    Add the pymat.cpp file to your Modules source subdirectory. You may need to rename pymat.cpp to pymat.cc so that C++ compilers will recognize the extension.

    You will need to add a line to your Modules/Setup file to indicate the presence of this new module. You will need to specify -I switches on this line to tell the compiler where to look for MATLAB's engine.h include file (usually in the extern/include subdirectory of the MATLAB root installation directory) and NumPy's arrayobject.h include file. You will also need the -L switch to indicate the location of MATLAB's shared libraries, and -l switches to include those libraries. For example, my line in the Modules/Setup file looks like this:

    pymat pymat.cc -I$(prefix)/include -I$(matlab)/extern/include
    -I$(numpy)/Include -L$(matlab)/extern/lib/lnx86 -leng -lmx -lmat
    -lmi -lut

    When recompiling Python you may need to manually specify a C++ compiler. For example, I found that I had to do the following:

    make CCC=g++

    Finally, you need to set an environment variable telling MATLAB where it can find its shared libraries. On most systems, this variable is LD_LIBRARY_PATH. On HP700 systems this variable is SHLIB_PATH. On IBM RS/6000 systems this variable is LIBPATH.

    Note that some makefiles are included in the PyMat distribution that may simplify this process.

    Alles anzeigen

    Soetwas hatte ich dann jedoch noch nie gemacht. Mit Hilfe der ^^ readme solltest du es jedoch hinbekommen. Anderenfalls findest du hier die Projektseite wo du auch Kontakt zu den Entwickler aufnehmen kannst.
    http://sourceforge.net/mail/?group_id=83384

    Torty

    "Carpe Diem" powered by positiv Feelings

  • Gast
    • 16. Januar 2007 um 15:05
    • #4

    Was ist denn mit skin gemeint, die Datei __init__.py gibts sehr oft.

  • Torty
    Kaiserliche Hoheit
    Beiträge
    1.558
    • 16. Januar 2007 um 15:17
    • #5

    Skin mein ein eigenes SKin-Produkt. Also einen Ordner in Products der z.B. meinSkin heißt und der verschiedene weitere Verz. und Dateien enthält die den eigenen Skin definieren.

    Ich denke jedoch nicht, dass du soetwas bereits erstellt hast, denn das würde eine weitere Weile Einarbeitung bedeuten. Somit käme für dich die pymat.html zum tragen.

    Torty

    "Carpe Diem" powered by positiv Feelings

  • Torty
    Kaiserliche Hoheit
    Beiträge
    1.558
    • 17. Januar 2007 um 17:07
    • #6

    Unter welchem OS betreibst du dein Zope?

    Torty

    "Carpe Diem" powered by positiv Feelings

  • Gast
    • 17. Januar 2007 um 18:41
    • #7

    Windows XP

  • Torty
    Kaiserliche Hoheit
    Beiträge
    1.558
    • 17. Januar 2007 um 18:52
    • #8
    Zitat

    1. Win32

    Simply place the pymat.pyd file somewhere on your Python search path. Also ensure that MATLAB's BIN directory is somewhere on your DOS path, or else that you have copied MATLAB's LIBENG.DLL and LIBMX.DLL files somewhere on this path.


    ... translate ...

    Zitat

    Die pymat.pyd-Datei einfach in ein Verzeichnis kopieren, welches im Pythonpath
    aufgeführt wird. Der Pfad zu den MATLAB Bin's (LIBENG.DLL and LIBMX.DLL) muss
    dabei im DOS-Pfad stehen (also Windows bekannt sein).


    ^^ sorry ist mal so frei übersetzt.

    Deinen Python-Path kannst du dir anschauen wenn du folgendes tust:
    * Rechtsklick auf Arbeitsplatz
    * Eigenschaften -> Erweitert -> Umgebungsvariablen
    Hier kannst du die Verz. ersehen die dein Python kennt. An der gleichen Stelle gibts die Variable Path, die quasi den DOS-Path darstellt.
    Um diese Werte zu ändern brauchst du nur den entsprechenden Eintrag markieren und auf bearbeiten klicken.

    Vielmehr würde mir dazu jetzt nicht einfallen. Sollte es nicht klappen so rate ich dir nochmal die entwickler anzuschreiben. Das ist definitiv der schnellste Weg für dich.

    Torty

    "Carpe Diem" powered by positiv Feelings

  • Gast
    • 18. Januar 2007 um 10:11
    • #9

    Danke, langsam wird mir die Sache klarer. Unter meinen Umgebungsvariablen hab ich leider kein Verzeichnis von Python. Kann ich das "manuell" einfügen?
    Hab an die Pymat Entwickler schon ein mail geschrieben, die haben keine Ahnung von Zope.

  • Torty
    Kaiserliche Hoheit
    Beiträge
    1.558
    • 18. Januar 2007 um 10:43
    • #10

    Das sollte Python bei der Installation gemacht haben. Und manuell kannst du die über "bearbeiten" hinzufügen.

    Die PyMat-Entwickler die das Zope-Modul erstellt haben, haben keine Ahnung von Zope?! Ich glaub die haben dich falsch verstanden.

    Torty

    "Carpe Diem" powered by positiv Feelings

Tags

  • hilfe
  • html
  • verzeichnis
  • windows
  • funktion
  • installiert
  • ordner
  • bearbeiten
  • datei
  • ts
  • mail
  • windows xp
  • xp
  • entwickler
  • error
  • script
  • source
  • schnittstelle
  • variable
  • value
  • skin
  • c++
  • importieren
  • python
  • zope
  1. Datenschutzerklärung
  2. Impressum
Community-Software: WoltLab Suite™
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche