Do someone know how to install package from this site: http://www.python-excel.org/ to CoDeSys? I wan to use excel file to read some variables into the python script.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-11-26
Originally created by: M.Schaber
Hi,
I did not try this myself, but I guess it should just work to unpack the module directories to some common parent directory, and then add that directory to sys.path from within the python script. Alternatively, you could try to copy the directories to the ScriptLib subdirectory ouf your CODESYS installation.
HTH,
Markus Schaber
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-11-26
Originally created by: M.Schaber
Hi, Daniel,
I did solve the problem: It seems that the future.py we deliver with CODESYS is an outdated version, it is fixed in recent IronPython versions (2.7.3 has the fix).
If you copy the attached future.py CODESYS scriptlib/ directory, it should work. (It did work on my machine with V3.5 SP1 Patch 4).
The future.py file is from IronPython 2.7.3, and it is identical to the one from cPython (ActivePython 2.7.2.4). There's a Thread on the mailing list covering that subject.
It's like never ending errors:)
After Your tip and trying to execute I have another error message: 'LightException' object has no attribute 'etree'.
In IronPython this is working.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-11-26
Originally created by: M.Schaber
Just for the record: It seems that import of xsl files works, but xlsx does not. I currently don't know how to fix that problem, my guess is that it might work once we update the IronPython version delivered with CODESYS.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Do someone know how to install package from this site: http://www.python-excel.org/ to CoDeSys? I wan to use excel file to read some variables into the python script.
Originally created by: M.Schaber
Hi,
I did not try this myself, but I guess it should just work to unpack the module directories to some common parent directory, and then add that directory to sys.path from within the python script. Alternatively, you could try to copy the directories to the ScriptLib subdirectory ouf your CODESYS installation.
HTH,
Markus Schaber
Hi,
I did copy the package directories to CoDeSys \ScriptLib directory, but there is still an error while trying to run the script. This is the example:
And the error message is:
Cannot import name nested_scopes
Originally created by: M.Schaber
Hmm, strange...
nested_scopes is a "from future" special feature. It should work with IronPython, too.
I'll try to find some time to look into that issue, but for diagnostic purposes, could you try to check whether it works with plain IronPython?
Thanks,
Markus
Originally created by: M.Schaber
Hi,
I just did see that your example code does the import the wrong way:
If you use "from xlrd import open_workbook", then you need to use "temp = open_workbook(...)" below.
http://pypi.python.org/pypi/xlutils.
Still, none of this works:(
Originally created by: M.Schaber
Hi, Daniel,
I did solve the problem: It seems that the future.py we deliver with CODESYS is an outdated version, it is fixed in recent IronPython versions (2.7.3 has the fix).
If you copy the attached future.py CODESYS scriptlib/ directory, it should work. (It did work on my machine with V3.5 SP1 Patch 4).
The future.py file is from IronPython 2.7.3, and it is identical to the one from cPython (ActivePython 2.7.2.4). There's a Thread on the mailing list covering that subject.
I did open CDS-31786: ScriptEngine: nested scopes don't work, feel free to add yourself as an interested customer via your support contact.
HTH,
Markus
future.zip [1.65 KiB]
Thank You for reply.
Can You also check the attachment, because when I try to download it there's a message "file not found"?
Originally created by: M.Schaber
I can download it from the internal network, but not externally (with my smartphone). I'll contact our admins...
the IronPython Github repository (use the "RAW" button on that page).
It's like never ending errors:)
After Your tip and trying to execute I have another error message: 'LightException' object has no attribute 'etree'.
In IronPython this is working.
Originally created by: M.Schaber
Just for the record: It seems that import of xsl files works, but xlsx does not. I currently don't know how to fix that problem, my guess is that it might work once we update the IronPython version delivered with CODESYS.