1

centos常用库

yum install -y zlib openssl openssl-devel gcc gcc-c++ Xvfb libXfont Xorg libffi libffi-devel python-cffi python-devel libxslt-devel libxml2-devel zlib-devel bzip2-devel xz-libs wget

ubuntu常用库

sudo apt-get install build-essential autoconf libtool pkg-config  libqt4-network libgle3 zlibc zlib1g-dev libssl-dev openssl libxml2-dev libxslt1-dev libxslt-dev python-dev libffi-dev xvfb libappindicator1 libindicator7 libxss1 unzip

更新python pip版本

pip install --upgrade pip
pip install --upgrade setuptools

python2.X 使用 virtualenv (ptyhon3.X使用pyvenv)

pip install virtualenv
virtualenv env --no-site-packages
# 进入虚拟环境后,python与pip都会指向虚拟环境,与全局的python无关
source ./env/bin/activate
# 退出环境
deactivate

查询库的信息

pip show requests
pip list

生成依赖关系

pip freeze > requirements.txt

安装当前环境所需依赖库

pip install -r requirements.txt

ipython是个基于python的shell,能直接编写程序,可用于调试代码与查询运行时信息,开发机强烈建议安装!

pip install ipython

猫之良品
2.5k 声望139 粉丝

资深Drupal, magento与Joomla