Skip to content

your system does not have picgo installed, please install it before use. #3118

Closed

Description

@liwmj

Description

  • 1.The environment variable
    image

  • 2.Upload clipboard pictures
    image

I really don't know where the problem is, help!

Steps to reproduce

  • "Preferences"->"Image"->"Uploader", select "picgo", prompt "your system does not have picgo installed, please install it before use."
  • Has always been, Even when you reboot your computer.

Versions

  • MarkText version:0.17.1
  • Operating system:macOS Monterey 12.2.1

Activity

  1. YalandHong commented on Mar 11, 2022

    @YalandHong

    Duplicate of #2996. But I prefer this issue since it uses English and contains a screenshot.

  2. liwmj commented on Mar 11, 2022

    @liwmj
    Author

    Duplicate of #2996. But I prefer this issue since it uses English and contains a screenshot.

    I just checked #2996 and it's slightly different from my environment, My Picgo is a command line application(The exact expression is picgo-core), while #2996 is a desktop application.

    In addition, I tried picgo's desktop program on my computer, and it still failed.

  3. shPisces commented on Mar 16, 2022

    @shPisces

    my Marktext is 0.17.1,and Picgo is 2.3.0. It has a error:
    your system does not have picgo installed, please install it before use.
    image
    image
    image

  4. JoJoJotarou commented on Mar 16, 2022

    @JoJoJotarou

    I successfully uploaded the image using Picgo-core

    install & setting

    npm install picgo -g
    picgo add gitee
    picgo set uploader

    Then i manually changed the values of uploader and current to gitee(Their default smms, and can not changed by picgo set uploader. I not known why🥲).This is my config.json.

    // ~/.picgo/config.json
    {
      "picBed": {
        "uploader": "gitee",
        "current": "gitee",
        "gitee": {
          "owner": "xxx",
          "repo": "xxx",
          "path": "xxx",
          "token": "xxx",
          "message": ""
        }
      },
      "picgoPlugins": {
        "picgo-plugin-gitee": true
      }
    }

    OS: Windows11
    nodejs: v16.14.0
    marktext: 0.17.1
    picgo-core: 1.5.0-alpha.0

  5. daoshenzzg commented on Mar 18, 2022

    @daoshenzzg

    上面的问题我也遇到了。我用比较别扭的方式Shell script location解决了....

    1. 第一步:安装PicGo-Core。我是mac,命令我用的npm install picgo -g,可能会遇到一些错误,按照提示修复即可。
    2. 第二步:sm.sm官网注册个账号,登录后在个人主页找到API Token菜单,点击Generate Secret Token按钮,生成一个Secret Token。
    3. 第三步:把上一步的token,配置到picgo配置文件去,参考PicGo-Core配置。json文件加一个:
    "smms": {
          "token": "$YOUR_TOKEN" // 从 https://sm.ms/home/apitoken 获取的 token
        }
    1. 第四步:通过picgo u xxx.png 上传一个图片试试效果。
      image

    2. 第五步:准备一个脚本,比如我的picgo_upload.sh,并给执行权限,如chmod 755 picgo_upload.sh

    #!/bin/bash
    source  /etc/profile
    export LANG="en_US.UTF-8"
    
    img="$(~/.npm-global/bin/picgo u $1)"
    echo $img | awk '{print $NF}' 
    1. 第六步:MarkText>Preferences>Image>Upload image to cloud xxxx>Command line script。然后再Shell script location处,填写刚刚的脚本绝对路径,并保存。

    image

    7. 第七步:效果测试 上传中...

    image

    上传成功:

    image

  6. fxha commented on Mar 31, 2022

    @fxha
    Contributor

    We had/have a similar issues with pandoc on macOS. Is MarkText somehow isolated on the OS?

  7. added
    🐛 bug
    🐳 help wanted
    🍏 platform/macOS
    on Mar 31, 2022
  8. strive1216 commented on Apr 4, 2022

    @strive1216

    @daoshenzzg 我也配置命令行脚本,但是不成功,手动单独执行可以,感觉marktext并没有调用配置的脚本,也没有其他异常信息

  9. liwmj commented on Apr 8, 2022

    @liwmj
    Author

    In my opinion, Mark Text runs on a native MAC OS.

    Installation:brew install marktext
    Operation::Launchpad --> click 'MarkText'

    We had/have a similar issues with pandoc on macOS. Is MarkText somehow isolated on the OS?

  10. hjue commented on Apr 12, 2022

    @hjue

    @daoshenzzg 我也配置命令行脚本,但是不成功,手动单独执行可以,感觉marktext并没有调用配置的脚本,也没有其他异常信息

    我也是同样的情况。不知道在哪里可以看到marktext的日志

  11. nanbobike commented on May 5, 2022

    @nanbobike

    need the function "choose the picgo install location"

  12. daoshenzzg commented on May 19, 2022

    @daoshenzzg

    @daoshenzzg 我也配置命令行脚本,但是不成功,手动单独执行可以,感觉marktext并没有调用配置的脚本,也没有其他异常信息

    我试了下,我的这种方式,拷贝的本地图片没有问题,截图的不行。

  13. daoshenzzg commented on May 19, 2022

    @daoshenzzg

    @daoshenzzg 我也配置命令行脚本,但是不成功,手动单独执行可以,感觉marktext并没有调用配置的脚本,也没有其他异常信息

    我也是同样的情况。不知道在哪里可以看到marktext的日志

    我试了下,我的这种方式,拷贝的本地图片没有问题,截图的不行。

  14. 4 remaining items

  15. tianfeng98 commented on Jun 10, 2022

    @tianfeng98

    我在Windows 10上实验,npm i -g picgo安装picgo-core之后,就可以正常检测到picgo命令并执行。
    但MacOS上有一个奇怪的现象:
    启动dev命令是可以检测到picgo并正常使用
    image
    使用build命令打包后,安装.dmg包,发现picgo命令又失效了
    image
    picgo的子进程命令似乎没有执行……

    MacOS: Monterey 12.4

  16. coderwing commented on Jun 13, 2022

    @coderwing

    您好,我修改了代码,重新编译打包后,打开的app上传图片还是只能上传复制的本地路径的图片,截图的还是不行,我都已经修改成这样了:
    image

  17. tianfeng98 commented on Jun 14, 2022

    @tianfeng98

    您好,我修改了代码,重新编译打包后,打开的app上传图片还是只能上传复制的本地路径的图片,截图的还是不行,我都已经修改成这样了: image

    这样改了之后,没有传filepath本地路径的图片应该不能上传了...
    有报错信息吗?或者启动dev调试一下

  18. stutiredboy commented on Jun 22, 2022

    @stutiredboy

    不能正常处理截图,只能是已经保存在本地的文件可以用自定义脚本的方式,这就有点尴尬

  19. chinayangxiaowei commented on Jul 17, 2022

    @chinayangxiaowei

    Modify here and add the path "/usr/local/bin"

    const patchEnvPath = () => {
      if (process.platform === 'darwin') {
        process.env.PATH += (process.env.PATH.endsWith(path.delimiter) ? '' : path.delimiter) +
        '/usr/local/bin:/Library/TeX/texbin'
      }
    }
  20. cyy53589 commented on Jul 18, 2022

    @cyy53589

    Modify here and add the path "/usr/local/bin"

    const patchEnvPath = () => {
      if (process.platform === 'darwin') {
        process.env.PATH += (process.env.PATH.endsWith(path.delimiter) ? '' : path.delimiter) +
        '/usr/local/bin:/Library/TeX/texbin'
      }
    }

    @chinayangxiaowei
    It seems that my '/usr/local/bin' folder dose not contain PicGo. Are you using PicGo Core?

  21. chinayangxiaowei commented on Jul 22, 2022

    @chinayangxiaowei

    Modify here and add the path "/usr/local/bin"

    const patchEnvPath = () => {
      if (process.platform === 'darwin') {
        process.env.PATH += (process.env.PATH.endsWith(path.delimiter) ? '' : path.delimiter) +
        '/usr/local/bin:/Library/TeX/texbin'
      }
    }

    @chinayangxiaowei It seems that my '/usr/local/bin' folder dose not contain PicGo. Are you using PicGo Core?

    Yes, I'm using the picgo command line version of "picgo core".
    You can install it by typing "npm install -g picgo" in the terminal console

  22. Thesoul20 commented on Mar 26, 2023

    @Thesoul20

    There is a long time since the first discuss, but the problem still appear in the last version of MarkText. I hope the maintainers will resolve this bug:

    1. MarkText can find the system picgo-core application.
    2. the images in the clipboard will upload normally through picgo.
  23. Admingyu commented on Mar 27, 2023

    @Admingyu

    same problem here, not working event write a bash.

  24. jt-z commented on Apr 26, 2024

    @jt-z

    same problem here,no matter what , thanks for the all developers!

  25. Admingyu commented on Apr 26, 2024

    @Admingyu
  26. dodiadodia commented on Oct 30, 2024

    @dodiadodia

    I rebuild marktext and release a fixed version on MacOS picgo-core installed by brew
    Fixed:

    1. Can't find picgo-core cmdline
    2. Can't upload the images in the clipboard
      Welcome to try.
  27. Xnhyacinth commented on Jan 6, 2025

    @Xnhyacinth

    I rebuild marktext and release a fixed version on MacOS picgo-core installed by brew Fixed:

    1. Can't find picgo-core cmdline
    2. Can't upload the images in the clipboard
      Welcome to try.

    I'm using macos and marktext version is 0.17.1. I still can't detect the picgo installed!

  28. Jocs commented on Jul 2, 2026

    @Jocs
    Member

    Thanks for the detailed report and screenshots, and thanks to everyone who shared workarounds in the thread. The root cause was the classic macOS issue where a GUI app launched from Finder/Launchpad doesn't inherit your shell PATH, so MarkText couldn't see the picgo/picgo-core CLI installed via npm or Homebrew — plus the uploader didn't handle pasted/screenshot images.

    Both problems have since been fixed in the current code:

    • picgo detection now probes the common install locations on macOS (/usr/local/bin, /opt/homebrew/bin, ~/.npm-global/bin, ~/.npm/bin, /usr/local/lib/node_modules/.bin) in addition to PATH, and the app augments PATH at startup (env.ts).
    • The uploader resolves the picgo binary across those same paths and runs it with an augmented PATH, and clipboard/screenshot images are now written to a temp file and uploaded (not just local file paths).

    Given this, I'm closing the issue as resolved. If you still hit "picgo not installed" or clipboard uploads failing on a recent build, please open a new issue with your MarkText version, how picgo was installed, and the output of which picgo — happy to dig in. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🍏 platform/macOS🐳 help wanted🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions