Can't use python-snap7 on Windows - snap7

I can get Snap7 working on Linux but not on Windows using Pycharm. I get:
WindowsError: [Error 193] %1 is not a valid Win32 application.
I have tried Python 32 and 64 bit version using all combinations of the snap7.dll, the ones in the archives Win32 and Win64. I'm using Windows7 64-bit Professional. What's going on?

I have been working on a Linux system also with Snap7 for the past few months, to come over to Windows to also receive this issue. Only reason I haven't noticed this sooner is because I have been using the ClientDemo in the Snap7 Package.
I have tried the following:
Going back to older versions of Python (e.g. 2.7 where the documentation says its compatible)
un-installing and installing the packages (Both Python and Snap7)
There is only one thing I can clearly think of, and that it is the OS. Not sure if its all flavors of Windows 7 however. The documentation for the installation also states:
"Python-snap7 is developer for snap7 1.1.0 and Python2.7. It is tested on Windows (8.1 64 bit) and Linux, but it may work on other operating systems. Python 2.6 and Python 3+ may work, but are not fully tested yet."
Link: https://python-snap7.readthedocs.io/en/latest/introduction.html
So perhaps by chance, we are just unfortunate and that it does not work with this specific OS?

Related

How to use PyGObject module (gi) on Windows and PyCharm?

I have Python 3.8.1 installed and I've followed PyGObject tutorial to install the module.
I've installed MSYS2 64 bits and I certainly can import the gi module using MSYS2 terminal:
However, if I run Python from the cmd prompt or from PyCharm, it won't work:
I want to be able to run my project from PyCharm. What am I missing?
Look at the first lines that both Pythons produce. They are different.
The command-line python is a 64-bit version compiled with GCC.
The Python inside pycharm is a 32-bit version compiled with MSC.
Bottom line: Pycharm is not using the Python that you installed PyGObject in.
Edit
If you're not using the second Python instance, and nothing else on your system is using it, then it is indeed useless.
Having said that, 32-bit programs on windows have a limited adress space (2.5 GiB, IIRC). For data-science projects that might be a significant limitation these days. So I would stick to 64-bit programs these days, unless your PC has less than 4 GiB of RAM. Then it makes sense to run 32-bit software.
Another point is that I've seen reports here on Stackoverflow that Pycharm can interact negatively with Python programs that run inside it. Especially if you are running multiprocessing. So you should always test your code from a standalone Python, not from within Pycharm.

Compile python 3 script to standalone exe in Linux

Can a python 3 script be compiled in a linux environment in such a way as it can be run under Windows?
If so what compile tool? ie. py2exe or pyinstaller ect.
You're looking for cross-compilation, and the answer is no.
Can I package Windows binaries while running under Linux?
No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.
Can I package Windows binaries while running under OS X?
No, this is not supported. Please try Wine for this.
Can I package OS X binaries while running under Linux?
This is currently not possible at all. Sorry! If you want to help out, you are very welcome.
You may use Wine or the Windows Subsystem for Linux to attempt using PyInstaller to build stand-alone binaries for different operating systems, however, neither PyInstaller, nor Py2Exe, nor cx_freeze, nor any tool to my knowledge does this.
Effectively, in-order to do something like this, you would need a cross-compiler such as MinGW or VC++ for Linux, and integrate it into PyInstaller, which is very far outside of the scope of the project. It is much easier to use WINE or having a dual-boot system or multiple development computers.

Has official 32bit support for cmake on Linux been dropped?

I don't mean the version(s) provided by the various distributions but the binary from the official website.
I have an old VM running 32bit OpenSUSE 12.1 that is configured for a project I'm working on at work. I need to install WebKitGTK. The problem is that the cmake in the repositories is ancient 2.x, while WebKitGTK at least 3.6 (or similar). So I went to the official website and (my fault) without looking too much into it downloaded the 3.10 installation for Linux.
Upon executing the binary that was installed I got the error that the file could not be run. I checked the execution rights and it was fine. Then it struck me...I ran file cmake and got 64 instead of the required 32bit.
I went back to the website and all I could find were 32bit versions for Windows but none for Linux.
I can build it from source but just out of curiousity would like to know if support has been dropped. I was unable to find any information so far.
32-bit support for CMake hasn't been dropped. They just don't provide binaries for it on their website as of CMake 3.7.0

