Python Environment installation
First build the Python virtual environment below the project directory, download the installation virtualenv using the PIP tool, and the command is as follows:
Pip install VIRTUALENVCD project directory virtualenv Environment folder name
Put the Python module file you want to import in the project directory and run:
Pip Install-r./requirement.txt
The following is the./requirement.txt, which is the module that I relied on in my own project written under Windows, using the above command for module installation:
djangoansible==2.4.1.0appnope==0.1.0asn1crypto==0.23.0backports.shutil-get-terminal-size==1.0.0bcrypt== 3.1.4certifi==2017.7.27.1cffi==1.11.2chardet==3.0.4cryptography==2.1.3decorator==4.1.2diff-match-patch== 20121119django-crispy-forms==1.7.0django-crontab==0.7.1django-formtools==2.1django-import-export==0.5.1enum34= =1.1.6et-xmlfile==1.0.1future==0.16.0httplib2==0.9.2idna==2.6ipaddress==1.0.18ipython==5.5.0ipython-genutils== 0.2.0jdcal==1.3jieba==0.39jinja2==2.10ldap3==2.4markupsafe==1.0mysql-python==1.2.5odfpy==1.3.5openpyxl== 2.4.9paramiko==2.4.0pathlib2==2.3.0pexpect==4.2.1pickleshare==0.7.4ply==3.10prompt-toolkit==1.0.15ptyprocess== 0.5.2pyasn1==0.3.7pycparser==2.18pycrypto==2.6.1pycryptodome==3.4.7pygments==2.2.0pymongo==3.5.1pynacl== 1.2.0pysmi==0.1.3pysnmp==4.3.9python-nmap==0.6.1pytz==2017.3pyvmomi==6.5.0.2017.5.post1pyyaml==3.12redis== 2.10.6requests==2.18.4scandir==1.6simplegeneric==0.8.1simplejson==3.13.2six==1.11.0tablib==0.12.1traitlets== 4.3.2unicodecsv==0.14.1urllib3==1.22wcwidth==0.1.7whoosh==2.7.4xadminxlrd==1.1.0xlwt==1.3.0
For the two modules of Django and xadmin to avoid incompatibility problems, you can remove the version number and install it using the above command.
For the module that failed to install generally is the following database is not installed, it is recommended to first install the database before running the above command.
Database environment installation Install MySQL database
Apt Install Mysql-server
Installing the database will allow the user to set the password for the database root user.
After the installation is complete, open the MySQL database service with the following command:
/etc/init.d/mysql start
For MySQL database encoding problem, you need to modify the my.cnf file, the command is as follows:
Vim/etc/mysql/my.cnf
Add the following content to the file
After editing is complete, restart the database, let the program reload the configuration file, use the command:
/etc/init.d/mysql restart
After the restart is complete, the database table creation and permission editing, the command is as follows:
Mysql-u root-p Enter password .... create database name; Grant all on database name. * To new user name @ ' run IP address ' identified by ' password '; For example: Create DATABASE cl Oudserver;grant all on cloudserver.* to [e-mail protected] ' 127.0.0.1 ' identified by ' 123456 ';
Refresh permissions After success:
Flush privileges;
To install the MongoDB database:
Use apt to install and then modify the MongoDB database configuration file, then restart the service view port and run IP to see if the service is working properly:
Install MONGO database: Apt Install mongodb start mongo:/etc/init.d/mongodb start view MONGO service IP port number: Netstat-luntp|grep MONGO if you see that the IP is not running on 0.0.0.0, edit the configuration file: Vim/etc/mongodb.conf/etc/init.d/mongodb Restart after entering modify BIND_IP restart service:/etc/init.d/ MongoDB restart
To install the Redis database:
Words do not say much, and similar to the above:
Install apt install redis-server start/etc/init.d/redis-server Start Modify configuration file vim/etc/redis/redis.conf Find bind modify IP restart redis/etc/ Init.d/redis-server restart
Exception issues
If you encounter problems with using PIP to install the Mysql-python module in Python, please install Mysql-server First, if the problem occurs after installation, use:
sudo apt-get install Libmysqlclient-dev
Cloud computing dimensional plane platform Ubuntu environment configuration