工位ubuntu的配置

用笔记本进行连接:

Xshell连接Ubuntu详细过程-CSDN博客

使用ifconfig需要用到net-tools

终端的使用

常见命令

复制粘贴

ubuntu怎么样复制粘贴-茶猫云

判断是什么环境:

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ echo $SHELL
/bin/bash

安装git

移动光标

https://www.cnblogs.com/iwangzhengchao/p/9699138.html

Ctrl+a光标移动到开始位置
Ctrl+e光标移动到最末尾

清空屏幕:

Ctrl+L 清空屏幕(功能相当于命令clear)

Ctrl+U 剪切文本直到行的起始(可以用于清空行)

命令行复制粘贴

在Ubuntu中使用命令行时,可以使用两种方式来复制和粘贴文本。

第一种方式是使用快捷键,“Ctrl+Shift+C”用于复制,而“Ctrl+Shift+V”用于粘贴。

第二种方式是使用鼠标选择文本后,单击鼠标中键(即鼠标滚轮),这将直接复制选中的文本并将其粘贴到命令行中。

屏幕取词

ctrl+双击c

修改密码

sudo passwd 用户名

本次修改的密码为:19980719

创建文件夹

mkdir Project
-p的作用 
mkdir -p /root/model/Shanghai_AI_Laboratory其中的-p是什么意思

 在Linux和类Unix系统的命令行中,mkdir命令用于创建一个新的目录。-p参数是mkdir命令的一个选项,代表"parents",意思是"父目录"。

当你使用mkdir -p命令时,如果指定的目录结构中包含多个层级的子目录,即使这些子目录目前还不存在,mkdir命令也会递归地创建它们。这意味着,如果需要的话,mkdir会创建所有必需的父目录,以确保最终的目录能够被创建。

例如,命令mkdir -p /root/model/Shanghai_AI_Laboratory会创建/root/model/路径下的所有子目录,包括modelShanghai_AI_Laboratory,以及它们之间的任何中间目录。如果这些目录已经存在,-p参数会确保命令不会报错,而是继续执行。

没有-p参数的情况下,如果命令中包含的父目录不存在,mkdir命令会报错并停止执行。例如,如果/root/model/不存在,尝试执行mkdir Shanghai_AI_Laboratory将会失败,因为model目录还不存在,无法创建Shanghai_AI_Laboratory。使用-p参数可以避免这种情况。

查看文件内容

输入命令 cat  hello.c 就可以看到文件里面的内容

删除文件夹(rmdir;rm -rf ***)

Linux rm命令 删除文件夹_linux 删除文件夹-CSDN博客

打开终端

在ubuntu系统中按:Ctrl+Alt+T即可打开终端

解压

查看当前的用户:who

查看文件的详细信息(ls -l)

过滤的方式:ls | grep pyspark

获取变量值:echo ${变量值}

命令行启动Google

google-chrome

pip

pip install -U命令中,-U是upgrade的缩写

安装软件

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/下载$ sudo apt install ./google-chrome-stable_current_amd64.deb
[sudo] wangfeng 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
注意,选中 'google-chrome-stable' 而非 './google-chrome-stable_current_amd64.deb'
下列【新】软件包将被安装:
  google-chrome-stable
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 535 个软件包未被升级。
需要下载 0 B/104 MB 的归档。
解压缩后会消耗 335 MB 的额外空间。
获取:1 /home/wangfeng/下载/google-chrome-stable_current_amd64.deb google-chrome-stable amd64 118.0.5993.88-1 [104 MB]
正在选中未选择的软件包 google-chrome-stable。
(正在读取数据库 ... 系统当前共安装有 167698 个文件和目录。)
准备解压 .../google-chrome-stable_current_amd64.deb  ...
正在解压 google-chrome-stable (118.0.5993.88-1) ...
正在设置 google-chrome-stable (118.0.5993.88-1) ...
update-alternatives: 使用 /usr/bin/google-chrome-stable 来在自动模式中提供 /usr/bin/x-www-browser (x-www-browser)
update-alternatives: 使用 /usr/bin/google-chrome-stable 来在自动模式中提供 /usr/
bin/gnome-www-browser (gnome-www-browser)
update-alternatives: 使用 /usr/bin/google-chrome-stable 来在自动模式中提供 /usr/
bin/google-chrome (google-chrome)
正在处理用于 gnome-menus (3.36.0-1ubuntu3) 的触发器 ...
正在处理用于 man-db (2.10.2-1) 的触发器 ...
正在处理用于 mailcap (3.70+nmu1ubuntu1) 的触发器 ...
正在处理用于 desktop-file-utils (0.26-1ubuntu3) 的触发器 ...
N: 由于文件'/home/wangfeng/下载/google-chrome-stable_current_amd64.deb'无法被用户'_apt'访问,已脱离沙盒并提权为根用户来进行下载。 - pkgAcquire::Run (13: 权限不够)

安装搜狗

搜狗输入法linux-安装指导

出现体系结构不符合的问题

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/下载$ sudo dpkg -i sogoupinyin_4.2.1.145_arm64.deb 
dpkg: 处理归档 sogoupinyin_4.2.1.145_arm64.deb (--install)时出错:
 软件包体系结构(arm64)与本机系统体系结构(amd64)不符
