Installation and configuration software method of Python 3.6 under Ubuntu 16.04

1 Install Python3.6.4

It is recommended to install Anaconda3 directly to realize the environment configuration of Python 3.6.4.

Anaconda3 download link: https://www.anaconda.com/download/

 

The following describes the steps to install Anaconda3 under Ubuntu (PS: In Windows environment, please search and find it online):

Original link: https://blog.csdn.net/u012318074/article/details/77074665

 

After the installation is complete, select the Python3.6 environment in Pycharm to find it in the Anaconda3 installation path.

 

When using Python 3.6 to write project code, some methods in the module package may be imported, and the path cannot be recognized. The following article introduces the processing method in detail, the specific original link: https://blog.csdn.net/pwc1996/article/details/52577148

 

 


2 install mysql

During the installation process, the following problems may occur:

The subprocess installed pre-removal script returned errno 1 or 2 and the subprocess installed post-installation script returned errno 1 or 2.

Original link: https://www.cnblogs.com/tonyibm/p/5621356.html

Original content:

 

 

Installation steps: ( Special attention needs to be paid here. During the installation process, a command will pop up, prompting to enter the initial password of the root user. The prompt part is generally prompted in English. Read it carefully, and then select OK to jump )

Original link: https://blog.csdn.net/qq_37604508/article/details/78731635

Part of the original installation:

Completely delete mysql5.7

Before deleting mysql, delete /var/lib/mysql and /etc/ mysql


#Execute the following commands in sequence 

sudo rm /var/lib/mysql/ -R #Delete the database directory 
sudo rm /etc/mysql/ -R #Delete startup scripts, configuration files, etc. 
sudo apt-get autoremove mysql * --purge #Uninstall mysql All files 
sudo apt-get remove apparmor #This apparmor is installed on mysql-server and is related to security 
dpkg -l |grep ^rc|awk ' {print $2} ' |sudo xargs dpkg -P #Clean up residual mysql files





Installation of mysql5.7

 sudo apt-get install mysql-server

The above command will install the following packages:
apparmor
mysql-client-5.7 
mysql-common 
mysql-server 
mysql -server- 5.7  
mysql -server -core-5.7  
so no need to install mysql - client etc. The installation process will prompt to set the password of the mysql root user. After the setting is complete, wait for the automatic installation. The default installation is completed and mysql is started

Tips: During the installation process, you will be prompted to enter the root password, please remember the password yourself, otherwise it will be very troublesome.

After installation, check whether the installation is successful:

sudo netstat -tap | grep mysql

If you see a mysql socket in the listen state, the installation is successful.
Next use the command to log in to mysql

mysql -u root -p

Then enter the password according to the prompt: Finally, the login is successful.
write picture description here

Common commands:

service mysql start #Start mysql 
service mysql stop #Close mysql

 

 

 

//Create a utf-8 format storage database

CREATE DATABASE `facelive` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; 

Related commands

Mysql:

//show databases

//show tables

//desc table_name

 

 


3 Install Reids

Installation steps under Linux system:

Download address: http://redis.io/download , download the latest document version.

The latest documentation version used for this tutorial is 2.8.17 , download and install:

$ wget http://download.redis.io/releases/redis-2.8.17.tar.gz
$ tar xzf redis -2.8.17 .tar.gz
$ cd redis -2.8.17
$ make
copy
After make , the compiled redis service program redis-server and the client program redis- cli for testing will appear in the redis-2.8.17 directory. The two programs are located in the src directory of the installation directory:

Start the redis service below.

$ cd src
$ ./redis-server
copy
Note that starting redis in this way uses the default configuration. You can also tell redis to use the specified configuration file to start with the following command through the startup parameter.

$ cd src
$ ./redis-server redis.conf
copy
redis.conf is a default configuration file. We can use our own configuration files as needed.

After starting the redis service process, you can use the test client program redis - cli to interact with the redis service. for example:

$ cd src
$. /redis- cli
redis> set foo bar
OK
redis> get foo
"bar"

 

Original link: http://www.shouce.ren/api/view/a/6230

Official documentation command reference link: http://redisdoc.com/

 

Specific use steps:

import redis

r = redis.Redis(host=’localhost’, port=6379, db=0)

r['test'] = 'test' #Or you can set the key with r.set('test', 'test')

r.get('test') #Get the value of test

r.delete('test') #delete this key

r.flushdb() #Empty the database

r.keys() #List all keys

r.exists('test') #Check whether the key exists

r.dbsize() #How many entries in the database

 

 


4 Install Rabbitmq

Original link: https://www.cnblogs.com/kode/p/5413604.html

Reference: https://jingyan.baidu.com/article/425e69e6f63990be15fc1621.html

Since rabbitMq requires erlang language support, you need to install erlang before installing rabbitMq, execute the command:

sudo apt-get install erlang-nox

 安装rabbitMq命令:

2.$ sudo apt-get update3.$ sudo apt-get install rabbitmq-server

启动、停止、重启、状态rabbitMq命令:

启动:sudo rabbitmq-server start

关闭: sudo rabbitmq-server stop

重启: sudo rabbitmq-server restart

查看状态:sudo rabbitmqctl status

 

官方文档:

1.http://www.rabbitmq.com/documentation.html

2.(部分翻译版)http://rabbitmq.mr-ping.com/description.html

 


5 安装Celery

使用命令pip install celery即可。

 

官方文档:

1.http://docs.celeryproject.org/en/latest/

2.(部分翻译版)http://docs.jinkan.org/docs/celery/getting-started/first-steps-with-celery.html#celerytut-installation

 

Celery+Rabbit+Django实现简单应用实例文章链接:https://blog.csdn.net/ding1991as/article/details/71081957

 

Celery的worker启动命令:

python manage.py celeryd -l info

 

 


6 配置Django项目环境

参考教程及文档:

  1. https://code.ziqiangxuetang.com/django/django-tutorial.html
  2. https://docs.djangoproject.com/en/2.0/
  3. (中文翻译版)https://yiyibooks.cn/xx/Django_1.11.6/index.html

 

一般使用Django实现基于Resyful方式API的参考文章:https://blog.csdn.net/nghuyong/article/details/51278330

 

使用Scrapy+Django实现简单爬虫实例:https://blog.csdn.net/clayanddev/article/details/53768975

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324648434&siteId=291194637