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

Fixing zip command issue in Google Colab. #672

Closed
wants to merge 2 commits into from

Conversation

gmihaila
Copy link

@gmihaila gmihaila commented Dec 30, 2022

When running the Google Colab notebook implementation cell 5. Run AlphaFold and download prediction is throwing the following error:

NotImplementedError                       Traceback (most recent call last)
[<ipython-input-1-bc0091fa34e2>](https://localhost:8080/#) in <module>()
    577 sequence = 'AKIGLFYGTQTGVTQTIAESIQQEFGGESIVDLNDIANADASDLNAYDYLIIGCPTWNVGELQSDWEGIYDDLDSVNFQGKKVAYFGAGDQVGYSDNFQDAMGILEEKISSLGSQTVGYWPIEGYDFNESKAVRNNQFVGLAIDEDNQPDLTKNRIKTWVSQLKSEFGL'  #@param {type:"string"}
    578 
--> 579 run_prediction(sequence)

3 frames
[/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py](https://localhost:8080/#) in _run_command(cmd, clear_streamed_output)
    166   if locale_encoding != _ENCODING:
    167     raise NotImplementedError(
--> 168         'A UTF-8 locale is required. Got {}'.format(locale_encoding))
    169 
    170   parent_pty, child_pty = pty.openpty()

NotImplementedError: A UTF-8 locale is required. Got ANSI_X3.4-1968

As discussed in the issue: #483

This is more of a Google Colab issue when trying to create theoutput_dir zip file from theoutput_dir folder. I solved this by usingshutil to create the zip file.

I simply replace the line of code !zip -q -r {output_dir}.zip {output_dir} from cell 5. Run AlphaFold and download prediction with shutil.make_archive(output_dir, 'zip', output_dir)
I also made sure to add import shutil at the first cell.

This will create the zip file without using any terminal commands. This fix should not cause any issues in the future since we don't rely on the Google Colab terminal commands anymore.

@google-cla
Copy link

google-cla bot commented Dec 30, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gmihaila gmihaila mentioned this pull request Dec 30, 2022
@gmihaila
Copy link
Author

Added my CLA.

@Augustin-Zidek
Copy link
Collaborator

Fixed in 0d9a24b. Thanks for reporting!

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

Successfully merging this pull request may close these issues.

2 participants