在处理时有错误发生:
 sogoupinyin_4.2.1.145_arm64.deb
解决办法

【精选】查看Linux系统架构的命令,查看linux系统是哪种架构:AMD、ARM、x86、x86_64、pcc 或 查看Ubuntu的版本号_怎么查看ubuntu是amd还是x-CSDN博客

x86_64,x64,AMD64基本上是同一个东西(所以重新在官网上安装X86_64即可) 

变成繁体怎么办呢

搜狗拼音突然成繁体字了怎么办? - 简书

搜狗的重新启动
wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ (INFO-417401 addon.c:151) Load Addon Config File:fcitx-xim.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-quickphrase.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-clipboard.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-chttrans.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-xkbdbus.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-xkb.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-remote-module.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-unicode.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-x11.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-lua.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-ipc.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-sogoupinyin.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-sogoupinyinhxm.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-kimpanel-ui.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-freedesktop-notify.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-keyboard.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-punc.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-fullwidth-char.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-vk.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-imselector.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-classic-ui.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-autoeng.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-dbus.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-ipcportal.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-spell.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-notificationitem.conf
(INFO-417401 addon.c:151) Load Addon Config File:fcitx-sogoupinyinhdm.conf
(ERROR-417401 module.c:66) fcitx-sogoupinyinhxm ABI Version Error
(ERROR-417401 ime.c:432) fcitx-keyboard-tr-otk already exists
(ERROR-417401 ime.c:432) fcitx-keyboard-us already exists
parse /home/wangfeng/.config/sogoupinyin//logf.conf fail
auth ok
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
start
beacon SetCommonParams
beacon exit init
beacon in thread
sgim_gd_cell.bin copy fail
No such file or directory: No such file or directory
No such file or directory: No such file or directory
^C

用笔记本连接ubuntu台式电脑

Mac远程连接Linux桌面教程_粉粉Shawn的博客-CSDN博客

在windows上实现ubuntu、centos的远程桌面控制-CSDN博客

暂时还是出现如下的问题

安装miwork

为什么miwork打不开?(其实已经打开了,但是没有看到右上角的图标)怎么直接打开还是不行呢?

怎么创建快捷键?

火焰截图

快捷键ctrl+alt+a,然后进行分享,进行编辑

更换镜像源

Ubuntu sudo apt update报错:无法连接上 cn.archive.ubuntu.com:80 (123.129.214.98)。 - connect (111: 拒绝连接) 

Ubuntu sudo apt update报错:无法连接上 cn.archive.ubuntu.com:80 (123.129.214.98)。 - connect (111: 拒绝连接)-CSDN博客

对/etc/apt/sources.list进行备份

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/下载$ sudo cp /etc/apt/sources.list /etc/apt/sources_backup.list

保存时出现如下警告

** (gedit:350930): WARNING **: 14:56:06.900: Set document metadata failed: 不支持设置属性 metadata::gedit-spell-language

** (gedit:350930): WARNING **: 14:56:06.901: Set document metadata failed: 不支持设置属性 metadata::gedit-encoding

pyenv安装和使用

why:

使用pyenv来安装Python解释器,它可以同时安装多个版本的python,并支持基于用户/路径来设置python版本

安装最新版本

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ pyenv install 3.12.0
Downloading Python-3.12.0.tar.xz...
-> https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz
Installing Python-3.12.0...
Installed Python-3.12.0 to /home/wangfeng/.pyenv/versions/3.12.0

poetry安装和使用

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ curl -sSL https://install.python-poetry.org | python3 -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/home/wangfeng/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.6.1): Done

Poetry (1.6.1) is installed now. Great!

To get started you need Poetry's bin directory (/home/wangfeng/.local/bin) in your `PATH`
environment variable.

Add `export PATH="/home/wangfeng/.local/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `/home/wangfeng/.local/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

按照如下方式进行安装出现错误:

如何在 Ubuntu 22.04 上安装 Poetry 来管理 Python 依赖

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/.local/share/pypoetry$ source ~/.bashrc
bash: .: .:是一个目录

将以下行添加到文件末尾:i

. . .
export PATH="/home/sammy/.local/bin:$PATH"

这‘...’ 是什么意思?

并且将其删除也没有效果

解决办法

重新进行安装:显示已经进行安装

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ curl -sSL https://install.python-poetry.org | python3 -
Retrieving Poetry metadata

The latest version (1.6.1) is already installed.

安装环境变量:

编辑.bashrc文件出现如下问题:
E325: 注意
发现交换文件 "~/.bashrc.swp"
            所有者: wangfeng    日期: 四 10月 19 10:17:00 2023
            文件名: ~wangfeng/.bashrc
            修改过: 是
            用户名: wangfeng      主机名: wangfeng-HP-ProDesk-680-G6-PCI-Microtow
           进程 ID: 234550 (STILL RUNNING)
正在打开文件 "/home/wangfeng/.bashrc"
              日期: 四 10月 19 10:13:35 2023

