How do I switch from Python 64-bit to 32? - python

I'm using Python 3.4 on Windows 8. I'm thinking of changing as some packages do not work with 64-bit. If I do change to 32, will it affect the programs that I wrote on 64?

Python code won't be affected, not much. You won't be able to allocate as much memory, mostly. That's about it.
If you have 3rd party libraries installed that make use of C extensions, you'll have to reinstall 32-bit versions of those (or compile them yourself).

Related

Does using site packages installed for 32-bit Python introduce memory limitations if they are also used with 64-bit Python?

Aside from the obvious solution of "just install the respective package(s) with your 64-bit Python version", and aside from justifying valid use cases, I am after some technical insight into this scenario.
As an example, say I am running a Python script with a 64-bit Python version, which includes something along the lines of below:
sys.path.append("some 32 bit Python version site package path")
import some_32bit_library
# do stuff with some_32bit_library...
Such that some_32bit_library is being imported and used from the 32-bit version of Python.
Even though the overall script is run with a 64-bit Python, will importing and using this some_32bit_library introduce a memory limit because it is from a 32-bit version?
I am aware that a 32-bit application itself is limited to accessing ~4GB of memory. The question is, will using the 32-bit library via a Python script running with a 64-bit version also have the same ~4GB limitation?
Any answer/insight would be appreciated, thank you.
It simply will not work. When a package is labeled 32 or 64, that means it contains binary libraries. You cannot load a 32-bit library into a 64-bit process, nor vice versa.
If the package is Python only (no binary), then it is probably bit-for-bit identical, and will work fine.

Which version of python do I have to download for pyscripter?

so basically I'm trying to install pyscripter for my computer, and am aware that Python 2.4 or higher is needed to run the program.
My computer specs, first of all, are:
Windows 10 (64bit)
Intel CPU
4GB ram
(or at least the important ones)
Now when I go to python.org, there are about a thousand different downloads available like 'Python 3.7.0a1' or '3.6.3rc1' or '2.7.14', most of them being x86, and some of them having x64 next to them which I am assuming is 64 bit, and some of these files are a .zip file, executable file, MSI installer etc. What I want to know is:
Which one of these do I have to download for my system?
Does MSI matter?
Does x64 mean that the file is going to be 64 bit?
Does installing version 2 or version 3 (I am aware of the differences between version 2 and version 3) change the way that pyscripter runs?
Which one of these do I have to download for my system?
You can install 2.7.14 version of python to run pyscripter. On a seperate note you can intall/run multiple versions of python on your machine if you want/require.
Does MSI matter?
It's a installer for microsoft operating systems.
Does x64 mean that the file is going to be 64 bit?
Yes
Does installing version 2 or version 3 (I am aware of the
differences between version 2 and version 3) change the way that
pyscripter runs?
No - However you can configure pyscripter to use a specific version of python as per the requirement.
I used pyscripter too for a while but eventually you have to switch to something more modern. As far as I remember it works up Python 3.4.4 and then stops. Also they no longer develop it.
My advice is start with an editor that is being developed (I use Pycharm and they have a free of charge community edition). You will eventually need all those plugins and version controll support, database interactions etc. etc. all in one package.
This way you learn an editor that has a future. Don't repeat my mistake of learning Pyscripter and then realising it is not supported anymore and Python 3.6 does not work on it :).
I started not so long ago as well.
Good luck!
PyScripter supports all python versions from 2.5 up to 3.7 both 32-bit and 64-bit. Just make sure you use the 32-bit version of PyScripter with 32-bit versions of Python and the 64-bit version of PyScripter with 64-bit versions of Python.

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/

Run Python 64bit In 32Bit mode?

Note: Running windows7X64
I want to use some audio functions I have seen allot for python 2.7 like snack and such, however I'm using python 3.3. I have come across pygame.py that has some audio functions however pygame doesn't support 64bit arch yet.
So can it be done? if not do we know of any python audio integration modules that can get the job done on python 3 with a 64bit arch
Yes I can just install python 3 32bit but that seems counterproductive and unnecessarily complicated.
Thanks
Ben
You'll have to install 32-bit Python to run 32-bit extension modules. In my experience, two Python installations can live side-by-side quite nicely on Windows, as long as you make sure your environment (PYTHONPATH esp.) is set properly.
Have you tried this?
$ defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
Edit: For the sake of sharing information, this will work (at least from my experience) on a Mac; however, it will not work on a Windows.

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