How to compile FFProbe as stand-alone application? (Mac/Linux/Win)

I'm trying to compile FFMPEG (I'm actually only looking for FFProbe, which is included in the FFMPEG tools) as a standalone application for MacOS X, Linux and possibly Windows.
With standalone I mean that the libraries (x264, OpenJPEG, etc) are "embedded" into the executable so that I have to distribute only one executable for FFProbe - I apologize that I don't know the proper lingo for this (please let me know), I'm a newbie when it comes to this.
I have started by trying to do this under MacOS X, without any luck, but plan to do this for Linux and MacOS X as well.
I did see a few pre-compiled binaries that do this, and do not depend on extra libraries, but the versions I have found so far are either not the current version (1.x) or do not included the libraries in the executable (evermeet).
I followed several guides (for example: FFMpeg MacOSX Compilation Guide, reneVolution), with or without the use of Brew, but none of these show me how to embed the libraries in the executable.
I assume this is an option to be set for linking.
I'm not sure if it's appropriate to ask this question for Win, Mac and Linux at the same time - if it's not appropriate: I'd like to start with doing this for the Mac version.
My system runs MacOS X 10.9, XCode 5.0.2, with commandline tools and brew installed. I'm only looking for an Intel binary, so not a universal or PowerPC binary.
For Windows I can use either Windows 8.1 or XP, for Linux I currently use Ubuntu 12, all of which are virtual machines.
You need to install FFProbe with all the options, like in mac
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

64bit version of Octave on Windows

Does anybody know how to build Octave for x64 Windows? The 2GB data limitation for x32 is too limiting for many problems that require analysis on large data sets.
http://wiki.octave.org/Octave_for_Microsoft_Windows has information on installing Octave on Windows and links to building it from source using different methods.
GNU Octave is primarily developed on GNU/Linux and other POSIX conformal systems. The ports of GNU Octave to Windows use different approaches to get most of the original Octave and adapt it to Microsoft Windows idiosyncrasies...
Windows support is experimental.
According to http://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html
To use arrays larger than 2 GB, Octave has to be configured with the option --enable-64. This option is experimental...
Compiling Octave for 64 bit is experimental on Linux. It might cause a lot of headache to try an experimental feature in a port of the software. It would be better to use a true Linux installation for now. If you feel adventurous, try compiling it in http://www.cygwin.com/
I have installed Octave-4.0.0 into windows 7,8 and 10 in x64 platforms. All works perfectly well.
Just follow these steps
Download Octave-4.0.0_0-installer.exe from https://ftp.gnu.org/gnu/octave/windows/
Install the same - just follow the steps in the installer.
Find the build_packages.m file in C:\Octave\Octave 4.0.0\src
Open it in Octave and find
try install general-1.3.4.tar.gz, and try install signal-1.3.1.tar.gz, the versions are wrong.
Replace with 2.0.0 and 1.3.2 respectively.
In the build_packages.m file find
pkg ('install', pkgname, '-noauto').
Change it to
pkg ('install', pkgname).
Skip this and you will have to load the packages you require every time you use Octave. Lesser load for octave though. Sometimes it may take a while for the packages to get installed, kindly wait.
Run build_packages.m
load the packages
e.g. to load the general package - pkg load general
Note that the signal package is dependent on the control package.
I found that the plot function got octave stuck. The answer for the same is to type in at the command window
pkg rebuild -noauto oct2mat
Found this solution in Plot window not responding
Hope this works for u too. :)
I found Sreepad's ans is CORRECT. I use octave on win 10 64-bit OS.
octave 4.0.0 is ok as Sreepad said, But Octave 4.2.1 is not OK on Win 10 64-bit OS.

Resources