0

I've been asked to test some software I've developed on Ubuntu 16.04, and annoyingly I only just upgraded to 17.10. SO I created an Ubuntu 16.04 boot usb drive and thought I'd try my code from there. But I can't seem to get the prerequisites to install.

In particular I need pip3 and virtualenv:

$ pip3 install numpy
The program 'pip3' is currently not installed. You can install it by typing:
sudo apt install python3-pip
$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pip

So how do I install pip and virtualenv on an Ubuntu 16.04 boot usb?

Thanks.

  • did you run sudo apt update ? – L.Integra Feb 25 '18 at 21:57
  • @L.Integra Yes I did. – EddyTheB Feb 25 '18 at 22:01
  • maybe the problem with sources configuration. try sudo apt edit-sources and uncoment universe source – L.Integra Feb 25 '18 at 22:09
  • There was no universe to uncomment, but thanks for the tip. I had to add the universe repository, then spt update, and then I could install what I needed. – EddyTheB Feb 26 '18 at 17:56
0

To setup a Python Programming Environment:

Install the things you need :

sudo apt-get install python-virtualenv
sudo pip install flask

Prepare the envirement:

mkdir py3project
cd py3project
virtualenv -p python3 venv
ls

To use/activate the environment:

source venv/bin/activate

To install pip use:

sudo apt-get install python-pip 

Search with pip :

For example you want to look for a package redis.

You do:

pip search jupyter

To install with pip, for example jupyter notebook:

You do :

pip3 install jupyter

Line is the same for python2 pip installs, pip3 use python3

To see your project tree :

tree myprogram

Checkout this link for more information : how-to-install-python-3-and-set-up-a-local-programming-environment-on-ubuntu-16-04

  • Thanks but that doesn't work from the boot usb. "E: Package 'python-virtualenv' has no installation candidate" – EddyTheB Feb 26 '18 at 8:13
  • It does work from a Ubuntu Live USB.... – An0n Feb 26 '18 at 10:39
  • Not for me. I followed these instructions: tutorials.ubuntu.com/tutorial/… – EddyTheB Feb 26 '18 at 17:58
0

Well it turns out that the Ubuntu installation on the boot USB that I created (following these instructions:https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0) didn't include the standard Universe repository, just a limited version of it. It's a simple fix...

sudo add-apt-repository universe
sudo apt-get update

And then I was able to install python3-pip and python-virtualenv as normal.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.