Tag Archives: ubuntu

Solutions to the problem that Ubuntu is stuck when copying large files and can’t mount mobile hard disk normally

Recently, in the process of copying a large number of files (more than 100g) from the Ubuntu system to the mobile hard disk, there is a situation of stuck. At the beginning, it used the direct folder copy and paste method. When it got stuck, it was replaced by the “SCP – R” method, but it didn’t work.

The main reason for this problem is that the write cache of kernel in Ubuntu system is too large, so that there is a congestion bottleneck when writing from high-speed storage to low-speed devices.

The solution is to avoid using file manager and SCP. When copying large files, the following instructions can be used:

rsync -avP source/ target/

Rsync is a remote data synchronization tool, which can quickly synchronize the files between multiple hosts through LAN/WAN, and view the file transfer process and rate, which is very convenient.

In addition, when the copy to the mobile hard disk is stuck, the file index directory is damaged due to forcibly pulling out the mobile hard disk, which makes the Ubuntu system unable to mount the mobile hard disk, and the following error prompt appears:

Failed to mount '/dev/sdb1': Input/output error 
NTFS is either inconsistent, or there is a hardware fault, or it's a 
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows 
then reboot into Windows twice. The usage of the /f parameter is very 
important! If the device is a SoftRAID/FakeRAID then first activate 
it and mount a different device under the /dev/mapper/ directory, (e.g. 
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation 
for more details.

According to the above tips, it can be solved in Windows system  
1. Enter CMD in “run” under windows to enter DOS command line window  
2. Find the volume name of the mobile hard disk (such as G:)  
3. On the command line, enter:

chkdsk G:/f

CHKDSK command is used to scan disk, automatically check and fix index error. There are three stages after the instruction input in step 3 above. If there are a large number of files, it will take a long time, and you need to wait patiently for the repair to be completed. After that, it can be mounted normally in the Ubuntu system.

After canceling the startup of Ubuntu terminal, it will automatically enter the base environment of CONDA

After installing Anaconda on Ubuntu, every time you start the terminal, it will automatically enter the CONDA base environment. You can exit the CONDA environment through the following instructions:

conda deactivate

But considering that you need to perform this step to exit every time, it is troublesome, so you want to start the terminal without entering the CONDA environment. It is recommended to modify the config file of CONDA

conda config --set auto_activate_base false

However, I don’t use it here. After starting, I will automatically enter the base environment of CONDA. The final solution is to modify the configuration file of CONDA directly

sudo vi ~/.condarc

Add in the last line:

auto_activate_base: false

So far, it’s done.

Query specific settings through “CONDA – H”:

usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    clean        Remove unused packages and caches.
    config       Modify configuration values in .condarc. This is modeled
                 after the git config command. Writes to the user .condarc
                 file (/home/XXX/.condarc) by default.
    create       Create a new conda environment from a list of specified
                 packages.
    help         Displays a list of available conda commands and their help
                 strings.
    info         Display information about current conda install.
    init         Initialize conda for shell interaction. [Experimental]
    install      Installs a list of packages into a specified conda
                 environment.
    list         List linked packages in a conda environment.
    package      Low-level conda package utility. (EXPERIMENTAL)
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove.
    run          Run an executable in a conda environment. [Experimental]
    search       Search for packages and display associated information. The
                 input is a MatchSpec, a query language for conda packages.
                 See examples below.
    update       Updates conda packages to the latest compatible version.
    upgrade      Alias for conda update.

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

 

[solution] install opencv3 with opencv4

Step 1: Download opencv download, the source code compilation package of opencv3. Step 2: when cmake, enter: cmake - D cmake_ INSTALL_ PREFIX=/home/username/opencv3 -D CMAKE_ BUILD_ TYPE="Rlease" -D OPENCV_ GENERATE_ Pkgconfig = on.. Step 3: compile and install

    make
    make install

Step 4: configure the environment

    sudo vi  /etc/ld.so.conf.d/opencv.conf
    input: /home/username/opencv3/lib

Step 5: configure bashrc
VI ~ /. Bashrc , and add:

    #opencv-3.4.12
    export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/home/username/opencv3/lib/pkgconfig
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:./home/username/opencv3/lib

After saving, enter source ~ /. Bashrc
at this time, PKG config — modversion opencv will display 3.4.12, and opencv4 will display 4.2.0

Step 6: use opencv3
to edit CMakeLists.txt Before find (openCV required) , enter: set (cmake)_ PREFIX_ PATH "/home/username/opencv3")

