VS Code远程进入容器内部时报错:/bin/sh: line 9: tar: command not found

VS Code远程进入容器内部时报错:/bin/sh: line 9: tar: command not found

问题原因是:镜像内部没有安装tar命令,需要我们进入镜像内部安装tar。

解决办法:

(1)获取容器id

docker ps -a

(2)进入容器内部

docker exec -it 容器id

(3)安装tar(linux系统)

yum install -y tar

(4)使用vscode重新尝试进入容器内部,成功!

(myenv) root@ubuntu24:~# pip3 install mysqlclient Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting mysqlclient Using cached https://mirrors.aliyun.com/pypi/packages/61/68/810093cb579daae426794bbd9d88aa830fae296e85172d18cb0f0e5dd4bc/mysqlclient-2.2.7.tar.gz (91 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [33 lines of output] /bin/sh: 1: pkg-config: not found /bin/sh: 1: pkg-config: not found /bin/sh: 1: pkg-config: not found /bin/sh: 1: pkg-config: not found Trying pkg-config --exists mysqlclient Command &#39;pkg-config --exists mysqlclient&#39; returned non-zero exit status 127. Trying pkg-config --exists mariadb Command &#39;pkg-config --exists mariadb&#39; returned non-zero exit status 127. Trying pkg-config --exists libmariadb Command &#39;pkg-config --exists libmariadb&#39; returned non-zero exit status 127. Trying pkg-config --exists perconaserverclient Command &#39;pkg-config --exists perconaserverclient&#39; returned non-zero exit status 127. Traceback (most recent call last): File "/root/myenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/root/myenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out[&#39;return_val&#39;] = hook(**hook_input[&#39;kwargs&#39;]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/myenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-2ffqty5o/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line
03-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值