Easy install Installation issue

When I run the following command of easy install: sudo python install.py --develop, I received the following error:

TASK [install bench] ************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: false, “cmd”: “/usr/local/bin/pip3 install -e /home/erpnxt/.bench”, “failed”: true, “msg”: “stdout: Obtaining file:///home/erpnxt/.bench\nRequirement already satisfied: Click in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: jinja2 in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: virtualenv in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: requests in /usr/lib/python3/dist-packages (from bench==4.1.0)\nRequirement already satisfied: honcho in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: psutil in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: python-crontab in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: semantic_version in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: GitPython==0.3.2.rc1 in /usr/local/lib/python3.5/dist-packages (from bench==4.1.0)\nRequirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.5/dist-packages (from jinja2->bench==4.1.0)\nRequirement already satisfied: python-dateutil in /usr/local/lib/python3.5/dist-packages (from python-crontab->bench==4.1.0)\nRequirement already satisfied: gitdb>=0.5.1 in /usr/local/lib/python3.5/dist-packages (from GitPython==0.3.2.rc1->bench==4.1.0)\nRequirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil->python-crontab->bench==4.1.0)\nRequirement already satisfied: smmap>=0.8.5 in /usr/local/lib/python3.5/dist-packages (from gitdb>=0.5.1->GitPython==0.3.2.rc1->bench==4.1.0)\nInstalling collected packages: bench\n Found existing installation: bench 4.1.0\n Can’t uninstall ‘bench’. No files were found to uninstall.\n Running setup.py develop for bench\n Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;file=‘/home/erpnxt/.bench/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))" develop --no-deps:\n running develop\n error: can’t create or remove files in install directory\n \n The following error occurred while trying to add or remove files in the\n installation directory:\n \n [Errno 2] No such file or directory: ‘/usr/lib/python3.5/site-packages/test-easy-install-87966.write-test’\n \n The installation directory you specified (via --install-dir, --prefix, or\n the distutils default setting) was:\n \n /usr/lib/python3.5/site-packages/\n \n This directory does not currently exist. Please create it and try again, or\n choose a different installation directory (using the -d or --install-dir\n option).\n \n \n ----------------------------------------\n\n:stderr: Can’t roll back bench; was not uninstalled\nCommand "/usr/bin/python3 -c "import setuptools, tokenize;file=‘/home/erpnxt/.bench/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))" develop --no-deps" failed with error code 1 in /home/erpnxt/.bench/\n”}
to retry, use: --limit @/tmp/.bench/playbooks/develop/install.retry

PLAY RECAP **********************************************************************************************
localhost : ok=34 changed=3 unreachable=0 failed=1

Traceback (most recent call last):
File , line 388, in
install_bench(args)
File , line 111, in install_bench
run_playbook(‘develop/install.yml’, sudo=True, extra_vars=extra_vars)
File, line 326, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘develop/install.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpnxt’]’ returned non-zero exit status 2

You have python 3 instead of python 2.7

In my virtual environment, i already set to python2.7:

(erpnext2) a@virtual-machine:~/erpnext$ python --version
Python 2.7.12

Why i run the benchmark it still running in python3?, as follows:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py”, line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py”, line 2749, in load_entry_point
return ep.load()
File “/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py”, line 2402, in load
return self.resolve()
File “/usr/local/lib/python3.5/dist-packages/pkg_resources/init.py”, line 2408, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/home/frappe/.bench/bench/cli.py”, line 3, in
from bench.utils import is_root, PatchError, drop_privileges, get_env_cmd, get_cmd_output, get_frappe
File “/home/frappe/.bench/bench/utils.py”, line 48
except OSError, e:
^

Please advise.

What is the output of which python? Look at the symlink for python in /usr/bin.

Hi James.

The output of ‘which python’ displays me the python directory: /home/a/erpnext/erpnext2/bin/python

Then we i check the symlink in that directory, here’s wha I get
(erpnext2) a@a-virtual-machine:~/erpnext$ ls -al /home/a/erpnext/erpnext2/bin/python
lrwxrwxrwx 1 a a 9 Nov 23 04:59 /home/a/erpnext/erpnext2/bin/python → python2.7

Seems it is pointing to python2.7. What else could i try?

That is not right. A which python should return something like this:

 /usr/bin/python

and if you then run

 ls -l /usr/bin/python

you should get something like this:

 lwrxrwxrwx 1 root root 9 Mar 16 2015 /usr/bin/python -> python2.7

if you a

 ls -al /usr/bin/python*

you will get a full listing of all the python links and executables installed on the server. If you have python 2.7, 3, 3.4 could could easily see more than one executable in the directory.

Fix the python symlink to point to python2.7 and try again.