Package it missed in Installation in Python virtual environment

Following the advance guide to set enviroment in raspberry pi B, the python3-dev package is not found

pi@raspberrypi:~ $ apt-get install python3-pip python3-venv
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package python3-dev 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-dev’ has no installation candidate

pi@raspberrypi:~ $ sudo python --version
Python 2.7.13

the installation cannot continue because it prompts:

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-get install python3-venv

Does exist any workaround for it?

Thanks in advance

What version of Raspbian do you have installed?

On both Stretch (current) and Jessie (previous) I can see python3-dev if I do

apt-cache search python3-dev

May it will work this way?

python3.6 -m ensurepip
pip3 install --upgrade virtualenv

hi Troy,

It turned out that I had done this, it worked:

  1. sudo apt-get install python3
  2. sudo apt-get install python3-pip
  3. update and upgrade again and then
  4. sudo apt-get install python3-venv for install virtual enviroment on python3
1 Like

Glad you were able to get it sorted!

The following worked for me:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-venv
3 Likes

the only thing that worked for me! Thank you

Thanks - this was perfect

Worked for me…the only thing…