heroku-buildpack-scipy icon indicating copy to clipboard operation
heroku-buildpack-scipy copied to clipboard

Support Python 3.4.1 runtime?

Open wmayner opened this issue 10 years ago • 21 comments

Thanks for this very useful buildpack! Is there any way to get it working with 3.4?

wmayner avatar Dec 20 '14 23:12 wmayner

I would need to recompile all the packages for python 3.4. It's on my list of things to get to sometime soon...

branliu0 avatar Dec 21 '14 19:12 branliu0

Ok, let me know if I can help in some way! On Dec 21, 2014 2:44 PM, "Brandon Liu" [email protected] wrote:

I would need to recompile all the packages for python 3.4. It's on my list of things to get to sometime soon...

— Reply to this email directly or view it on GitHub https://github.com/thenovices/heroku-buildpack-scipy/issues/14#issuecomment-67781878 .

wmayner avatar Dec 21 '14 21:12 wmayner

If you're really interested, one big TODO is to set up testing. Right now I've been manually testing, but once I get more packages set up, testing by hand is not very practical...

branliu0 avatar Dec 31 '14 07:12 branliu0

I also need Python 3.4 support.

@thenovices can you please explain how you build packages? I see that https://github.com/thenovices/npscipy-binaries mentions using virtual machines, do you have some scripts to do it or do you do everything manually?

abezzub avatar Feb 24 '15 23:02 abezzub

Sorry, I'm pretty busy for the next two months so probably won't get to it... I build the packages manually. Basically, the amount of repetition thus far has been too low to merit the investment needed to script it...

branliu0 avatar Feb 24 '15 23:02 branliu0

No problem. Do you just use VM with Ubuntu of the same version that Heroku uses? Or are there some additional requirements? Thanks

abezzub avatar Feb 25 '15 02:02 abezzub

Yeah, I think the three things are:

  1. Correct version of Ubuntu
  2. Correct version of GCC
  3. Same Python. In the case of Python 2, this meant that the Python had to be compiled with UCS2 instead of UCS4 (iirc). Not sure if this same logic applies for Python 3. But if I compiled the numpy package with a different Python (i.e., compiled with UCS4), then I would get a runtime error when I ran numpy on Heroku.

As far as I can remember, these were the only gotchas. The last thing is that the directory of the tarball needs to be correct. It looks like this for Python 2.7

venv/lib/python2.7/site-packages/numpy venv/lib/python2.7/site-packages/numpy-1.9.0-py2.7.egg-info

branliu0 avatar Feb 25 '15 10:02 branliu0

Quick note: for the new cedar-14 stack, sys.maxunicode is 1114111, which would indicate Python compiled against UCS-4

EDIT: this is incorrect as noted below, using the cedar-14 stack with Python 2.7.9, sys.maxunicode is actually 65335, which means you want a Python binary compiled against UCS-2

andrewychoi avatar Feb 25 '15 15:02 andrewychoi

Thanks, good to know!

branliu0 avatar Feb 25 '15 15:02 branliu0

Revision to the above: the Python version on the new cedar-14 stack is actually 2.7.9, and sys.maxunicode is 65535. I think what happened was that I ran the code on the old cedar stack, and on that stack, the default Python version is 2.7.6 and sys.maxunicode is 1114111.

In any case, I've built a Vagrant script and a few shell scripts to interact with the VM. Hopefully this bridges some of the gap to build new versions.

The scripts are here: https://github.com/andrewychoi/npscipy-binaries and more specifically: https://github.com/andrewychoi/npscipy-binaries/tree/master/vagrant

andrewychoi avatar Mar 23 '15 18:03 andrewychoi

@andrewychoi did you manage to get a python 3.4 version of this going? Anyone else?

feliperyan avatar Aug 08 '15 15:08 feliperyan

I ended up using conda to install math packages. There was a Python 2 buildpack for conda that I tweaked to work with Python 3: https://github.com/teamupstart/conda-buildpack

abezzub avatar Aug 08 '15 19:08 abezzub

@feliperyan No, I haven't tried getting this working on py3.4, but I'd imagine the changes are straightforward to make in the vagrant provisioning file: https://github.com/andrewychoi/npscipy-binaries/blob/master/vagrant/provision_numpy_scipy.sh

andrewychoi avatar Aug 10 '15 14:08 andrewychoi

@andrewychoi Thanks for this Andrew, I'm new to Vagrant - I can see the Vagrantfile picks up on provision_numpy_scipy.sh but there are a number of other bash scripts in there. They seem to be auxiliary scripts to be ran by the host which do a few things in the box.

Do I need to worry about them at all? They make references to python 2.7

feliperyan avatar Aug 11 '15 07:08 feliperyan

Yes, they're scripts I used to construct the binary packaging. Essentially they ssh into the vagrant image, and copy the associated numpy/scipy files out to a new zipfile.

Looking at a couple of py3.4 projects I have, you'll need to change the prefix from venv/lib/python2.7 to venv/lib/python3.4 in those scripts.

andrewychoi avatar Aug 11 '15 14:08 andrewychoi

Thank you @andrewychoi I might still give this a go at a later stage but for now I have followed @abezzub and got it working with the condo buildpack he kindly shared with us. Btw my intention was to get Palladium working on Heroku, which I now have done.

feliperyan avatar Aug 14 '15 03:08 feliperyan

Any plans to still support 3.4 or is that no longer happening? Thanks! :smiley:

FreshDonut avatar Mar 31 '16 21:03 FreshDonut

I'll get around to it someday, but I'm pretty busy these days :/

branliu0 avatar Apr 02 '16 06:04 branliu0

No worries. : )

FreshDonut avatar Apr 02 '16 10:04 FreshDonut

Yo, I ended up getting it to work. My goal was to run palladium on it. From memory it involved using P3.4 On Sat, 2 Apr 2016 at 21:11, byooo [email protected] wrote:

No worries. : )

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/thenovices/heroku-buildpack-scipy/issues/14#issuecomment-204687699

Sent from a mobile device, may contain spelling mistakes and traces of nuts.

feliperyan avatar Apr 02 '16 11:04 feliperyan

I've forked this project to support additional libraries (gensim) for textmining under python 3.4.x. You can pull the binaries from that project which should make it easy to upgrade this one to 3.4.x. See :

https://github.com/brianthomas/ubuntu-textmining-binaries

which support the textmining buildpack:

https://github.com/brianthomas/heroku-buildpack-textmining

brianthomas avatar Apr 30 '16 13:04 brianthomas