[solution] install youcompleteme through VIM plug-in manager VIM plug, including ycmd server shutdown solution

Reference article:
take you step by step to install the most difficult VIM plug-in in history: youcompleteme
VIM plug-in: minimalist VIM plug-in manager

Installation method

    install VIM
    sudo apt get install VIM edit vimrc
    first add VIM ~ /. Vimrc
    at the top:
    call plug#begin (‘~ /. VIM/plugged’)
    plug ‘valloric/youcompleteme’
    call plug#end() to install VIM plug and install youcompleteme through plugged

    Input: curl – flo ~ /. VIM/autoload at the terminal/ plug.vim –create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim Open VIM
    Enter “: source ~ /. Vimrc” at the command line
    Enter “: pluginstall” at the command line to install youcompleteme, which takes a long time. Please wait patiently for YCM to be compiled and installed_ core
    mkdir ~/.ycm_ build
    cd ~/.ycm_ build
    cmake -G “Unix Makefiles” . ~/.vim/plugged/YouCompleteMe/third_ party/ycmd/cpp
    cmake –build . –target ycm_ core –config Release

Supplement: VIM prompts the debugging method of the ycmd server shut down:

Select log through ycmtogglelogs to view errors

For example, the solution of no module named watchdog: PIP3 install watchdog

The solution of no module named ‘jinja2. Asyncsupport’

Background of the problem

When compiling Px4,

make px4_sitl_default gazebo

An error has been reported,

