Failing to force Python 2.7.4 to run in 32-bit mode on OS X 10.8.3 - eclipse

I have been trying to force Python 2.7.4 to run in 32-bit mode on OS X 10.8.3 by default. I can get Python to run in 32-bit mode by running python32. But when I try to configure Eclipse+PyDev to run Python, it ends up running in 64-bit mode.
I have also tried
export VERSIONER_PYTHON_PREFER_32_BIT=yes
and
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
but neither seem to have any effect on my Python, and it still runs in 64-bit.
I was wondering if anyone has any idea how to permanently run Python 2.7 in 32-bit mode. Alternately, I am open to any solution that makes Eclipse/PyDev use the 32-bit Python.
My Python has been installed in /Library/Frameworks/Python.framework/Versions/2.7 and sys.executable returns /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python on my computer.
Thanks.

This made python go to 32-bit:
arch -i386 /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
import ctypes
print ctypes.sizeof(ctypes.c_voidp)
output -> 4
but I had the same issue as you that couldn't setup a permanent solution with environment flags as before.

Related

How to get Emacs on MINGW64 (Windows 10)

I currently use MINGW64 (Git Bash) as my terminal on my Windows 10 machine. It works great, I like it, but it only has Vim installed as an editor and I prefer Emacs. I'm unfortunately having a really awful time getting it to work in my terminal.
What's weirder still is that I have Emacs working in Cygwin64; but I don't like using that as my terminal. The most logical fix is simply that it Emacs to my Path ENV, however that doesn't seem to help (perhaps I'm doing that wrong?). I just get bash: emacs: command not found. I found a command to install it, using Pacman, however the Pacman command cannot be found either (which is weird because I thought that was installed by default with MINGW64.
Would love any and all help on this.
A couple of options:
Use Cygwin and the Cygwin emacs. Consider your Cygwin environment completely separate from Windows, so set your PATH from within the .bashrc, not within Windows. Launch emacs from the bash command-line.
Use the Emacs Windows binary distribution, but point to the utilities within Cygwin (there's an emacs package to help with this). Again, launch from the bash command line to inherit the bash environment within emacs.
Use the Windows Subsystem for Linux, with a Linux installation, and stick with emacs from there. You get the best of the Linux world, and access to the Windows directories and files as well.
My goto choice for MANY years was the Emacs Windows binary in conjunction with Cygwin. Once I started using the WSL, however, it just worked a lot better, in a clean Linux environment, and I could get terminal and GUI emacs (and other apps) running using the VcXsrv X Server. WSL has a version that directly supports X Windows, but I don't care for the windowing environment it uses, so I stick with VcXsrv.

NetBeans terminal window is gray and won't accept characters

I am running NetBeans 8.0.2 on a 64-bit Windows 7 PC. I was trying to follow Geertjan Wielenga's instructions for getting up and running with Scala in NetBeans 8.x.
The first instruction starts, "In the Terminal window, ..." so I selected Window > IDE Tools > Terminal. Instead of being a useable terminal window, the tab's content area was completely gray. I noticed that there seemed to be text flashing in the window before it went gray, so I clicked on the "Create New Local Terminal Tab" button multiple times until I was able to read the disappearing text:
Unable to start pty process
Searching for this phrase yielded results for C/C++ projects and the "Run" command, but I'm not doing a C/C++ project. How can I get the terminal window to a state where I can interact with it?
The NetBeans Terminal Emulator requires Cygwin. Importantly, the bitness of NetBeans must match the bitness of Cygwin. If you are using a 64-bit version of NetBeans, then you must use a 64-bit version of Cygwin; likewise 32-bit and 32-bit.
This comment by Andrew Krazny on NetBeans bug 234221 says:
A bitness of jdk/netbeans is important. Possible options are:
32-bit NB and only 32-bit cygwin is installed
32-bit NB and only 64-bit cygwin is installed
32-bit NB and both 32/64-bit cygwin are installed
64-bit NB and only 32-cygwin is installed
64-bit NB and only 64-cygwin is installed
64-bit NB and both 32/64-bit cygwin are installed
Cases 1) and 5) are 'ideal' - in this case everything should work and it is highly recommended that bitness of NB/cygwin match. This means that if one tries to use cygwin64 (s)he should install 64-bit java and run 64-bit version of NetBeans (netbeans64.exe).
Case 2) is almost nonfunctional. It requires cygwin64/bin to be in %Path%; compilation will work, but run is possible in 'External Terminal' only.
Case 3) NB will detect 32-bit cygwin and will use it by default. IF user tries to add cygwin64 as a toolchain and compile his code in 64-mode, run in 'Output Window' will not work. 32-bit toolchain is OK in this case
Case 4) is almost nonfunctional. It requires cygwin/bin to be in %Path%; compilation will work, but run is possible in 'External Terminal' only.
Case 6) 64-bit compilation/run will work, 32-bit run will fail.
In my case, I was using 32-bit Cygwin with 64-bit NetBeans. I installed 64-bit Cygwin, added a CYGWIN_HOME environment variable, and added %CYGWIN_HOME%\bin to the end of my path¹, and now I have a functioning terminal window.
¹which I hate doing because there are command names that overlap

Can't get ipython console in spyder

I'm having trouble getting an ipython console in Spyder. It only offers a python interpreter under the "interpreters" menu.
I've seen this issue for a couple of others in Stackoverflow, but didn't have much joy with the proffered solutions.
I'm running linux Mint 16 and have installed both ipython (v 1.1.0) and Spyder (v 2.2.1) the easy way via the Mint Software Manager. I made sure that I also installed ipython-qtconsole and verified that I could run it from a terminal (i.e. ipython qtconsole).
I can activate an ipython console using the following commands in a Spyder python console:
import IPython
IPython.start_ipython()
though the font coloring is strange and doesn't work well on a white background (e.g. error messages in yellow and light green). It would be nice anyway to be able to start ipython the normal way from the Spyder menu.
You may want to install python-zmq for Python 2 and python3-zmq for Python 3.
I use Ubuntu 14.04, so:
sudo apt-get install python-zmq python3-zmq
I'm also using Linux Mint (18.1, at this time) and I have faced the same issue.
What solved this for me was installing Ipython3 Qt console (that, of course, should be Ipython Qt console if you're using Python 2.x).
In case you have it installed, check if you have the latest version
(In Linux Mint you can do this through Synaptic, aptitude or apt-get.)

Is it possible to create a 32bit standalone executable on a 64bit machine?

I'm creating a standalone executable from MATLAB .m file using mcc.
My machine is a 64bit machine and the target machine is 32bit machine, is it possible to create such an application (and to be able to run it on the target machine of course)?
Probably the simplest way to do this is to install the 32 bit version of MATLAB and use the mcc from that installation.
Don't worry about the warnings that you get about installing 32 bit MATLAB on 64 bit Windows. It works just fine. I have lots of different versions of MATLAB installed on my machine for development purposes, both 32 and 64 bit, all happily co-existing side by side.
The documentation also mentions a -win32 option that can be passed to mcc:
-win32 Run in 32-Bit Mode
Use this option to build a 32-bit application on a 64-bit system only
when the following are both true:
You use the same MATLAB installation root (matlabroot) for both 32-bit and 64-bit versions of MATLAB.
You are running from a Windows command line (not a MATLAB command line).
Since you have to install 32 bit MATLAB, no matter what, it seems to me that it's just easier to run the 32 bit mcc directly.

Compile GTK+ with Cygwin

I have created an application in linux with GTK2 as GUI. It uses some linux-specific headers (e.g. arpa/inet.h) so to run under Windows I have to compile it with Cygwin. I downloaded the latest installer and choose to install GTK2 and its dependencies. My program compiled fine. But it needs X server to be running! I has old-style, ugly graphics and it doesn't open in a different window, like all Windows' applications do, but inside X server's window. Because of this it can't be portable. I found that guide, which is exactly what I need, but I get an error when I run "make" for GTK2 (undefined reference for _IID_IFilePersist, although I have uuid installed - also tried it with gtk2.20). Can you suggest what to do to build my application with cygwin? Or what do I need to install for the "_IID_IFilePersist" error? Thanks in advance!
There's prebuilt packages for windows that doesn't rely on X. http://gtk-win.sourceforge.net/home/index.php/Downloads
If you don't want X server to be running, then you're going to have to port the linux-specific parts of your code and compile with MinGW rather than Cygwin.