I have a pipeline with actions/setup-python and macos-latest as runner. The pipeline works well, I got an artifact but when I run it, the following error is raised:
zipimport.ZipImportError: can't decompress data; zlib not available
Solved! Solved! Go to Solution.
@Yanjingzhu sure, here is an example:
run-package-macos: name: test runs-on: macOS-latest steps: - name: Checkout uses: actions/checkout@master - name: Set up Python 2.7 uses: actions/setup-python@v1 with: python-version: 2.7 - name: install custom lib run: | cd lib pip install -r requirements.txt python setup.py install ... - name: build run: | ... python setup.py clean build ...
When I run the generated build, I got the zlib error. Same issue with python 3..8. Using this following wa it works well:
- name: install python with zlib wa run: | brew update brew install zlib export CFLAGS="-I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" export LDFLAGS="-L$(brew --prefix openssl)/lib" brew install pyenv pyenv install 2.7 pyenv global 2.7
Thxs a lot! :-)
Setup python action will not install zlib . So you need to install zlib in another step and export some environment variables. The solution you found is great. It is the same as what's tarrex said here: