The whole project on-line

1. buy a server, pay it

2. Even on the server, port 22 change it, change the default password more complex. Other casual, then adduser a personal account, do nothing with root

To it with sudo privileges

-a the usermod - G the sudo WQK
 # reconfirm 
groups wqk 
switched to WQK
SU WQK

3. Install a virtual environment, quarantined items

You can use pip install or apt, here we choose pip

a. Check pip version
          View version pip: pip - V
        View pip3 version: pip3 - V
    b. Install PIP (if there is no need to install)
        Installation PIP3: APT install python3 - PIP    
         Installation PIP2: APT install Python - PIP    
    c. Updates pip
          Update pip (if pip higher than version 9.0 update is not required): 
              更新pip3: pip3 install --upgrade pip
             更新pip: pip install --upgrade pip
 
         Note: Updated as of the following error (this is the pip appears 10.0 .0 version of BUG):
            Traceback (most recent call last): 
            File “/usr/bin/pip”, line 9, in 
            from pip import main

            Solution: Modify the code corresponding to the file pip (pip3 pip and the like)
                  Updating example given the need to modify the pip / usr / bin / Code pip file,
                Use: sudo vim / usr / bin / pip pip open file
                will:          
                    from pip import main
                    if __name__ == '__main__':
                        sys.exit(main())
                Read:
                    from pip import __main__
                    if __name__ == '__main__':
                        sys.exit(__main__._main())

        
    d. pip command
          pip install xxx: xxx install dependencies
        pip list: Check all dependencies
        pip freeze: Check the newly installed package
        pip uninstall xxx: xxx uninstall package

1.3 , the installation and use of virtualenv and virtualenvwrapper
   [Use] the average user 
    a. Install a virtual environment
          sudo apt update
          sudo pip3 install virtualenv virtualenvwrapper
        sudo pip install virtualenv virtualenvwrapper
        sudo apt install virtualenv virtualenvwrapeer
        
        
        mkvirtualenv env3 -p /usr/bin/python3
          After installation if you can not use the virtual environment command, you need to configure the environment variables
            1, into the home directory: cd ~
            2, the use of open vim .bashrc, navigate to the last: Shift + G, and add the following two lines of code (note Ubuntu modify their user name)
                    WORKON_HOME Export = / Home / Ubuntu own username / .virtualenvs
                    Source / usr / report this content share / virtualenvwrapper / virtualenvwrapper.sh
             3 , the home directory created .virtualenvs directory: mkdir .virtualenvs
             4 , load the modified settings, to make it work: source .bashrc
            (If you can not find virtualenvwrapper.sh,
             Then the path into / usr / local / bin / virtualenvwrapper.sh
             And try again)
      . B create a virtual environment: 
          mkvirtualenv env  
          ENV2 mkvirtualenv -p / usr / bin / to python3 (python path specified)
      c. Exit virtual environment
          deactivate 
    . D enter the virtual environment: 
          workon virtual environment name

 

Guess you like

Origin www.cnblogs.com/djflask/p/12393249.html