我有下面的sh脚本来提供我想要的安装:
#!/bin/bash
#Update repos
echo "Repo update time"
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
sudo apt-get update --yes --force-yes
#install python3
#no needed nowadays. Python 3.6.3 by default. Until tested the next release no update will be done.
#install pip framework for python - Python>3.4 doesn't need pip, it is bundled.
#echo "Pip time"
#sudo apt-get --yes --force-yes install --upgrade python-pip
#pip install -U pip
#install virtualenv
echo "Virtual Env time"
sudo apt-get install python3-venv #Python3 uses venv module as virtualenv
#create bonobo virtualEnv
mkdir python-virtual-environments && cd python-virtual-environments
python3 -m venv bonovo-env
source bonovo-env/bin/activate
#install bonobo framework
echo "Bonobo time"
python3.6 -m pip install --user --upgrade bonobo有一次,我运行了vagrant provision,似乎一切正常,因为我得到了以下输出:
==> default: Running provisioner: shell...
default: Running: C:/Users/mrius/AppData/Local/Temp/vagrant-shell20180228-17216-1xbxgoa.sh
default: Repo update time
default: 'main' distribution component is already enabled for all sources.
default: 'universe' distribution component is already enabled for all sources.
default: 'restricted' distribution component is already enabled for all sources.
default: 'multiverse' distribution component is already enabled for all sources.
default: Hit:1 http://us.archive.ubuntu.com/ubuntu artful InRelease
default: Get:2 http://us.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB]
default: Get:3 http://us.archive.ubuntu.com/ubuntu artful-backports InRelease [72.2 kB]
default: Get:4 http://us.archive.ubuntu.com/ubuntu artful-updates/main i386 Packages [211 kB]
default: Get:5 http://us.archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages [215 kB]
default: Get:6 http://us.archive.ubuntu.com/ubuntu artful-updates/universe i386 Packages [87.7 kB]
default: Get:7 http://us.archive.ubuntu.com/ubuntu artful-updates/universe amd64 Packages [88.5 kB]
default: Get:8 http://us.archive.ubuntu.com/ubuntu artful-backports/universe amd64 Packages [3,412 B]
default: Get:9 http://us.archive.ubuntu.com/ubuntu artful-backports/universe i386 Packages [3,392 B]
default: Get:10 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB]
default: Fetched 839 kB in 35s (23.8 kB/s)
default: Reading package lists...
default: W
default: :
default: --force-yes is deprecated, use one of the options starting with --allow instead.
default: Virtual Env time
default: Reading package lists...
default: Building dependency tree...
default: Reading state information...
default: python3-venv is already the newest version (3.6.3-0ubuntu2).
default: 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
default: mkdir:
default: cannot create directory 'python-virtual-environments'
default: : File exists
default: Bonobo time
default: Collecting bonobo
default: Using cached bonobo-0.6.1-py2.py3-none-any.whl
default: Collecting jinja2~=2.9 (from bonobo)
default: Using cached Jinja2-2.10-py2.py3-none-any.whl
default: Collecting mondrian~=0.6 (from bonobo)
default: Using cached mondrian-0.6.1-py2.py3-none-any.whl
default: Collecting python-slugify~=1.2.0 (from bonobo)
default: Using cached python_slugify-1.2.4-py2.py3-none-any.whl
default: Collecting graphviz<0.9,>=0.8 (from bonobo)
default: Using cached graphviz-0.8.2-py2.py3-none-any.whl
default: Collecting whistle~=1.0 (from bonobo)
default: Downloading whistle-1.0.0-py3-none-any.whl
default: Collecting psutil~=5.4 (from bonobo)
default: Using cached psutil-5.4.3.tar.gz
default: Collecting fs~=2.0 (from bonobo)
default: Using cached fs-2.0.18-py2.py3-none-any.whl
default: Collecting stevedore~=1.27 (from bonobo)
default: Using cached stevedore-1.28.0-py2.py3-none-any.whl
default: Collecting packaging~=16.0 (from bonobo)
default: Using cached packaging-16.8-py2.py3-none-any.whl
default: Collecting requests~=2.0 (from bonobo)
default: Using cached requests-2.18.4-py2.py3-none-any.whl
default: Collecting MarkupSafe>=0.23 (from jinja2~=2.9->bonobo)
default: Using cached MarkupSafe-1.0.tar.gz
default: Collecting colorama~=0.3.9 (from mondrian~=0.6->bonobo)
default: Using cached colorama-0.3.9-py2.py3-none-any.whl
default: Collecting Unidecode>=0.04.16 (from python-slugify~=1.2.0->bonobo)
default: Using cached Unidecode-1.0.22-py2.py3-none-any.whl
default: Collecting six~=1.10 (from fs~=2.0->bonobo)
default: Using cached six-1.11.0-py2.py3-none-any.whl
default: Collecting pytz (from fs~=2.0->bonobo)
default: Using cached pytz-2018.3-py2.py3-none-any.whl
default: Collecting setuptools (from fs~=2.0->bonobo)
default: Using cached setuptools-38.5.1-py2.py3-none-any.whl
default: Collecting appdirs~=1.4.3 (from fs~=2.0->bonobo)
default: Using cached appdirs-1.4.3-py2.py3-none-any.whl
default: Collecting pbr!=2.1.0,>=2.0.0 (from stevedore~=1.27->bonobo)
default: Using cached pbr-3.1.1-py2.py3-none-any.whl
default: Collecting pyparsing (from packaging~=16.0->bonobo)
default: Using cached pyparsing-2.2.0-py2.py3-none-any.whl
default: Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests~=2.0->bonobo)
default: Collecting certifi>=2017.4.17 (from requests~=2.0->bonobo)
default: Using cached certifi-2018.1.18-py2.py3-none-any.whl
default: Collecting urllib3<1.23,>=1.21.1 (from requests~=2.0->bonobo)
default: Using cached urllib3-1.22-py2.py3-none-any.whl
default: Collecting idna<2.7,>=2.5 (from requests~=2.0->bonobo)
default: Using cached idna-2.6-py2.py3-none-any.whl
default: Building wheels for collected packages: psutil, MarkupSafe
default: Running setup.py bdist_wheel for psutil: started
default: Running setup.py bdist_wheel for psutil: finished with status 'done'
default: Stored in directory: /root/.cache/pip/wheels/8b/83/e9/f0feab7d059e177e6f3834f42b8a302805fd83dbb16405515a
default: Running setup.py bdist_wheel for MarkupSafe: started
default: Running setup.py bdist_wheel for MarkupSafe: finished with status 'done'
default: Stored in directory: /root/.cache/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
default: Successfully built psutil MarkupSafe
default: Installing collected packages: MarkupSafe, jinja2, colorama, mondrian, Unidecode, python-slugify, graphviz, whistle, psutil, six, pytz, setuptools, appdirs, fs, pbr, stevedore, pyparsing, packaging, certifi, urllib3, idna, requests, bonobo
default: Successfully installed MarkupSafe-1.0 Unidecode-1.0.22 appdirs-1.4.3 bonobo-0.6.1 certifi-2018.1.18 colorama-0.3.9 fs-2.0.18 graphviz-0.8.2 idna-2.6 jinja2-2.10 mondrian-0.6.1 packaging-16.8 pbr-3.1.1 psutil-5.4.3 pyparsing-2.2.0 python-slugify-1.2.4 pytz-2018.3 requests-2.18.4 setuptools-38.5.1 six-1.11.0 stevedore-1.28.0 urllib3-1.22 whistle-1.0.0但是,当我进入针对VM的ssh会话并运行bonobo版本时,我得到:
bonobo: command not found为什么安装失败了?
发布于 2018-03-08 10:12:04
由于您没有提供您的迷航文件,我假设您使用的是默认配置,即带有virtualbox提供程序(https://vagrantcloud.com/generic/boxes/ubuntu1710/versions/1.4.5/providers/virtualbox.box)的基本映像https://vagrantcloud.com/generic/boxes/ubuntu1710/versions/1.4.5/providers/virtualbox.box。我没有找到任何其他的形象,看起来更“官方”,让我知道如果你的基础是不同的。
我认为这更多地是与python打包有关,而不是bonobo,但下面是发生的情况。
pip。我认为您想在安装apt-get install python3-pip的同时安装python3-venv。pip install --user时,它会明确要求将包安装在userland中,而不是在当前虚拟环境中全局安装。要访问已安装的入口点,您需要将~/.local/bin添加到系统环境的PATH,或者直接运行~/.local/bin/bonobo。我不太熟悉“用户安装”的基本机制。virtualenv中可用,那么您需要使用它提供的python/pip (python -m ...,尝试运行which python或which pip来检查将要运行的二进制文件),并避免使用--user标志。在我安装的与您的环境匹配的“流浪”框中,快速和肮脏的修复方法是:
sudo apt-get install python3-venv替换sudo apt-get install python3-venv python3-pippip install --user行替换为pip install --upgrade bonobobonobo version (最终)。希望这能有所帮助。
https://stackoverflow.com/questions/49033688
复制相似问题