Error installing Python applications on Ubuntu 17.04

Asked

Viewed 559 times

2

I want to put Jango, I’ve done all the process and everything, but when I do Pip install Django or other things related to python, always give this error.

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 will be grateful, this was not a command for Jango, but it is the same mistake. If you can help, I will be very grateful.

1 answer

0


As far as I know to install Django is via Pip and not apt-get. Another thing, to install Django it is recommended to use a virtualenv to avoid conflicts between projects if you are developing them simultaneously.

First install the virtualenv

sudo python -m pip install virtualenv

If it goes to python 3

sudo python3 -m pip install virtualenv

Create a folder for the project or if it already exists, log in. Inside the folder you will create an environment

python -m virtualenv "nome_do_ambiente"

Or if it goes 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 any questions about virtualenv, see the documentation Virtualenv Docs

If you cannot perform the above steps, try reinstalling python.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.