Install the Scrapy module dependency package summary in python

  • 2020-06-07 04:50:20
  • OfStack

After the development of the local virtual environment, 11 dependent packages need to be installed during the on-line process. The following records are made:

CentOS python3 installation. 5.3


wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
tar -xf Python-3.5.3.tgz cd Python-3.5.3
./configure --prefix=/usr/local/python353 make & make install

Complete the installation of python3.5.3 and make several soft chains without deleting the es9EN2.ES10en that comes with the system:


# do python3 The chain of soft 
ln -s /usr/local/python353/bin/python3 /usr/local/bin/
#pip3 The chain of soft 
ln -s /usr/local/python353/bin/pip3 /usr/local/bin/

Upload the program, install scrapy and its dependent packages:


#user agent package 
pip3 install fake-useragent -i https://pypi.douban.com/simple/
#pymysql package 
pip3 install pymysql -i https://pypi.douban.com/simple/
#PooledDB Depend on the package 
pip3 install DBUtils -i https://pypi.douban.com/simple/
#PIL Module dependent package 
pip3 install Image -i https://pypi.douban.com/simple/

During the installation process of Centos system, a relatively painless problem occurred: sqlite3 was not installed in the system, so 1 direct prompt was given:
To solve the above problem, download sqlite3


sudo wget http://www.sqlite.org/2017/sqlite-autoconf-3190300.tar.gz

Compile and install:


tar zxvf sqlite-autoconf-3190300.tar.gz cd sqlite-autoconf-3190300
./configure --prefix=/usr/local/sqlite3
make && make install

Recompile Python, find the installation file path of Python3.5.3, edit setup.py script, and find "sqlite3"


sqlite_inc_paths = [ '/usr/include',
'/usr/include/sqlite',
'/usr/include/sqlite3',
'/usr/local/include',
'/usr/local/include/sqlite',
'/usr/local/include/sqlite3',
]

Add the sqlite3 compile installation path in the last line, as follows:


sqlite_inc_paths = [ '/usr/include',
'/usr/include/sqlite',
'/usr/include/sqlite3',
'/usr/local/include',
'/usr/local/include/sqlite',
'/usr/local/include/sqlite3',
'/usr/local/sqlite3',
]

Recompile Python3.5.3:


./configure --prefix=/usr/local/python353
make && make install


Related articles: