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

Erro ao compilar o wikilegis devido a versao do pip #114

Open
alexlopespereira opened this issue May 24, 2018 · 1 comment
Open

Erro ao compilar o wikilegis devido a versao do pip #114

alexlopespereira opened this issue May 24, 2018 · 1 comment

Comments

@alexlopespereira
Copy link

Comandos da compilação:
git clone --branch 2.0.0 https://github.com/labhackercd/wikilegis.git
cd wikilegis/
sudo docker build .

Mensagens de erro:

File "/var/labhacker/wikilegis/wikilegis/core/plugins.py", line 45, in get_installed_packages
installed = pip.get_installed_distributions()
AttributeError: module 'pip' has no attribute 'get_installed_distributions'
The command '/bin/sh -c python3 manage.py activate_plugin camara_deputados && python3 manage.py bower_install --allow-root && python3 manage.py compress --force && python3 manage.py collectstatic --no-input && python3 manage.py compilemessages' returned a non-zero code: 1

O problema foi resolvido fazendo um downgrade do pip (no Dockerfile) para a versão 9.0.1 conforme sugerido em Miserlou/Zappa#1471 (pip install pip==9.0.1).

Com este novo Dockerfile a compilação foi bem sucedida.

FROM labhackercd/alpine-python3-nodejs

ENV BUILD_PACKAGES postgresql-dev postgresql-client jpeg-dev
zlib-dev gettext

RUN apk add --update --no-cache $BUILD_PACKAGES
RUN mkdir -p /var/labhacker/wikilegis

ADD ./config/etc/cron.d/wikilegis /etc/cron.d/wikilegis
RUN chmod 0644 /etc/cron.d/wikilegis

ADD . /var/labhacker/wikilegis
WORKDIR /var/labhacker/wikilegis

RUN pip3 install -U pip &&
pip3 install -r requirements.txt psycopg2 gunicorn &&
rm -r /root/.cache

RUN npm install

WORKDIR /var/labhacker/wikilegis/wikilegis
RUN pip install pip==9.0.1
RUN python3 manage.py activate_plugin camara_deputados &&
python3 manage.py bower_install --allow-root &&
python3 manage.py compress --force &&
python3 manage.py collectstatic --no-input &&
python3 manage.py compilemessages

EXPOSE 8000
CMD ./start.sh

Seria interessante atualizar o Dockerfile do repositorio.

@msfernandes
Copy link
Contributor

Olá @alexlopespereira ! Obrigado pelo feedback!
A gente resolveu esse problema com o pip no commit 15b5419

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

2 participants