Pold87 / myPDDL

PDDL Syntax Highlighting, Snippets, Domain Visualization and more for Sublime Text
35 stars 10 forks source link

name 'myPDDL' is not defined #10

Open newarney opened 5 years ago

newarney commented 5 years ago

Hello!

I am trying to use myPDDL in Sublime, but when trying to calculate the distance, I find the following error:

myPDDL-distance Traceback (most recent call last): File "", line 1, in NameError: name 'myPDDL' is not defined Exception in thread Thread-6: Traceback (most recent call last): File "./python3.3/threading.py", line 901, in _bootstrap_inner File "/home/newarney/.config/sublime-text-3/Packages/myPDDL/mypddl.py", line 40, in run subprocess.Popen([self.mypddl_cmd, "distance", self.file_name]) File "./python3.3/subprocess.py", line 819, in init File "./python3.3/subprocess.py", line 1386, in _execute_child TypeError: Can't convert 'NoneType' object to str implicitly

I am using Ubuntu 18.04.3 LTS OS (64 bit).

Thank you!

Pold87 commented 5 years ago

Hi! Have you tried to run the distance calculation from the command line (i.e., not within Sublime Text)? What happens if you type myPDDL distance example.pddl?

newarney commented 5 years ago

Hello,

I solved the problem. The point is, I'm using Sublime Text 3, but myPDDL path was pointing to Sublime Text 2. The path fix looks like this: path=~/.config/sublime-text-3/Packages/myPDDL

Thank you!

Pold87 commented 5 years ago

Thank you for the feedback! I'll update the README so that it points to Sublime 3.

anentropic commented 4 years ago

is there not some way to have this line from myPDDL file:

path=~/.config/sublime-text-2/Packages/myPDDL

...to just use the current path of the myPDDL file itself?

That would be a better default

Then you can just add

export PATH=$PATH:<path to Sublime Text>/Packages/myPDDL

to your .bashrc as per the README and be done

anentropic commented 4 years ago

here is a way for that:

# Set this path to the myPDDL folder
# Don't use a trailing slash (right: /myPDDL, wrong: /myPDDL/)
path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

as found here https://stackoverflow.com/a/246128/202168