简体   繁体   中英

Travis-CI can't find python3-pip package

I need pip3 to install a package for testing but for that, I would need python3-pip . However this is not so happening over travis.

The error log is also not very descriptive.

Using worker: worker-linux-e7a62211-2.bb.travis-ci.org:travis-linux-10
system_info
$ git clone --depth=50 --branch=travis-test git://github.com/OrkoHunter/networkx-metis.git OrkoHunter/networkx-metis
Cloning into 'OrkoHunter/networkx-metis'...
remote: Counting objects: 166, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 166 (delta 4), reused 0 (delta 0), pack-reused 154
Receiving objects: 100% (166/166), 205.67 KiB | 0 bytes/s, done.
Resolving deltas: 100% (28/28), done.
Checking connectivity... done.
$ cd OrkoHunter/networkx-metis
$ git checkout -qf 29ac745c9e5beb220e6c2c47e2e0a6c47cb02491
$ source ~/virtualenv/python2.7/bin/activate
$ python --version
Python 2.7.9
$ pip --version
pip 6.0.7 from /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages (python 2.7)
before_install.1
$ sudo apt-get update
$ sudo apt-get install build-essential
$ sudo apt-get install python3-setuptools python-setuptools
$ sudo apt-get install --upgrade python-pip
$ sudo apt-get install --upgrade python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-pip
The command "sudo apt-get install --upgrade python3-pip" failed and exited with 100 during .
Your build has been stopped.

As of now, there's no way to get pip3 with non-sudo non-Python builds on Travis CI, unless you're on the trusty infrastructure. Switch to trusty and you're fine. Example .travis.yml for a Node.js project:

sudo: false
dist: "trusty" # otherwise 'python3-pip' won't be available
language: "node_js"
addons:
  apt:
    packages:
      - "python3"
      - "python3-pip"
node_js:
  - "4"
  - "6"

...

before_install:
  - "pip3 install -r docs/requirements.txt"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM