英文:
Clingo cannot access certain files
问题
我第一次使用Clingo,并按照提供的安装说明使用miniconda进行安装。我确实有一个可用的环境,但它只在单个文件夹中运行,我不确定原因。我最终希望能够让它在我的本地GitHub存储库中运行,但我尝试在计算机上特定文件夹之外运行任何文件时都会返回错误。下面是一个屏幕截图;第一个命令是在一个新文件夹中尝试,而第二个尝试是在唯一有效的文件夹中。
我正在尽力调查,但我是个新手。我最佳的猜测是它只在一个工作目录中有效。但我找不到如何更改我的工作目录的方法。
英文:
I am working with Clingo for the first time and followed the given installation instructions using miniconda. I do have a working environment, but it only works in a single folder and I am not sure why. I am ultimately trying to get it to work in my local GitHub repository, but any file I try to run outside of a specific folder on my computer returns an error. Below is an screenshot; the first command was an attempt in a new folder while the second attempt is in the only folder that works.
I am investigating the best I can, but I am a novice. My best guess is the folder it works in is the only working directory. How to change my working directory I cannot find though.
答案1
得分: 2
如果您在基本的 conda 环境中安装了 clingo(根据截图推测,您可能已经这样做了),那么只要基本环境处于活动状态,您应该能够从任何地方访问它。
可能的原因可能包括:
- 您的
C:\Users\<your username>\
目录下没有test2.lp
文件。 - 您的
test2.lp
文件语法有误。
后一种选项似乎不太可能,因为我认为 clingo 会指定您的语法错误具体在哪里(但它并没有这样做),但您也可以进行检查。
英文:
If you installed clingo in your base conda environment (which from the screenshots I infer you probably did) you should be able to access it from anywhere given that the base environment is active.
Possible culprits can be:
- there is no file
test2.lp
at yourC:\Users\<your username>\
- your
test2.lp
has wrong syntax.
The latter option seems less likely, because I think clingo would specify where your syntax error precisely is (and it is not doing that), but you could also check it.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论