Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

[Dúvida] Erro quando instalar a VENV

Quando coloco o comando sudo apt install python3.10-venv aparece o seguinte erro:

ubuntu@ip-***:~/api-clientes$ sudo apt install python3.10-venv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3.10-venv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3.10-venv' has no install

De qualquer forma, fiz o comando seguinte (python3 -m venv venv) para ver o que aparecia:

apareceu o seguinte erro:

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.10-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/ubuntu/api-clientes/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

Tentei usar o comando que o erro indicou, mas aparece outro erro kkkk:

ubuntu@ip-***:~/api-clientes$ apt install python3.10-venv
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
1 resposta
solução!

Pesquisei aqui e o pra resolver o problema foi so ter feito o upgrade do sistema ubuntu com sudo apt update, dai atualizou várias coisas e quando fiz o comando da venv, funcionou conforme o vídeo do curso.

Pra quem teve algum problema também, ta aí o link que segui e funcionou: https://www.cyberithub.com/how-to-install-virtualenv-on-ubuntu-20-04-lts-focal-fossa/

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software