Page 1 of 1

Any Python programmer overthere ?

PostPosted: Mon Aug 19, 2013 9:52 pm
by David de Argentina
Hi all,

I created a program that uses the Chromium WebBrowser component.
I created an instalation package for the common libraries of Chromium.
The purpose is, each time a NeoBook program needs this component, it will be available with only one download.
I had used the Inno Setup to do this installer.
The package install fine at %PROGRAMFILES%\Chromium Components Folder.
The PATH enviroment variable was updated with the new Folder.

Now, the problem.
The source code of the Chromium Component for NeoBook is written in Python.

Python program has this code:

Code: Select all
# CEF Python 3 example application.

# Checking whether python architecture and version are valid, otherwise an obfuscated error
# will be thrown when trying to load cefpython.pyd with a message "DLL load failed".
import platform
if platform.architecture()[0] != "32bit":
    raise Exception("Architecture not supported: %s" % platform.architecture()[0])

import os, sys
libcef_dll = os.path.join(os.path.dirname(os.path.abspath(__file__)),'libcef.dll')
# libcef_dll = 'libcef.dll'
if os.path.exists(libcef_dll):
   # Import the local module.
   if 0x02070000 <= sys.hexversion < 0x03000000:
       import cefpython_py27 as cefpython
   elif 0x03000000 <= sys.hexversion < 0x04000000:
       import cefpython_py32 as cefpython
       raise Exception("Unsupported python version: %s" % sys.version)
   # Import the package.
   from cefpython3 import cefpython

import cefwindow
import win32con
import win32gui
import time
import json
import cefpython_py27

When i run this program, i get an error message telling program can't find some libraries

If I replace the Line:
libcef_dll = os.path.join(os.path.dirname(os.path.abspath(__file__)),'libcef.dll')
libcef_dll = 'libcef.dll'
Program attempts to load the "libcef.dll" from the program folder. if exists, program works fine. else, another error message tells can't find some libraries.

If i add the line:
sys.path[0:0] = "[ProgramFiles]\Chromium Components"
Program knows -exactly- where are located the libraries. But does not work.

Does any know how to normalize the path for load libraries, in order to make a "NeoBook program distribution", without the Chromium libraries, that could be installed from another installer ?

Thanks in advance,
David de Argentina