Google App Engine Python 3.7 build error: `pip_download_wheels` returned code: 1

后端 未结 3 1134
离开以前
离开以前 2021-01-12 20:49

I am using Django REST Framework to deploy on Google App Engine and my requirements.txt file is as follows:

asn1crypto==0.24.0
astroid==2.1.0
bo         


        
相关标签:
3条回答
  • 2021-01-12 21:26

    Just had a similar problem after upgrading my Python version to 3.7. I am coding in Pycharm. I had to update my requirements.txt. Pycharm made this easy in the Tools - Sync Python Requirements menu item.

    After that, the app engine upload worked like a charm.

    0 讨论(0)
  • 2021-01-12 21:32

    For other people that arrive here where the above answer doesn't work for them. It could also be this issue documented in this post. Basically just remove pkg-resources==0.0.0 if it is included in your requirements.txt.

    0 讨论(0)
  • 2021-01-12 21:39

    It looks like your requirements.txt file is UTF-16 encoded:

    >>> b'p\x00y\x00t\x00z\x00=\x00=\x002\x000\x001\x008\x00.\x005\x00\r\x00'.decode('utf-16')
    'pytz==2018.5\r'
    

    How did you create this file?

    You can use this short script should re-encode the file correctly:

    with open('requirements.txt', 'rb') as source_file:
        contents = source_file.read()
    
    with open('requirements.txt', 'w+b') as dest_file:
        dest_file.write(contents.decode('utf-16').encode('utf-8'))
    
    0 讨论(0)
提交回复
热议问题