Comments (21)
from obsidian_vault_template_for_researcher.
中文注释报错,可以在 author_count.py 第一行新增内容:
# -- coding: utf-8 --
from obsidian_vault_template_for_researcher.
from obsidian_vault_template_for_researcher.
from obsidian_vault_template_for_researcher.
这可能与python版本有关,我使用的是python3.7.10。
注意到你使用的mac,或许可以再检查下 terminal 中默认的 python 版本?
from obsidian_vault_template_for_researcher.
terminal中的python版本是3.8.8,其它环境的python3也在3.8及以上。这句在vscode也能正常使用,不知道为什么报错……
from obsidian_vault_template_for_researcher.
你可以尝试使用 try...except 的方式看看,代码修改建议如下:
from obsidian_vault_template_for_researcher.
from obsidian_vault_template_for_researcher.
看起来还是版本的问题。Templater插件调用了哪个python需要搞清楚。
你可以在 08-Assets/Scripts 目录下新建一个 test.py,填写以下内容:
import sys, platform
print('system:', platform.platform())
print('python_version:', sys.version_info)
print(sys.path)
然后到 Templater 插件设置中新增一个 user function:
再到 09-Templates 目录下新建一个模板「查看系统信息」,填写如下内容:
<% tp.user.show_python_version() %>
然后到任意一个草稿页面中按 Alt+E
插入上一步新建的「查看系统信息」模板,会出现以下信息:
即可查看被 Templater 真实调用的 python 版本情况。
from obsidian_vault_template_for_researcher.
在linux系统上测试也没有复现此问题,按照上述步骤操作结果如下:
system: Linux-5.13.19-2-MANJARO-x86_64-with-glibc2.33
python_version: sys.version_info(major=3, minor=9, micro=7, releaselevel='final', serial=0)
['/run/media/sheldonxxd/T7/projects/working/08-Assets/Scripts', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/home/sheldonxxd/.local/lib/python3.9/site-packages', '/usr/lib/python3.9/site-packages']
linux 跟 macOS 可能更接近一点,且python版本到3.9.7也没有问题。上述结果可供参考。
from obsidian_vault_template_for_researcher.
插入模版后没有出现新的信息……请问是在源码模式下插入模版后就会自动出现吗?
另外我注意到在Templater 插件设置中新增 user function是用的是python开头,这会不会调用python2而不是python3呢?
from obsidian_vault_template_for_researcher.
是的,插入模板,会像下边这样:
关于 mac 中 python = python2,你可以试试修改下。
from obsidian_vault_template_for_researcher.
我在terminal中试过了,python默认是python3。
但是插入模版不能自动跳转,我尝试了其它用到tp的模版,插入后也不能自动更改。但从日程生成草稿是正常的……(如下图所示)
可以看一下您的template插件是如何设置的吗?
from obsidian_vault_template_for_researcher.
from obsidian_vault_template_for_researcher.
看上去是Templater插件的一个奇怪问题。
from obsidian_vault_template_for_researcher.
template设置没问题,但还是不能自动跳转……我仿照作者统计做了个按钮可以用,确实调取的是python2……
目前面临的新问题是,我的package装在anaconda里,请问template的user function可以像terminal中一样使用conda activate base
吗?(我试了试好像不行……)
或者有没有办法在python脚本中指定解释器为anaconda中的python?
from obsidian_vault_template_for_researcher.
在 win11 系统中,在 templater 的 user function 中使用 conda activate base
,Console 报错信息如下:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
当按照提示修改为 CALL conda.bat activate base && python xyz.py
后问题消失。请查看 console 错误提示或可解决,祝好运!
from obsidian_vault_template_for_researcher.
两种命令都尝试了,没有报错,但是好像没有发挥作用……
from obsidian_vault_template_for_researcher.
建议在vscode中直接运行调试 author_count.py
代码,如上图所示,修改文件路径,然后运行即可。 调试方法见 issue #8
作者统计结果会打印在terminal,复制拷贝到笔记中也是一样的,此功能并不常用,只是帮助 follow 大牛新建其页面。
from obsidian_vault_template_for_researcher.
好的,感谢!
from obsidian_vault_template_for_researcher.
看起来还是版本的问题。Templater插件调用了哪个python需要搞清楚。
你可以在 08-Assets/Scripts 目录下新建一个 test.py,填写以下内容:
import sys, platform print('system:', platform.platform()) print('python_version:', sys.version_info) print(sys.path)
然后到 Templater 插件设置中新增一个 user function:
再到 09-Templates 目录下新建一个模板「查看系统信息」,填写如下内容:
<% tp.user.show_python_version() %>
然后到任意一个草稿页面中按
Alt+E
插入上一步新建的「查看系统信息」模板,会出现以下信息:即可查看被 Templater 真实调用的 python 版本情况。
但我的c盘下也有别的python文件夹,这个要怎么处理?麻烦啦,新手小白一枚
from obsidian_vault_template_for_researcher.
Related Issues (20)
- 引文列表和作者排序出现list index out of range HOT 1
- 知网下载的论文,引文列表问题
- Hey, any English Version of this awesome stuff? HOT 1
- 大佬啥时候可以更新呢? HOT 2
- 无法导出笔记
- 插件admonition ad-info 代码块太大覆盖了很多页面 HOT 6
- `page::` 是由哪个插件渲染? HOT 2
- [建议]:utils.py里关于获取yaml数据的改进 & 动态更新yaml数据
- 插入引文列表无反应,QuickAdd: (LOG) TemplaterError: Error with User Template ref_list HOT 1
- 有没有老哥魔改过适配最新版本的模板呀~? HOT 6
- 源代码显示不完整 HOT 2
- 讨论和配适新版obsidian HOT 9
- 草稿归档错误 HOT 2
- 近期已阅不能正常使用 HOT 1
- zotero里面把文献创建了md文件后,在obsidian里面打开的样子和模板页(@Doose2005)不同
- 大佬们这种分页的情况怎么解决的,谢谢 HOT 1
- 请问一下模板里的@Doose2005的Reference列表是如何生成的?
- 草稿归档问题 HOT 4
- 想要修改引文格式
- can't open the mdnotes file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obsidian_vault_template_for_researcher.