(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    如果是这样,请用 ":recover" 或 "vim -r /home/wangfeng/.bashrc"
    恢复修改的内容 (请见 ":help recovery")。
    如果你已经进行了恢复,请删除交换文件 "/home/wangfeng/.bashrc.swp"
    以避免再看到此消息。

交换文件 "~/.bashrc.swp" 已存在!
以只读方式打开([O]), 直接编辑((E)), 恢复((R)), 退出((Q)), 中止((A)): 
把交换文件进行了删除
sudo rm -rf /home/wangfeng/.bashrc.swp

开始文件路径出现错误,没有修改成自己的文件名

修改了文件名之后仍然出现错误:
wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ source ~/.bashrc
bash: /home/wangfeng/.bashrc: 行 125: 语法错误: 未预期的文件结尾
解决办法:

bash: /root/.bashrc: 行 102: 语法错误: 未预期的文件结尾_bash未预期的文件结尾_林中有神君的博客-CSDN博客

仍然出现如下错误:

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~$ poetry --version
Command 'poetry' not found, but can be installed with:
sudo apt install python3-poetry
解决办法:按照提示进行安装即可

项目开发管理通用流程

新建项目

执行poetry lock出现的错误:python的版本不兼容的问题

wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/Project/my-project$ poetry lock
Updating dependencies
Resolving dependencies... (0.0s)

  SolverProblemError

  The current project's Python requirement (>=3.7,<=3.10) is not compatible with some of the required packages Python requirement:
    - isort requires Python >=3.8.0, so it will not be satisfied for Python >=3.7,<3.8.0
  
  Because isort (5.12.0) requires Python >=3.8.0
   and no versions of isort match >5.12.0,<6.0.0, isort is forbidden.
  So, because my-project depends on isort (^5.12.0), version solving failed.

  at /usr/lib/python3/dist-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For isort, a possible solution would be to set the `python` property to ">=3.8.0,<=3.10"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers
wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/Project/my-project$ vim pyproject.toml 
wangfeng@wangfeng-HP-ProDesk-680-G6-PCI-Microtower-PC:~/Project/my-project$ poetry lock
Updating dependencies
Resolving dependencies... (0.1s)

Writing lock file

poetry配置

poetry config virtualenvs.in-project true

 这个执行的效果是pycharm的项目中多了poetry.lock文件

新建项目

使用poetry新建项目

poetry new my-project-test
效果:

从pycharm导入出现的效果:

自动配置好了python解释器

pyproject.toml里添加isort和yapf的配置

显示这个文件已经过时了

安装vscode

ubuntu18.04系统下安装vscode教程_ubuntu安装vscode-CSDN博客

 这个地方会有些问题(已解决)

选择本路径下的虚拟环境:

并没有出现所显示的虚拟环境

设置formatter和linter

修改settings.json

 后面格式化出现问题:可能的原因就是没有配置好虚拟环境

格式化设置

出现的问题:

Formatting features have been moved to separate formatter extensions. Please install the formatter extension you prefer and set it as the default formatter.

系统自动给出的建议 

2023-10-23 10:17:40.749 [error] Formatting features have been moved to separate formatter extensions.
2023-10-23 10:17:40.749 [error] Please install the formatter extension you prefer and set it as the default formatter.
2023-10-23 10:17:40.749 [error] For `autopep8` use: https://marketplace.visualstudio.com/items?itemName=ms-python.autopep8
2023-10-23 10:17:40.749 [error] For `black` use: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
2023-10-23 10:17:40.749 [error] For `yapf` use: https://marketplace.visualstudio.com/items?itemName=eeyore.yapf

安装yapf

yapf - Visual Studio Marketplace

格式化相关问题

Formatting and linting features have been deprecated from the Python extension. Please install a linter or a formatter extension. [Open logs](command:python.viewOutput) for more information.

PyCharm设置

插件

  • Requirements:提供requirements.txt 文件相关支持
  • 创建虚拟环境:并没有出现自动加载env

服务器查看gpu资源
 

(xtuner-env) [hadoop-mtai@set-zw03-kubernetes-pc242 ~]$ lspci | grep -i nvidia
04:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
05:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
08:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
09:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
85:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
86:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
89:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
8a:00.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB] (rev a1)
  1. lspci:这是一个Linux命令,用于列出PCI设备的信息。PCI(Peripheral Component Interconnect)是一种用于连接计算机主板与外围设备的总线标准。
  2. grep -i nvidiagrep 是一个用于文本搜索的工具,-i 参数表示忽略大小写,所以这里它会搜索所有包含“nvidia”的行(这里的i是“ignore-case”的缩写)
  • 04:00.0, 05:00.0, 08:00.0, ...:这些是PCI设备的地址。每个GPU设备在PCI总线上都有一个唯一的地址。
  • 3D controller:这表示这些设备是3D图形控制器,也就是GPU(图形处理单元)。
  • NVIDIA Corporation GV100GL [Tesla V100 PCIe 32GB]:这是设备的制造商和型号。这里,它们都是NVIDIA的Tesla V100 GPU,具有PCIe接口和32GB的显存。
  • 28
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值