Skip to content

Instantly share code, notes, and snippets.

@firmanelhakim
Last active August 4, 2017 12:29
Show Gist options
  • Save firmanelhakim/9feeebe3b5909444af6c45bfb1c688c4 to your computer and use it in GitHub Desktop.
Save firmanelhakim/9feeebe3b5909444af6c45bfb1c688c4 to your computer and use it in GitHub Desktop.
How to Install Python with Miniconda, Scrapy, Selenium, PhantomJS and PyMongo on Debian 8 (Jessie)

You might need to execute the following commands as root, or use sudo.

Make sure everything is updated

apt-get update && apt-get upgrade -y

Install Miniconda

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

bash Miniconda3-latest-Linux-x86_64.sh

Follow the instructions.

source ~/.bashrc

Test Conda Installation

conda -V

Test Python Installation

python -V

Update Conda

conda update conda

Install Scrapy, Selenium, PyMongo

conda install -c conda-forge scrapy selenium pymongo

Test Scrapy Installation

scrapy version

Install Fonts

   apt-get install libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev

Install Fonts (2) - Optional

Enable Contrib and Non-Free Repository - /etc/apt/sources.list

apt-get update && apt-get install -y ttf-mscorefonts-installer

Install cURL

apt-get install curl

Install PhantomJS

PHANTOM_JS_LATEST=$(curl -s https://bitbucket.org/ariya/phantomjs/downloads/ | grep -i linux-x86_64 | grep -v symbols | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1)

wget -t 0 -c https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS_LATEST

PHANTOM_JS_DIR=$(echo ${PHANTOM_JS_LATEST%.tar.bz2*})

mkdir $PHANTOM_JS_DIR

tar -xjvf $PHANTOM_JS_LATEST -C $PHANTOM_JS_DIR --strip-components=1

mv $PHANTOM_JS_DIR /usr/local/share

ln -sf /usr/local/share/$PHANTOM_JS_DIR/bin/phantomjs /usr/local/bin

Test PhantomJS Installation

phantomjs --version

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment