manjaro with python development environment configuration

1.manjaro arrangement

1.1. Startup Items

sudo update-grub

1.2 Source change:

sudo pacman-mirrors -i -c China -m rank 
sudo pacman -Syy

Note: Pacman commonly used commands

Pacman is the Arch Linux package manager. It combines a simple binary package format and easy to use build system combines. Whether the package is from the official Arch library or user-created, Pacman can get easy management.

Update System

In Archlinux using a command to update the entire system:
pacman -Syu
If you have used pacman -Sythe local package database with a remote warehouse synchronization can be performed only:pacman -Su

Installation package

➔ pacman -S package name: for example, the implementation of pacman -S firefox will install Firefox. You can also install multiple packages,
just to name a space separated package.
➔ pacman -Sy package name: The difference is that with the above command, the command will perform the installation package and then synchronize database.
➔ pacman -Sv package name: After the installation information display some operations.
➔ pacman -U: local installation package, which extension pkg.tar.gz.
Pacman -U ➔ http://www.example.com/repo/example.pkg.tar.xz install a remote packet (source arranged not inside pacman)

Delete Package

➔ pacman -R package name: This command will only delete the package to retain all of its dependencies installed
➔ pacman -Rs Package name: the removal of the package at the same time, remove all of its dependencies not be used by other installed packages
➔ pacman -Rsc package name: the removal of the package at the same time, remove all depend on this package of programs
➔ pacman -Rd package name: Do not check dependencies when deleting packages.

Search package

➔ pacman -Ss Keyword: Search contains keywords in the warehouse.
➔ pacman -Qs Keyword: Search installed packages.
➔ pacman -Qi package name: View detailed information on packages.
➔ pacman -Ql Package name: lists the files in the package.

Other Uses

➔ pacman -Sw package name: Only download packages, do not install.
➔ pacman -Sc: Cleaning up the package file is not installed, the package file is located in / var / cache / pacman / pkg / directory.
➔ pacman -Scc: cleaning up all the cache files.

1.3.Vim installation

sudo pacman -S vim

1.4. Adding archlinuxCN source

With vim editor /etc/pacman.conf -> command: sudo vim /etc/pacman.conf

In the bottom of the file add the following lines:

[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

Flush the cache key chains and introducing
the modified well above two portions, the terminal performs the following instructions:

sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring

Then, upgrade the system

sudo pacman -Syyu

1.5 Installation Tools:

sudo pacman -S yaourt

1.6. Chinese fonts

Conventional Linux systems are the lack of Chinese fonts need to be installed

sudo pacman -S ttf-roboto noto-fonts ttf-dejavu
# 文泉驿
sudo pacman -S wqy-bitmapfont wqy-microhei wqy-microhei-lite wqy-zenhei
# 思源字体
sudo pacman -S adobe-source-code-pro-fonts 
sudo pacman -S adobe-source-sans-pro-fonts
sudo pacman -S adobe-source-serif-pro-fonts
sudo pacman -S adobe-source-han-sans-cn-fonts   
sudo pacman -S adobe-source-han-serif-cn-fonts  

1.7. Chinese input method

I like Sogou input method

sudo pacman -S fcitx-sogoupinyin
sudo pacman -S fcitx-im         # 全部安装
sudo pacman -S fcitx-configtool # 图形化配置工具

Edit the ~/.xprofilefile, add the following at the end of the file

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"

After logging off, you can see slightly fcitx icon in the lower right (or upper-left corner).

1.8 Application software installation

1.8.1.wps and the corresponding font

sudo pacman -S wps-office-cn
sudo pacman -S ttf-wps-fonts

Note: 2020.1.24 installation wps-office-cn 11.1.0.9080-3 for the Chinese version

1.8.2.Foxit:

yaourt foxit

1.8.3.Chrome browser:

sudo pacman -S google-chrome

google open proxy mode:

google-chrome --proxy-server=socks5://127.0.0.1:1080

1.8.4 Install Markdown editor

sudo pacman -S typora

1.8.5.pacman manager

Install QQ, baiduwanpan, VMware Workstation, Anaconda, ClamTK

anaconda activation

In ~/.bashrcadding:

sudo vim ~/.bashrc

Activation pathway:

export PATH="/opt/anaconda/bin:$PATH"

Activate the default environment:

source /opt/anaconda/bin/activate base

Configuration Mirror:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

1.8.6.ClamAV

Update the virus database

sudo freshclam

Error: Can't create temporary directory

If the following error occurs, use the expression with the UID and GID numbers ::

ERROR: Can't create temporary directory /var/lib/clamav/tmp

Hint: The database directory must be writable for UID 1000 or GID 1001
ERROR: Initialization error!

Correct permissions:

chown UID:GID /var/lib/clamav & chmod 755 /var/lib/clamav

eg: sudo chown 1000:1001 /var/lib/clamav & sudo chmod 755 /var/lib/clamav

Daemon installed


Systemctl should start the service named clamd.service

By sudo or as root:

sudo systemctl enable clamd.service
sudo systemctl start clamd.service

2.Vscode installation configuration python development environment

sudo pacman -S visual-studio-code-bin 

Vscode is an open source cross-platform editor. By default, the language used is English vscode (us), how to modify the language into Chinese?

1) Open the vscode tools;

2) Use the shortcut key combination [Ctrl + Shift + p], enter "configure display language" in the search box, click OK;

3)选择 Install additional languages,安装Chinese (Simplified) Language Pack for Visual Studio Code ;

4) Restart vscode tools;

5) Plug

The following diagram, open the software after installation, click on the icon in the bottom left of the search Python, the first selection list and click install a plug-in installation program.

6) plug-in installation Anaconda Extension Pack

7) plug-in name: Guides;

插件功能: 这个插件的作用是增加 .py 中的指示线,用这个插件能让代码的层次结构更加清晰。

8)插件名称:Bracket Pair Colorizer ;

插件功能: 这个插件的作用是给代码中的括号增加颜色,同一对括号是相同的颜色,尤其是在括号中还包着括号的时候,看起来更加的清晰。

9)文件头添加

  • 自定义代码片段
  1. 文件>首选项>用户代码片段
  2. 搜索python
  3. 添加代码
"HEADER":{
        "prefix": "header",
        "body": [
            "# -*- encoding: utf-8 -*-",
            "",
            "# @File    : $TM_FILENAME",
            "# @Time    : $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
            "# @Author  : Wen Jungang ",
            "# @Version : 1.0",
            "# @Contact : [email protected]",
            "",
            "",
            ""
        ],
    }
  • 添加文件头
  1. 新建文件
  2. 输入header
  3. 选择header

10)打开工作目录

如下图,点击左边的 文件图标,再点击“打开文件夹”按钮,选择一个文件夹作为工作目录,之后新建的文件都会存放在这个目录下。
添加完后如下图,我的文件名为python,添加后所有字母都变为大写。

11)新建hello.py

如下图,点击左边文件的图标,鼠标移到工程的目录名,我的是VSCODEPROJECT,会出来一个有个+号的文件,点击,然后输入hello.py就会会生成.py文件,如何print("hello"),点击F5,在下面的调试窗口会出来一个hello,没有报错就说明已经配置成功了,接下来就可以进行Python的开发了。

12)代码格式化工具yapf

在VSCode中按下快捷键Alt+Shift+F即可自动格式化代码操作起来特别简单。

Guess you like

Origin www.cnblogs.com/Jankin-Wen/p/12233249.html