Error installing applications in relation to Python in Ubuntu 17.04

1

I'm trying to put django, I've done all the process and everything, but when I do pip install django or other things related to python,

marcos@MarcosViana:~$ sudo apt-get -f install
Lendo listas de pacotes... Pronto
Construindo árvore de dependências       
Lendo informação de estado... Pronto
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 13 não atualizados.
4 pacotes não totalmente instalados ou removidos.
Depois desta operação, 0 B adicionais de espaço em disco serão usados.
Configurando python-setuptools (33.1.1-1) ...
/var/lib/dpkg/info/python-setuptools.postinst: 6: /var/lib/dpkg/info/python-setuptools.postinst: pycompile: not found
dpkg: erro ao processar o pacote python-setuptools (--configure):
 sub-processo script post-installation instalado retornou estado de saída de erro 127
Configurando python-sqlparse (0.2.2-1) ...
/var/lib/dpkg/info/python-sqlparse.postinst: 6: /var/lib/dpkg/info/python-sqlparse.postinst: pycompile: not found
dpkg: erro ao processar o pacote python-sqlparse (--configure):
 sub-processo script post-installation instalado retornou estado de saída de erro 127
Configurando python-tz (2014.10~dfsg1-0ubuntu2) ...
/var/lib/dpkg/info/python-tz.postinst: 6: /var/lib/dpkg/info/python-tz.postinst: pycompile: not found
dpkg: erro ao processar o pacote python-tz (--configure):
 sub-processo script post-installation instalado retornou estado de saída de erro 127
Configurando python-django (1.8.7-1ubuntu11) ...
/var/lib/dpkg/info/python-django.postinst: 6: /var/lib/dpkg/info/python-django.postinst: pycompile: not found
dpkg: erro ao processar o pacote python-django (--configure):
 sub-processo script post-installation instalado retornou estado de saída de erro 127
Nenhum relatório apport escrito pois MaxReports já foi atingido
                                                               Erros foram encontrados durante o processamento de:
 python-setuptools
 python-sqlparse
 python-tz
 python-django
E: Sub-process /usr/bin/dpkg returned an error code (1)

If you can help me I'll be grateful, this was not a command for django, but it's the same error. If you can help, I'll be very grateful.

    
asked by anonymous 16.05.2017 / 06:47

1 answer

0

As far as I know how to install django is via pip and not apt-get. Another thing to install django is to use a virtualenv to avoid conflicts between projects if you are developing them simultaneously.

First install virtualenv

sudo python -m pip install virtualenv

If it's for python 3

sudo python3 -m pip install virtualenv

Creates a folder for the project or if it already exists, enter it. Inside the folder you will create an environment

python -m virtualenv "nome_do_ambiente"

Or go to python 3

python3 -m virtualenv "nome_do_ambiente"

Now you activate the environment and install the necessary dependencies for the project

source nome_do_ambiente/bin/activate
python -m pip install django

If you still have questions about anything about virtualenv, see the documentation Virtualenv Docs

If you can not perform the above steps, try reinstalling python.

    
17.05.2017 / 13:36