Tao He

Tao He

  • Docs
  • API
  • Help
  • Blog

›Recent Posts

Recent Posts

  • Microsoft PowerPoint
  • Chrome
  • Alfred
  • Docusaurus
  • Git Commands

Python

January 3, 2015

{% include JB/setup %}

macOS

Install Python

brew install python3
which python3
ll /usr/local/bin/python3
brew install python2
which python2
ll /usr/local/bin/python2

Use Pip

Upgrade Pip

pip3 install --upgrade pip setuptools wheel
pip2 install --upgrade pip setuptools

Install packages

pip3 install <package>
pip2 install <package>

Install packages to user path

pip3 install --user mercurial
pip install --user mercurial

This should result in the hg script being installed in $HOME/.local/bin/hg and the rest of the hg package in $HOME/.local/lib/pythonx.y/site-packages/.

The location on macOS was changed from $HOME/.local to $HOME/Library/Python

https://stackoverflow.com/questions/7143077/how-can-i-install-packages-in-my-home-folder-with-pip

Install Scrapy

pip3 install scrapy

Ubuntu

Install Pip

sudo apt-get install python-pip
sudo apt-get install python3-pip
pip2 install --upgrade pip
pip3 install --upgrade pip
pip2 --version
pip3 --version

Install MySQL Connector/Python

sudo apt-get install python-dev libmysqlclient-dev
sudo pip install MySQL-python

Install Scrapy

sudo apt-get install python-dev libffi-dev libssl-dev libxml2-dev libxslt-dev
sudo pip install scrapy
Recent Posts
  • macOS
    • Install Python
    • Use Pip
    • Install Scrapy
  • Ubuntu
    • Install Pip
    • Install MySQL Connector/Python
    • Install Scrapy
Tao He
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Facebook Open Source
Copyright © 2019 Your Name or Your Company Name