By default, pip will install packages in global context, but maybe you want to use your home directory as storage. Just append the –user flag to the pip command

$ pip install esptool --user

The executable file is now located in ~/.local/lib/python2.7/site-packages/esptool.py – please read the documentation before running the tool! You need to adjust the command to match your specific ESP8266 Module (flash size).

The following script will simplify your development workflow by storing the module related settings into a single script file. The settings below are adjusted to match NodeMCU DEVKIT v1.0 with 32MBit of flash! Just copy the content in a file named esptool within your project: