Ubuntu上wps调用zotero的方法

本人电脑Ubuntu22.04
克隆这位大佬的项目,并转到合适的目录下https://github.com/tankwyn/WPS-Zotero
输入命令

unzip WPS-Zotero-main.zip	# 解压文件
cd WPS-Zotero-main # 进入目录
./install.py # 安装文件

如果上面的流程全部正常,恭喜成功
如果出现了which python命令那里出现问题,请进行下面的步骤
如果在终端输入

which python

能够弹出相应的地址,则可以进行类似的修改
打开install.py文件,找到checkpy()函数
改成如下内容:

# Check whether Python 3 is in PATH
def checkpy():  
    python_exe = '/home/anaconda3/bin/python'  # 这里替换成自己的which python得到的地址
    try:  
        code, res = runcmd([python_exe, '--version'])  
        if code == 0 and res[0].startswith('Python 3'):  
            print('Python in PATH:', res[0])  
            return True  
    except Exception as e:  
        print('Error checking Python version:', e)  
    print('Please ensure Python 3 is installed and accessible.')  
    return False  
  
def runcmd(cmd):  
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)  
    code = p.wait()  
    res = p.stdout.readlines()  
    err = p.stderr.readlines()  
    if err:  
        print('Error:', ''.join(err))  
    return code, res  
  
checkpy()

再次运行./install.py,本人到此处可以重新运行了

相关推荐

  1. Ubuntuwps调用zotero方法

    2024-01-10 20:14:01       62 阅读
  2. Ubuntu Linux安装Chrome浏览器最佳方法

    2024-01-10 20:14:01       66 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-10 20:14:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-10 20:14:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-10 20:14:01       82 阅读
  4. Python语言-面向对象

    2024-01-10 20:14:01       91 阅读

热门阅读

  1. js中的Date对象常用方法总结

    2024-01-10 20:14:01       57 阅读
  2. 【打卡】牛客网:BM76 正则表达式匹配

    2024-01-10 20:14:01       58 阅读
  3. 「HDLBits题解」Module

    2024-01-10 20:14:01       61 阅读
  4. git常用命令

    2024-01-10 20:14:01       57 阅读
  5. 解决Vue.js not detected的问题

    2024-01-10 20:14:01       55 阅读
  6. flink自动发现kafka新增分区

    2024-01-10 20:14:01       58 阅读