Skip to content
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

Python 3 support? #13

Open
AndrewAnnex opened this issue Nov 21, 2013 · 5 comments
Open

Python 3 support? #13

AndrewAnnex opened this issue Nov 21, 2013 · 5 comments

Comments

@AndrewAnnex
Copy link

So I am trying to use PySpice in Python 3, I made a new Fork from drbitboy's most recent work and I have made all of the necessary changes to all of the python files (except for any changes to mkwrapper.py, see below). As of now I have it successfully compiling and installing the library on OSX 10.9 (with python 3.3.1) , but if I try to import spice you can see the attached image:
screen shot 2013-11-21 at 4 09 58 pm
I also tried installing it on a 32bit ubuntu 12.04 LTS VM, with Python 3.2 and got a similar error (except with pystring_fromstringandsize) and a couple of warnings during compiling.

I have never used the Python API, so I am not sure what exactly has changed between python 2 and 3. Any chance that this could be looked into? I will of course continue to try things, but I would appreciate some assistance or suggestions of what to look at.

@michaelaye
Copy link
Collaborator

Sorry, at least I don't have resources to check on Python3. As long as my favorite distribution does not release in Python3 I have to stay with Python2 because I don't have the time to compile all modules I need on my own.

@rca
Copy link
Owner

rca commented Nov 29, 2013

The Expected in: flat namespace line sparks vague memories related to 32/64-bit fat binaries on OS X. This may not be much of a lead, but maybe see what you can dig up with respect to the Python3 you are using and whether you are compiling the module for more architectures than Python is built for.

@AndrewAnnex
Copy link
Author

Yes I remember seeing some things relating to this but the fixes don't look easy/ are not well documented. I may have to reconfigure my mac a lot. If anyone is willing to try installing my fork on a correctly configured computer please do so. I won't really be able to do anything until late December (I am an undergraduate, final exams and such..).

I found this page where people discussed this issue: http://stackoverflow.com/questions/1929180/python-config-ldflags-on-mac

@AndrewAnnex
Copy link
Author

So I think I resolved whatever issues existed on my Mac in regards to linking during compilation (although I broke ipython, grumble). I started getting clearer error messages during compilation and finally discovered today that there were some significant differences in the C API's for Python 2.X and 3.X. For example in P3K, PyInt and PyString don't exist apparently (you use PyLong and PyUnicode or PyBytes in p3k). I went through and made a first naive attempt of fixing these issues by replacing code where needed and modifying the init_spice function generated by mkwrapper.py. I have successfully been able to compile and install my fork, and some simple functions work! Some of the tests from drbitboy's fork are successful, some seg-fault and some crash entirely. So clearly I will need to do more testing to work the wrapper into shape.

@rca
Copy link
Owner

rca commented Dec 5, 2013

That's great progress; nice job!

On Wednesday, December 4, 2013, Apollo117 wrote:

So I think I resolved whatever issues existed on my Mac in regards to
linking during compilation (although I broke ipython, grumble). I started
getting clearer error messages during compilation and finally discovered
today that there were some significant differences in the C API's for
Python 2.X and 3.X. For example in P3K, PyInt and PyString don't exist
apparently (you use PyLong and PyUnicode or PyBytes in p3k). I went through
and made a first naive attempt of fixing these issues by replacing code
where needed and modifying the init_spice function generated by
mkwrapper.py. I have successfully been able to compile and install my fork,
and some simple functions work! Some of the tests from drbitboy's fork are
successful, some seg-fault and some crash entirely. So clearly I will need
to do more testing to work the wrapper into shape.


Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-29869095
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants