Error during Beta Development Setup in Ubuntu 14

Environment Setup

vagrant init ubuntu/trusty64
vagrant up
vagrant ssh

Beta Development Setup
Then I follow the as described on GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps. However it fails even though you say it is tested with Ubuntu 14:

Cloning into '/tmp/.bench'...
remote: Counting objects: 223, done.
remote: Compressing objects: 100% (178/178), done.
remote: Total 223 (delta 5), reused 162 (delta 4), pack-reused 0
Receiving objects: 100% (223/223), 7.06 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (5/5), done.
Checking connectivity... done.
ERROR! Unexpected Exception: (setuptools 3.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('setuptools>=11.3'))
the full traceback was:

Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 73, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
  File "/usr/local/lib/python2.7/dist-packages/ansible/cli/playbook.py", line 30, in <module>
    from ansible.executor.playbook_executor import PlaybookExecutor
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/playbook_executor.py", line 27, in <module>
    from ansible.executor.task_queue_manager import TaskQueueManager
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 28, in <module>
    from ansible.executor.play_iterator import PlayIterator
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/play_iterator.py", line 29, in <module>
    from ansible.playbook.block import Block
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/__init__.py", line 25, in <module>
    from ansible.playbook.play import Play
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/play.py", line 27, in <module>
    from ansible.playbook.base import Base
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/base.py", line 35, in <module>
    from ansible.parsing.dataloader import DataLoader
  File "/usr/local/lib/python2.7/dist-packages/ansible/parsing/dataloader.py", line 32, in <module>
    from ansible.parsing.vault import VaultLib
  File "/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py", line 67, in <module>
    from cryptography.hazmat.primitives.hashes import SHA256 as c_SHA256
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/hashes.py", line 15, in <module>
    from cryptography.hazmat.backends.interfaces import HashBackend
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
    import pkg_resources
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 446, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 459, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 632, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
VersionConflict: (setuptools 3.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('setuptools>=11.3'))
Traceback (most recent call last):
  File "install.py", line 261, in <module>
    install_bench(args)
  File "install.py", line 76, in install_bench
    run_playbook('develop/create_user.yml', extra_vars=extra_vars)
  File "install.py", line 214, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(tmp_bench_repo, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'develop/create_user.yml', '-e', '@/tmp/extra_vars.json']' returned non-zero exit status 250

Related to this topic but neither is resolved Install errors on Beta Develop Setup - #9 by dominik

Try running:

sudo pip install --upgrade setuptools

Thank you Anand, for trying to help me. However now there is the next error when I run the script.

vagrant@vagrant-ubuntu-trusty-64:~$ sudo pip install --upgrade setuptools
The directory '/home/vagrant/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/vagrant/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already up-to-date: setuptools in ./.local/lib/python2.7/site-packages/setuptools-23.1.0-py2.7.egg
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning

@vjFaLk @shreyasp setuptools still fails on Ubuntu. Why not make the bootstrap script default?

It actually is the default, however Ubuntu doesn’t play well with it. Need to find a better fix.

@dominik try-

sudo apt-get install setuptools --user python and re-run the setup

Also, I’ve updated the script to work on Ubuntu properly. Sorry for the troubles.

@vjFaLk and @rmehta the script does not work. Same procedure and same error:

Checking connectivity... done.
ERROR! Unexpected Exception: (setuptools 3.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('setuptools>=11.3'))
the full traceback was:

Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 73, in <module>
    mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
  File "/usr/local/lib/python2.7/dist-packages/ansible/cli/playbook.py", line 30, in <module>
    from ansible.executor.playbook_executor import PlaybookExecutor
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/playbook_executor.py", line 27, in <module>
    from ansible.executor.task_queue_manager import TaskQueueManager
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 28, in <module>
    from ansible.executor.play_iterator import PlayIterator
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/play_iterator.py", line 29, in <module>
    from ansible.playbook.block import Block
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/__init__.py", line 25, in <module>
    from ansible.playbook.play import Play
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/play.py", line 27, in <module>
    from ansible.playbook.base import Base
  File "/usr/local/lib/python2.7/dist-packages/ansible/playbook/base.py", line 35, in <module>
    from ansible.parsing.dataloader import DataLoader
  File "/usr/local/lib/python2.7/dist-packages/ansible/parsing/dataloader.py", line 32, in <module>
    from ansible.parsing.vault import VaultLib
  File "/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py", line 67, in <module>
    from cryptography.hazmat.primitives.hashes import SHA256 as c_SHA256
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/hashes.py", line 15, in <module>
    from cryptography.hazmat.backends.interfaces import HashBackend
  File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 7, in <module>
    import pkg_resources
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 446, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 459, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 632, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
VersionConflict: (setuptools 3.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('setuptools>=11.3'))
Traceback (most recent call last):
  File "install.py", line 257, in <module>
    install_bench(args)
  File "install.py", line 72, in install_bench
    run_playbook('develop/create_user.yml', extra_vars=extra_vars)
  File "install.py", line 210, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(tmp_bench_repo, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'develop/create_user.yml', '-e', '@/tmp/extra_vars.json']' returned non-zero exit status 250
vagrant@vagrant-ubuntu-trusty-64:~$  

When you then run sudo apt-get install setuptools --user python it throws the error E: Command line option --user is not understood.

So no, the script doesn’t work with a plain Ubuntu 14 LTS.

You can simply replicate my environment in Ubuntu 14 by having the vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "forwarded_port", guest: 80, host: 8080
end

After that I simply run:

wget https://raw.githubusercontent.com/frappe/bench/develop/playbooks/install.py
python install.py --develop

Which causes the problems as shown above. Also as discussed both commands from @anand sudo pip install --upgrade setuptools and from @vjFaLk sudo apt-get install setuptools --user python do not work in a plain Ubuntu 14 even after running the Frappe setup.