Kivy - build 64bit application on 32bit Windows - python

I'd like build the kivy application which will work on 64bit Windows (and if possible 32bit also).
Is it possible that one app will work on both platforms?
Can I use 32bit system to build 64bit app?
This is probably simple questions, but I've never write code for these systems.

A lot of windows software is still shipped as 32bit-only, because for some reason compat with obsolete 32bit-windows still matters. Alternatively, 32 and 64bit builds are available.
If you write your source code properly (without any assumptions about being able to store a possibly-64bit type in an int), you can make 32 and 64bit builds from the same source. I think this is really unlikely to be a problem for python!
Building 64bit software on a 32bit platform is no problem. You'll only run into trouble if you have a complicated build system that builds some tools (which are part of what gets shipped, so you build them for the target instead of host), but also want to run those tools during the build.

Related

Accessing a 32bit with python on a Debian 64bit with CDLL lib (or other)

I'm trying for ages to access a 32bit C compiled lib within an 64bit Ubuntu. I'm using python and CDLL lib in order to make it happen but with no success so far. I can easily open the same 32bit lib on a 32bit OS, and the 64bit version on a 64bit OS.
So, what I'm asking is if anyone knows a way to encapsulate/sandbox/wrap the lib so I can achieve my goal. That way I can use a single 64bit server to access the 32 and 64bit versions of those libs.
If someone knows another python lib that can make the trick please let me know.
I am not sure if you can do this in the same process - we are talking about arithmetic here: 32bit pointers are different from 64bit pointers, so trying to reference them in the same process ... well, I am not sure what happens when trying to access a memory area which is not accessible or which is not supposed to be accessed (I guess Segmentation fault? ).
The only solution I can think of is it to have a separate Python 32 bit instance that runs in its own process. Then, with some form of IPC you can call the python32 bit instance from your 64 bit instance.
(apart from crazy hacks)
You have to have a 32-bit process to load a 32-bit library and call its functions.
You can install 32-bit version of Python side-by-side with native, 64-bit version on Debian.
See e.g. this question: https://askubuntu.com/questions/29253/how-can-i-install-a-32bit-python-on-64-bit-ubuntu
Or small hack using pyenv: https://github.com/yyuu/pyenv/issues/66
Or install binary pypy release: http://pypy.org/download.html#default-with-a-jit-compiler

Can Python program developed on 64-bit Windows run on all version of Windows?

I have developed a python application with 64-bit Windows 8 (the non metro version which looks like Windows 7 interface). I want to distribute it to all version of 64-bit Windows such as Windows XP, Windows 7 and etc. Is it possible for program developed with python to do that? Also, can the software run on 32-bit Windows os as well?
Well-written pure Python programs (just .py files) are extraordinarily portable across all platforms. If you're using some way of packaging your program in a Windows executable (.exe file), then you have worlds of other possible problems.
There are cases where a 64-bit program won't work on a 32-bit system, such as if your program uses massive data structures and you simply run out of address space on a 32-bit system. But, barring things like that, you should be fine.
If you want more specifics, I'm afraid you'll need to be more specific ;-)
If you have not used any 64 bit specific items the your code should run fine on all versions of windows from source code with a minimum installation of python and the dependencies.
For the python code itself, this won't very much be the problem, python code is quite portable.
However, you do need to using some porting tool specific for 32bit Windows to convert .py to .exe.
check this, http://www.pyinstaller.org/

How to make python modules compatible with different OS?

I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source code and modify it, and i have to make it compatible on these OS using my xp :D well my brother's pc is windows 7, but I don't have mac OS or linux (unless i can use VM)
EDIT
my application is not simple
You're asking a very general question. Perhaps overly general.
Generally, unless your application is relatively simple, it's impossible to guarantee that it is going to work on Linux and Mac OS X by only having Windows available. You will have to at least test it on Linux. Mac OS X is rather similar to Linux in many aspects, so you may get off the hook there, although for more complex cases it won't suffice.
Python is not much different from other languages in this respect - it makes writing cross platform code easier, but it won't solve all your problems.
Luckily, installing Linux on a VM is quick and free. Personally I use VirtualBox with a Ubuntu installation on top. It takes less than an hour to set up such a system from scratch (download Vbox, download an Ubuntu image and install it).
Your question is quite broad:
1) Development and testing:
Use VMs, absolutely, they are great for testing on OS you don't natively use, and to have a clean environment for testing (eg. test even windows stuff on a clean windows VM if you can, you might find out you're missing some dependencies that you took for granted on your dev machine).
2) Actual library porting:
Depending on the library this may or may not be difficult. Why is this library only working on windows? does it use specific DLLs, via ctypes or swig or some other bindings. If the library is python code (not a C library), is it tied to windows python APIs?
There are many things to take into account, if using system specific APIs/libs, can they be faked on other OSs (write small abstraction over them), or does it require a lot more code. You get the gist.

Python on windows7 intel 64bit

I've been messing around with Python over the weekend and find myself pretty much back at where I started.
I've specifically been having issues with easy_install and nltk giving me errors about not finding packages, etc.
I've tried both Python 2.6 and Python 3.1.
I think part of the problem may be that I'm running windows 7 in 64bit mode on an Intel T5750 chipset.
I'm thinking of downloading Python for windows extension http://sourceforge.net/projects/pywin32/files/, but not sure which version to get.
Why do packages have a specific AMD64, but not intel?
However, this may not even solve my problems. Any recommendations on getting Python to work in this environment?
I've currently got Python 3.1 installed, and removed 2.6
The most popular 64-bit mode for "86-oid" processor is commonly known as AMD64 because AMD first came up with it (Intel at that time was pushing Itanium instead, and that didn't really catch fire -- it's still around but I don't even know if Win7 supports it); Intel later had to imitate that mode to get into the mass-64 bit market, but it's still commonly known as AMD64 after its originator. For Windows 7 in 64-bit mode, AMD64 seems likely to be what you want.
The 64-bit-Windows downloads from activestate come with a few important pieces that aren't part of the standard python.org 64-bit Windows builds, and might perhaps make your life easier.

Is there a list of Python packages that are not 64 bit compatible somewhere?

I am going to move to a 64 bit machine and a 64 bit OS (Windows) and am trying to figure out if any of the extensions/packages I am using are going to be lost when I make the move. I can't seem to find whether someone has built a list of known issues as flagged on the Python 2.5 release page. I have been using 2.5 but will at this time move to 2.6. I see that the potential conflicts will arise because of the module relying on a C extension module that would not be compatible in a 64 bit environment. But I don't know how to anticipate them. I want to move to a 64 bit system to because my IT guys told me that is the only way to make a meaningful move up the memory ladder.
We're running 2.5 on a 64-bit Red Hat Enterprise Linux server.
Everything appears to be working.
I would suggest you do what we did.
Get a VM.
Load up the app.
Test it.
It was easier than trying to do research.
Perhaps you should figure out what "make a meaningful move up the memory ladder" means. Do you currently need to address more than 4GB of RAM? If not then you don't need a 64-bit system.
It really depends on the specific modules you are using. I am running several 64-bit Linux systems and I have yet to come across problems with any of the C modules that I use.
Most C modules can be built from source, so you should read about the Python distribution utility distutils to see how you can build these modules if you cannot find 64-bit binaries.
Whether a specific module will work in a 64-bit environment depends on how the code was written. Many modules work correctly when compiled for 64-bits, however there is a chance that it won't. Many popular modules such those from SciPy work just fine.
In short you will either need to just try the module on a 64-bit system or you will have to find the developer/project page and determine if there is a 64-bit build or if there are known bugs.
It seems like you already know this, but it's worth pointing out for the sake of completeness. With that said, remember that you shouldn't have any problems with pure Python packages.
Secondly, you also don't necessarily have to install the 64-bit version of Python unless you're planning on running a program that will take up greater than 4 GB of memory. The 32-bit version of Python should work perfectly fine on 64-bit windows.

Categories

Resources