[0/535] Performing build step for 'sitl_gazebo'
[1/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[2/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[3/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[4/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/r200/r200-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/r200/r200-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/r200/r200.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[5/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/c920/c920.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[6/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/px4flow/px4flow-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/px4flow/px4flow-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/px4flow/px4flow.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[7/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[8/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/sf10a/sf10a-gen.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/sf10a/sf10a-gen.sdf 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/sf10a/sf10a.sdf.jinja /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo
Traceback (most recent call last):
  File "/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/jinja_gen.py", line 4, in <module>
    import jinja2
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 82, in <module>
    _patch_async()
  File "/usr/lib/python2.7/dist-packages/jinja2/__init__.py", line 78, in _patch_async
    from jinja2.asyncsupport import patch_all
ModuleNotFoundError: No module named 'jinja2.asyncsupport'
[9/9] Generating /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf
FAILED: /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf 
cd /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo && rm -f /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/scripts/xacro.py -o /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.xacro enable_mavlink_interface:=true enable_ground_truth:=false enable_wind:=false enable_logging:=false rotors_description_dir:=/home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/rotors_description send_vision_estimation:=true send_odometry:=false && gz sdf -p /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf >> /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf && rm -f /home/zth/catkin_ws/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf

gz: symbol lookup error: /usr/lib/x86_64-linux-gnu/libgazebo_common.so.9: undefined symbol: _ZN8ignition10fuel_tools12ClientConfig12SetUserAgentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
ninja: build stopped: subcommand failed.
[2/535] Generating mixer_multirotor.generated.h
FAILED: src/lib/mixer/MultirotorMixer/mixer_multirotor.generated.h 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/src/lib/mixer/MultirotorMixer && /usr/bin/python3 /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py -f /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/dodeca_bottom_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/dodeca_top_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_t.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_cox_wide.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_deadcat.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_h.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_s250aq.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_vtail.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_wide.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x_cw.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x_pusher.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_y.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/tri_y.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/twin_engine.toml -o mixer_multirotor.generated.h
Failed to import numpy: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name 'multiarray'


You may need to install it using:
    pip3 install --user numpy

[3/535] Generating mixer_multirotor_normalized.generated.h
FAILED: src/lib/mixer/MultirotorMixer/mixer_multirotor_normalized.generated.h 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/src/lib/mixer/MultirotorMixer && /usr/bin/python3 /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py --normalize -f /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/dodeca_bottom_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/dodeca_top_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_t.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_cox_wide.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_deadcat.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_h.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_s250aq.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_vtail.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_wide.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x_cw.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x_pusher.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_y.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/tri_y.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/twin_engine.toml -o mixer_multirotor_normalized.generated.h
Failed to import numpy: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name 'multiarray'


You may need to install it using:
    pip3 install --user numpy

[4/535] Generating mixer_multirotor_6dof.generated.h
FAILED: src/lib/mixer/MultirotorMixer/mixer_multirotor_6dof.generated.h 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/src/lib/mixer/MultirotorMixer && /usr/bin/python3 /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/tools/px_generate_mixers.py --sixdof -f /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/dodeca_bottom_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/dodeca_top_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_t.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/hex_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_cox.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_cox_wide.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/octa_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_deadcat.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_h.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_plus.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_s250aq.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_vtail.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_wide.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x_cw.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_x_pusher.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/quad_y.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/tri_y.toml /home/zth/catkin_ws/Firmware/src/lib/mixer/MultirotorMixer/geometries/twin_engine.toml -o mixer_multirotor_6dof.generated.h
Failed to import numpy: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name 'multiarray'


You may need to install it using:
    pip3 install --user numpy

[5/535] Generating serial_params.c
FAILED: generated_params/serial_params.c 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/src/lib/parameters && /usr/bin/cmake -E make_directory /home/zth/catkin_ws/Firmware/build/px4_sitl_default/generated_params && /usr/bin/python3 /home/zth/catkin_ws/Firmware/Tools/serial/generate_config.py --params-file /home/zth/catkin_ws/Firmware/build/px4_sitl_default/generated_params/serial_params.c --serial-ports --config-files /home/zth/catkin_ws/Firmware/src/lib/battery/module.yaml /home/zth/catkin_ws/Firmware/src/drivers/gps/module.yaml /home/zth/catkin_ws/Firmware/src/modules/mavlink/module.yaml
Failed to import jinja2: No module named 'jinja2.asyncsupport'

You may need to install it using:
    pip3 install --user jinja2

FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-build 
cd /home/zth/catkin_ws/Firmware/build/px4_sitl_default/build_gazebo && /usr/bin/cmake --build .
ninja: build stopped: subcommand failed.
Makefile:198: recipe for target 'px4_sitl_default' failed
make: *** [px4_sitl_default] Error 1

The first mistake is:

ModuleNotFoundError: No module named 'jinja2.asyncsupport'

Solution process:

1. Install jinja2 according to the command given in the error prompt:

zth@SugoAsurada:~/catkin_ws/Firmware$ pip install jinja2
Collecting jinja2
  Using cached https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2)
  Downloading https://files.pythonhosted.org/packages/fb/40/f3adb7cf24a8012813c5edb20329eb22d5d8e2a0ecf73d21d6b85865da11/MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: MarkupSafe, jinja2
Successfully installed MarkupSafe-1.1.1 jinja2-2.11.2

The version of jinja2 installed with this command is 2.11.2.
In ~ / catkin_ View the version of jinja2 under the directory WS / firmware,

zth@SugoAsurada:~/catkin_ws/Firmware$ python
Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
>>> jinja2.__version__
'2.10'
>>> exit()

The resulting version is 2.10.
Obviously, jinja2 was not installed in the path we needed.

2. Check the location of jinja2 in the current path, and find the cause of the problem

zth@SugoAsurada:~/catkin_ws/Firmware$ python
Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
>>> jinja2.__file__
'/usr/lib/python2.7/dist-packages/jinja2/__init__.pyc'
>>> exit()

After coming to the directory ‘/ usr / lib / python2.7/dist-packages/jinja2’, I found that there are no files in the directory asyncsupport.py . The PY file is missing from the official website.

3. Delete jinja2 from the specified directory and install a new jinja2

Unload command:

sudo  rm -r /usr/lib/python2.7/dist-packages/jinja2

Output results:

zth@SugoAsurada:~/catkin_ws/Firmware$ sudo  rm -r /usr/lib/python2.7/dist-packages/jinja2
zth@SugoAsurada:~/catkin_ws/Firmware$ python
Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named jinja2
>>> exit()

Installation command:

sudo pip install jinja2 --target=/usr/lib/python2.7/dist-packages

Inspection output:

zth@SugoAsurada:~/catkin_ws/Firmware$ python
Python 2.7.17 (default, Sep 30 2020, 13:38:04) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import jinja2
>>> jinja2.__file__
'/usr/lib/python2.7/dist-packages/jinja2/__init__.pyc'
>>> jinja2.__version__
'2.11.2'
>>> exit()

How to Solve Error: Driver “kvm2“ not found

This error occurred in the environment of Ubuntu 16.04. According to the official KVM installation mode, starting minicube still reported an error

curl -LO https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2
chmod +x docker-machine-driver-kvm2
sudo mv docker-machine-driver-kvm2 /usr/local/bin/

As above, after installing docker-machine-driver-kvm2 (note that the version should not be too new)

Sudo: unable to resolve host solution

When using the sudo command of Linux, some people may encounter such a problem: “sudo: can’t parse the host: xxxxx (your host name). I also encounter this problem. I have found a solution on the Internet and share it with you here.

This problem is caused by the hosts file is not well configured, Linux can not resolve to your host address, the solution is as follows:

sudo vim /etc/hosts

VIM is the command of your text editor. If you don’t have VIM in your computer, you can use GEDIT.

After opening the file, the

127.0.1.1  xxxxx

The following XXX is replaced by your computer host name, which is the last string of characters in the error. If not, add it in. If there are many parts of soybean oil, they can be replaced in batches.

Article link: sudo: unable to resolve host solution

Make update-api Error: ckati failed with: signal: killed

This situation is generally caused by the insufficient size of swap partition. Add swap partition and recompile it.
The following is the configuration method

cd /
sudo dd if=/dev/zero of=/swp bs=10M count=400
sudo mkswap /swp
sudo swapon /swp

Method 1:

Use free - m to view the swap space
refer to blog post
Add swap partition
to view the swap space

Method 2:

export LC_ALL=C

Ubuntu “a user name is not in the sudoer folder. It will be reported. ” Solutions for

If the user name was not created when the system was installed, this problem occurs when using the sudo command.

Solution: input

su

Enter the root password. If you have not set the root password before, please visit the URL settings.
http://blog.csdn.net/baidu_ 27280587/article/details/53285620

After entering the successful root environment, enter

gedit /etc/sudoer

After opening the file, find the

root	ALL=(ALL:ALL) ALL

In this line, add the same line below it, and change root to your user name. Save and close the file, and then use the sudo command, no more errors will be reported.

Solve the problem of USB mouse failure in the laptop mode of Ubuntu

A while ago, in order to solve the problem of not saving the brightness of the boot, the laptop mode management system was installed

But recently, I happened to find that the mouse can’t be used after the power is off. Because I have no time and seldom use the notebook in battery mode, I never care about it.

If you are free today, try the online method. Solve this problem. The method is as follows

First, input lsusb in the terminal, and the display is as follows:

$lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 058f:a014 Alcor Micro Corp. 
Bus 001 Device 004: ID 0bda:0139 Realtek Semiconductor Corp. 
Bus 002 Device 003: ID 093a:2521 Pixart Imaging, Inc. 
Bus 002 Device 004: ID 1a2c:0002 

If you find multiple devices. But I don’t know which is the USB mouse. Don’t worry. I don’t know. Then look down.

Enter the following command:
0

lsusb -xv

It shows a lot of detailed information. What can we do.

Can’t you read it?

Of course not. We export the result with the following command.

lsusb -xv > ~/mouse.txt

And then do it

gedit ~/mouse.txt

We went to the “mouse” editor, and we went up there. Just look for the ID of the mouse.

Bus 002 device 003: ID 093A: 2521 pixart imaging, Inc.
this is what I found. Remember 093A: 2521

Then open the configuration with the following command.

sudo gedit /etc/laptop-mode/conf.d/usb-autosuspend.conf

Search again for “autosuspend”_ USBID_ BLACKLIST=”

I found it. Under my picture

In the double quotation marks at the end of the second line of yellow, fill in the ID of the mouse. That’s 093a:2521

. Is the mouse still working normally after saving and unplugging?

PS: my current computer is ubuntu12.04

reference resources: http://forum.ubuntu.org.cn/viewtopic.php?t=391117