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
Python3 support #250
Python3 support #250
Conversation
These changes are made by simply running 2to3 and manually applying the suggested changes.
This requires a lot of changes to apptools that are not yet available. More fixes are necessary but a basic `mlab.test_plot3d` works.
The old one does not work with Python3.
A few are still failing intermittently and will be fixed later. These require corresponding changes to apptools.
This was causing some of the UI elements to not show due to an error. Now, the basic dialogs work correctly.
Choose the classes to build in a better way so only those derived from vtkObjectBase are wrapped. Fix issues wrapping certain color traits that use 0-255 color ranges instead of floating point values. Fix test errors.
The center was not being explicitly set and this seems to cause test failures.
The tearDown method was raising an exception too soon causing other unrelated tests to fail.
The `image_data` is the input which is modified using the `change_information_filter`. So the `outputs[0]` is what should really be the dataset generated by this source.
This works around erratic errors that are really not testing errors. `get_engine` is smart enough to provide a null engine when the backend is set to test so we use that instead of creating a fresh NullEngine. This works much more reliably.
This caused test failures since the scene was not picklable and could not be restored.
With the new wrapping mechanism in VTK 6.3 for Python 3, `dir(vtk.vtkSomething)` will contain all the methods including those of the parent whether overridden or not. This causes bloat in the wrappers and also errors since some ignored methods are not not ignored by subclasses.
While I still have not got this to work, I've run into some small issues
The call to build the docs fails on execfile(os.path.join('..', '..', '..', 'mayavi', '__init__.py'), d) |
When I work around the doc issue, I can install it, but it will not import mlab:
|
Thanks to @mabi for reporting this.
@mabl -- thanks for picking those issues, I've pushed fixes for them now. |
Apptools saves the script as unicode.
@prabhuramachandran This works! Thank you so much! A simple
was enough (the dependencies were already up-to-date). You have my vote to get that merged. |
@mabl -- thanks for testing this! You should actually use the https://github.com/enthought/mayavi.git repositories feature/python3 branch as it is the main one. Will ask @dmsurti to do a review and merge this ASAP. |
@prabhuramachandran The appveyor failure is due to this known issue, #233. Needs a docs updated in a separate PR: Issue #274. Also issues need to be opened for known issues listed in the PR description. The other issues need to be opened for: Updating CI for both py2/py3. My only question is around why we did not use a tool (modernize/futurize) to update the code? But otherwise LGTM. Once the issues are listed, which I will do later, I will merge this!!! |
@prabhuramachandran All known issues have been logged. Will you be pushing more updates to this PR? |
@dmsurti -- No, nothing planned for now. It would be good to have this merged and then work on the other issues slowly. We could potentially put out a release as I think this resolves a bunch of issues with recent VTK versions. |
Merged. Ingoring the appveyor failure as it is due to this known issue, #233.
LGTM. Thanks @prabhuramachandran. |
I currently can't get this to work using the git master:
I'm using anaconda python 3.5 on OSX. VTK is built and I can import it successfully. I installed this by downloading the zip of the repo, and running pip install on it. Any help would be appreciated. |
Never mind, I worked it out. For anyone else, assuming you like to live life on the edge, you need to pip install https://github.com/enthought/apptools/archive/master.zip |
Just some quick postive feedback 1.) VTK-7.0.0-cp34-cp34m-win_amd64.whl (http://www.lfd.uci.edu/~gohlke/pythonlibs/#vtk) |
@solarjoe I installed WinPython-64bit-3.4.4.1, following which I downloaded VTK-7.0.0-cp34-cp34m-win_amd64.whl from the above link. However,, when I try to install VTK using the WinPython control panel, I get the following error message:
My environment is 64 bit, Windows 7. Did you ever see the above error, or would you know how to resolve this issue? Any suggestions will be useful. Thank you very much. |
Hello @indranilsinharoy, yes, I also came across that issue, it should be fixed in the next WinPython release. Other workarounds to fix the naming detection are listed here: Or you can rename the package, I guess VTK-7.0.0-cp34-none-win_amd64.whl Have fun with Mayavi! |
Thank you very much. The first solution worked out rather well for WinPython-64bit-3.4.4.1. Interestingly, since I already had WinPython-64bit-3.5.1.1 I was eager to test the solution on WinPython-64bit-3.5 (that want I wouldn't need to keep two version of WinPython). For whatever reason, I couldn't get VTK-7.0.0-cp35-cp35m-win_amd64.whl to install. So, for now I will just stick with WinPython-64bit-3.4.4.1. |
The aim of this PR is to solicit feedback and merge this early for those who want to cut themselves on the bleeding edge.
This adds experimental Python3 support for Mayavi. To use it one requires a recent version of apptools and envisage (by recent I mean that these PRs should be merged enthought/apptools#54 and enthought/envisage#61 ).
It requires the master branch of pyface.
It will require the latest version of VTK from their git repository (https://gitlab.kitware.com/vtk/vtk) and a fresh build of VTK configured for Python3. I have not bothered with travis CI support at this point due to the complexity of doing that. These changes pass all current 2.7.x tests on travis so should be safe to merge.
Status and known issues