这个错误很容易引起误解,一般人都会认为是命令执行了,但是命令找不到作为参数对应的文件或者目录。其实还有一层含义,就是这个命令找不到,命令找不到,也会报没有这个文件或者目录的错误。

为什么找不到这个命令呢?

1. 格式错误,不能直接传入字符串,如果直接传入字符串,需要设置shell=True,这种方法不被推荐,有安全隐患

2. 环境变量的配置,路径没有配置正确,找不到这个bin,创建子进程,因为没有执行/etc/profile的配置脚本,所以环境变量没有这个路径, 所以一般脚本执行都像这样写全路径 /usr/bin/python, 避免找不到python这个命令。

Python subprocess.Popen() error (No such file or directory)的更多相关文章

  1. python subprocess popen 静默模式(不弹出console控制台)

    python subprocess popen 静默模式(不弹出console控制台) import subprocess,sys IS_WIN32 = 'win32' in str(sys.plat ...

  2. 解决clang: error: no such file or directory: such file or directory:的问题

    一,详细问题描述 clang: error: no such file or directory: 'xxx/src/GGBaCollectionViewCell.m' clang: error: n ...

  3. clang: error: no such file or directory: xxx.pch

    今天打开一个下载的例子 报clang: error: no such file or directory: xxx.pch的错 说一下解决方案 1.先在你的工程里找到这.pch文件- 2.把它现在的路 ...

  4. clang: error: no such file or directory: 报错

    clang: error: no such file or directory: '/Users/KuaiYong/Desktop/svn/gamebox_v1.2/SettingViewContro ...

  5. docker iotop :OSError: Netlink error: No such file or directory

    在容器内使用iotop ,错误信息: raceback (most recent call last): File "/usr/sbin/iotop", line 16, in & ...

  6. vue报错 Module not found: Error: Cannot resolve 'file' or 'directory'

    炸了,我好写sell而组件,直接就用了,我的天哪 看你的写了吗,就用: Module not found: Error: Cannot resolve 'file' or 'directory' 页另 ...

  7. CMake error:System Error:No such file or directory CMake error:Could not open file for write in copy operation xxxx.ros_Config.cmake.tmp.

    微型电脑或嵌入式与电脑还是有点不同的,在微型电脑上ros indigo 版本下利用catkin编译如果你遇到如下错误: CMake error:System Error:No such file or ...

  8. window下编写python脚本在linux下运行出错 usr/bin/python^M: bad interpreter: No such file or directory

    今天在windows下使用notepad++写了个python脚本,传到linux服务器执行后提示:-bash: ./logger.py: usr/bin/python^M: bad interpre ...

  9. Xcode编译报错:< Apple Mach-O Linker Warning > clang: error: no such file or directory: 'xxxx'

    Xcode编译报错概述: clang: error: no such file or directory: 'CoreGraphics' 一般原因是链接库内容导入丢失,这种的排查下target - B ...

随机推荐

  1. 使用DNSPod解析Freenom域名

    注册Freenom域名 Freenom官网:http://www.freenom.com Freenom提供的顶级域名包括:tk,ml,ga,cf,gq 申请流程: 注册用户后登陆,然后查询并选择一个 ...

  2. 如何配置JVM系统属性及获取方式System.getProperty("pname")

    https://www.cnblogs.com/keyi/p/7721893.html

  3. 类似于c语言读取文件进行解析

    $log_file_name = 'D:/static/develop/kuai_zhi/acagrid.com/public/Logs/'.date('Ym').'/'.date('d').'_er ...

  4. Android 查看蓝牙hci日志

    最近在调试android连接ble设备,需要查看hci日志.记录一下方法. 1. 开发者选项->启用蓝牙HCI信息收集日志. 2. android 8版本,默认位置/data/misc/blue ...

  5. idea中git颜色不显示或者文件右键没有git按钮解决方法

    VCS--->Enable Version Control Integration,然后选择git就可以了

  6. 关于 ubuntu 下 防火墙 ufw的使用

    ufw 是 iptables 的一个语法糖.详细介绍

  7. GitLab上传项目到新的分支

    多人协同开发,GitLab上的group仓库里的master分支作为开发分支(最终从dev提交的代码),dev分支作为每个人的代码测试后合并的分支,每个人需要定期merge request自己的分支到 ...

  8. JavaScript——this

    一.JavaScript 函数与方法 <body> <script type="text/javascript"> function show(){ con ...

  9. stm32f7699遇到的犯二问题

    没有看到stlink的驱动,难道板子坏了?? 结果:USB线的问题,换了一根用过的线,就行了:

  10. Gym 101981K - Kangaroo Puzzle - [玄学][2018-2019 ACM-ICPC Asia Nanjing Regional Contest Problem K]

    题目链接:http://codeforces.com/gym/101981/problem/K Your friend has made a computer video game called “K ...