pyyaml: Cannot install/build on Python 3.7-dev

aws-cli depends on PyYAML>=3.10,<=3.12.

However, when running on Python 3.7-dev on Travis CI, PyYAML cannot be built:

    ext/_yaml.c:24215:11: error: ‘PyThreadState’ has no member named ‘exc_type’
         tstate->exc_type = local_type;
               ^
    ext/_yaml.c:24216:11: error: ‘PyThreadState’ has no member named ‘exc_value’
         tstate->exc_value = local_value;
               ^
    ext/_yaml.c:24217:11: error: ‘PyThreadState’ has no member named ‘exc_traceback’
         tstate->exc_traceback = local_tb;
               ^
    error: command 'gcc' failed with exit status 1

https://travis-ci.org/hugovk/aws-cli/jobs/335698944#L1466

This also affects other projects which depend on aws-cli, like pika:

  ext/_yaml.c: In function ‘__Pyx__ExceptionSave’:
  ext/_yaml.c:24143:19: error: ‘PyThreadState’ has no member named ‘exc_type’
       *type = tstate->exc_type;
                     ^
  ext/_yaml.c:24144:20: error: ‘PyThreadState’ has no member named ‘exc_value’
       *value = tstate->exc_value;
                      ^
  ext/_yaml.c:24145:17: error: ‘PyThreadState’ has no member named ‘exc_traceback’
       *tb = tstate->exc_traceback;
                   ^
  ext/_yaml.c: In function ‘__Pyx__ExceptionReset’:
  ext/_yaml.c:24152:22: error: ‘PyThreadState’ has no member named ‘exc_type’
     member named ‘exc_traceback’
       tstate->exc_traceback = local_tb;
             ^
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for PyYAML
  Running setup.py clean for PyYAML
Failed to build PyYAML

https://travis-ci.org/pika/pika/jobs/335516418

Any idea what’s up?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 54
  • Comments: 44 (13 by maintainers)

Commits related to this issue

Most upvoted comments

PyYAML-3.13 has been released and it works with Python 3.7.

homebrew just updated python3 to 3.7, which caused this to become a Big Problem. Expect a bunch of people arriving here with the same issue.

I am repeating what has been said in this thread, but since Python 3.7 release is approaching (b4 is out now), it would be truly awesome if a new package could be uploaded to PyPI (problem is fixed when installing from github). This would make the experience of testing the upcoming release much smoother.

@ingydotnet Thank you very much to you, the whole PyYAML team and contributors for your hard work over the last week getting all this stuff sorted!

FYI, we had a slight change in plans yesterday https://github.com/yaml/pyyaml/issues/193#issuecomment-401990322

PyYAML 3.13 should go out today or tomorrow. That will have PyYAML exact same as 3.12 but works with Python 3.7.

PyYAML 4.2 will be out in another week or more after 3.13.

This thread is kind of dead because pyyaml==3.13 fixed it. Simply use 3.13 with python 3.7.

@lyricnz Try this on homebrew 3.7:

pip3 install pyyaml==4.2b4

It worked for me. Hopefully that will be good enough until we can get 4.2 out.

Honestly just a fresh tag and new sdist would be great. The last tag is from 2016.

Yes, plans are in progress. Working with @alex to get this done. Will file an umbrella issue for the release process later today.

python:latest on dockerhub has pushed up to 3.7 release today which will break things for a few more people too

What are the commands that I need to use in a script besides pip3 install pyyaml==4.2b4 in order to install awscli and to update python and pyyaml versions to a working versions? I’m running docker with python image and get errors while running command pip install awscli

PyYAML 4.1 has been released, and I can confirm it can be installed on Python 3.7.

https://travis-ci.org/pylast/pylast/jobs/397353343#L479

And the workaround of installing from GitHub can be removed: https://github.com/pylast/pylast/pull/275.

Thanks everyone for the new release!

@zeyuye-airwallex and @prokher – please see issue #193 for the release plan to cope with this; it’s being actively worked on.

I encounter this issue several times a week and continue to add workarounds in dozens of projects - workarounds that I’ll have to remove later. Is there anything that can be done to cut a new release or even just publish wheels for the last release?

I think the Cython code just needs to be regenerated to be compatible with Python 3.7? Installing from git+https://github.com/yaml/pyyaml.git instead seems to work for me.

See https://github.com/cython/cython/issues/1955

Pinned CIrcleCI primary image to circleci/python:3.6.6-stretch and successfully installed awscli with one command: pip install awscli --upgrade --user.

@NaamaGertel with the python image, the easiest way would be revert to a 3.6 tag if you can. awscli will still install fine on that

@zeyuye-airwallex I can confirm, it is still here.

@ViktorHaag Yes, something like that. That PR was closed because the last PyYAML release was pulled. Let’s wait for the next release then make a fresh PR.

Correct. Once the release is made, other packages will need to update (or remove) their pins, like this https://github.com/aws/aws-cli/pull/3414.

@webknjaz Pip understands betas as well and correctly doesn’t propagate them as new releases until chosen explicitly

Somewhat ironic, but the latest checkin to git https://github.com/yaml/pyyaml/commit/298e07907ae526594069f6fdf31f2f1278cc1ae3 adds a fallback to the install process to use pure python if the C compile fails. So installing from git can have 2 pretty different outcomes, with different bugs.