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

Install and Adjust Locales #190

Open
michelmetran opened this issue Mar 4, 2024 · 0 comments
Open

Install and Adjust Locales #190

michelmetran opened this issue Mar 4, 2024 · 0 comments

Comments

@michelmetran
Copy link

I used mkdocs-jupyter to document a project called "brazilian-holidays":

There is a lot of use of pandas in the project and, in the development, I left a function that uses locale

df['dia_semana'] = df['date'].dt.day_name(locale='pt_BR.utf8')

I leave it to that I'm in trouble.

  1. when I use mkdocs serve, the code renders correctly.
  2. when I try to build the documentation in ReadTheDocs, it gives an error, as the locale is not installed!

I've already tried adjusting .readthedocs.yaml to install locales, but it gives an error.

build:
    os: ubuntu-22.04
    tools:
        python: "3.11"

    jobs:
        pre_create_environment:
            - locale -a
            #- sudo apt-get update
            # - apt-get update && apt-get install -y locales
        pre_install:
            #- apt-get update && apt-get install -y locales
            #- locale-gen pt_BR.UTF-8
            #- update-locale LANG=pt_BR.UTF-8​
            - date

After some attempts, I discovered that it is possible to install locales with tweaks to the file .readthedocs.yaml. I read this link.

build:
    os: ubuntu-22.04

    apt_packages:
        - locales

    tools:
        python: "3.11"

    jobs:
        pre_create_environment:
            - locale -a
        pre_install:
            - locale-gen pt_BR.UTF-8
            - update-locale LANG=pt_BR.UTF-8​
            - date

However, it gives an error in locale-gen pt_BR.UTF-8.
I received the message

[rtd-command-info] start-time: 2024-03-04T03:40:38.032279Z, end-time: 2024-03-04T03:40:38.293630Z, duration: 0, exit-code: 4
locale-gen pt_BR.UTF-8
sed: couldn't open temporary file /etc/sedJBmcXj: Permission denied

Is there any way to fix it?
Has anyone ever experienced this problem?

I know this is more related to Read The Docs restrictions, but this tends to occur more for those who use Jupyter

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

No branches or pull requests

1 participant