-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python 3 support to stimfit #79
Comments
I have a few questions on this topic. I'm assuming Stimfit still uses Classic since obviously it still has Python shell support. How much work would you think it would take to port over to Phoenix, assuming the embedded sample was implemented? For comparison, what would be the workload to change frameworks entirely? I remember this was suggested (half-jokingly) a few years ago. But I do see some appeal in the idea. In particular, I'm wondering whether it would be possible/practical to reimplement Stimfit in pure Python. I see a few benefits to pure Python. First is the obvious opportunity to move to a more well-supported framework (I don't know if wxPython has improved over the last few years, so this may be a moot point). |
I expect the workload to be reasonable. Back in 2013 I tried to use Phoenix and got it to the point where everything compiled.
Re-writing Stimfit in pure Python would amount to writing a completely new program. I would not have the resources to support such a project. There's also a non-negligible user base that uses the pure C++ version of Stimfit without any Python components. The advantage of this version is that it's extremely small and can be cross compiled for pretty much any host system in a matter of minutes with minimal dependencies. |
Your best bet to get Python 3 support for stimfit is to voice your support for the corresponding issue on wxPython. They have 237 open issues so they naturally need to rank these by importance. The same thing happens with Stimfit: I can only address issues if I'm sure that a large enough user base will benefit from the work. |
You can now give the Python 3 version a whirl on recent versions of Debian-based systems. Make sure that you build in a clean directory to avoid any conflicts with other versions. |
In addtition, I had to install |
I am using windows subsystem for Linux Ubuntu. |
configure can be generated with one of these commands: |
Interesting approach. I’d be curious if this works, though I thought that WSL does not support X? It might be difficult to get the graphical user interface to run.
At any rate, the configure script can be generated by using
./autogen.sh
…Sent from my iPad
On 4 Oct 2019, at 07:58, Anal Kumar ***@***.***> wrote:
I am using windows subsystem for Linux Ubuntu.
After doing 'git clone https://github.com/neurodroid/stimfit.git', I do 'cd stimfit'. Then when I run './configure' I get this error - '-bash: ./configure: No such file or directory'. Although when I do 'ls' it shows a file named 'configure.ac'.
Please help. I am trying to compile it for use in python3. autoconf is already installed.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This problem typically means that wxPython and wxWidgets use different library versions.
See https://bugs.launchpad.net/ubuntu/+source/stimfit/+bug/1778433
Why do you install wxPython through both apt and pip?
I’d recommend to delete the pip version.
… On 4 Oct 2019, at 12:18, Anal Kumar ***@***.***> wrote:
Thanks a lot. Here are the steps that worked for me:
sudo apt-get dist-upgrade
sudo apt-get install build-essential git libboost-dev python-dev python-numpy libhdf5-serial-dev swig libfftw3-dev libfftw3-doc fftw3 autoconf m4 python3-sip-dev python3-wxgtk4.0 libwxgtk3.0-gtk3-dev libhdf5-serial-dev
python3 -m pip install imutils pathlib2 wxPython --user
./autogen.sh
mkdir build
cd build
mkdir module
cd module
PYTHON=/usr/bin/python3 ../../configure --with-biosiglite --with-wx-config="wx-config --toolkit=gtk3" --enable-module --prefix=/usr
make
sudo make install
make clean
Some of the steps may be unnecessary and I don't know if '/usr' is correct for --prefix option. The stfio package now works for me in python3.
I won't be using the gui so not worried about stimfit. Although, it throws this when running stimfit from terminal:
With regard to X, Xming X server works for graphical interfaces with WSL.
Thanks a lot for developing stimfit.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Notes to myself:
conda deactivate
which python3 # /usr/bin/python3
python3 --version # Python 3.6.9
sudo apt-get install python3-wxgtk4.0
and get this error:
It returns:
It returns:
Select 3, and now gtk-unicode-3.0 is default: after that, repeating from steps 2 I get the same error: |
I do not see this error. The only difference is that I've only gtk3-unicode-3.0 installed (no gtk2-unicode-3.0, or base-unicode-3.0). Maybe there is still something left from an earlier installation ? Try "sudo make uninstall; sudo ldconfig; make distclean; ./configure ... && make && sudo make install " |
Jumping in with a possible unrelated issue. Is there an up to date guide for how to install Stimfit on Ubuntu (20.04)? I tried to follow the build guide in the docs and the comment here from analkumar2. Ended up at this error when I run sudo make install (not sure how much of the output is relevant): I initially tried running |
These a two separate issues, (1) is compiling from source, (2) is installing through the package manager. The second issue is, that stfio might not be build for python2 anymore on your platform, and it has been changed to "python3-stfio". So I suggest doing Moreover, you might run into conflicts if you are not careful about separating the two installation methods. |
The instructions to compile from source https://neurodroid.github.io/stimfit/linux_install_guide/requirement.html a fairly up-to-date. There should be no need to install wxPython from any other than the standard repository of your distribution (actually, this could cause incompatibilities). There are additional recommendations, when you compile stimfit souces from recent git.
That means, I recommend to run configure with these arguments : |
As we've moved to Python 3, I'm now closing this issue |
stimfit uses the wxWidgets library for its user interface. The integration of the Python shell into stimfit's user interface strongly relies on the
embedded
sample that shipped with older versions of wxPython, which is a Python interface to wxWidgets. These older versions of wxPython (codename 'classic') only support Python <= 2.7.The
embedded
sample is no longer available in newer versions of wxPython (codename 'phoenix') that include support for Python 3.I've discussed this topic back in 2013 (!) on the wxPython mailing list: https://discuss.wxpython.org/t/embedded-sample-for-phoenix/32518
Unfortunately I've never followed up on this issue.
To add Python 3 support to stimfit, we'd need an embedded sample for newer version of
wxPython ('Phoenix').
The text was updated successfully, but these errors were encountered: