-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import: command not found #6
Comments
Hmm, it's giving a syntax error. What does the .py file look like in an editor? Also, which release did you download? |
I downloaded the release 10 mins. ago. Not sure what you mean by "What does the .py file look like in an editor?" |
As in, open it in a text editor. The equivalent of Notepad. Could you copy/paste what it looks like in the editor? Also, did you download it directly from the repository, or from the releases tab? |
I downloaded the zip file from here.
|
Hmm, I copy-pasted your output into a python file and ran it, and it worked. What version of python do you have installed? |
2.7.16 |
I am a bit confused by Python because I did upgrade to 3 and yesterday it showed that as the version, today it does not. This is not the 1st time Python does that. |
Ah, that must be the problem. I wrote the script for python3 (specifically 3.8). I'll add that to the documentation, for future reference. I'm guessing it would be too much hassle to install python 3.8? |
Look at this output from my terminal and note Python:
|
Hmm, this is techincally outside the functionality of the script, but I'll see if I can help. From this link - try running |
|
So according to that website, that means 2.7.16 is your default version, even though 3.8.3 is installed. You might want to take a look at this stackoverflow question |
Thanks for that link. I had found another page, where someone suggested making a symlink, which I did. And indeed, the correct Python version is shown. Then I ran the initial script, but no joy. Here is all the output:
|
Hmm, it’s still showing the syntax error. Try running |
Getting there, though not quite yet:
|
Yes, progress! You should check the ‘Permissions’ section in README.md. It lists what the script needs to be able to do on an OS level. |
The Permissions section does not say which file needs to be given permission. |
Just the script I think. The config file is just a text file. |
No joy:
|
The chmod+x only makes it executable I think. It’ll need permission to read and write in order to work properly. |
The info box about the file says it has read and write permission. |
Hmm, I’m not really sure what else it could be, since the error is that the script cannot make a new file for writing. Is it in a special folder that has restrictions on creating files? |
No, not a special folder. I think I'll wait for the appearance of the API and someone (you?) to write a plug-in. That'll be much easier. |
Ok. If you want to do one last check, see if you can write a simple python script in that folder which creates and writes to a file. If you can, that’ll confirm the problem is with my script. If you get a similar error, it’s probably something on your end. |
I am not familiar with writing python scripts. And in any case, I do believe it'll be easier to use a plug-in. |
If you want a script that should work, I’ll give an example (though of course you can just wait for the plugin) with open("test.txt", "w") as f:
f.write("Hello world!") |
So, the script you wrote I can save as e.g. |
Yep, just tested it and it works. Should just be able to copy-paste it in. |
Yes, that works. It created a test.txt file with |
I have to step away from my desk, back in a couple of hours. |
Ah, I think I finally figured out the problem.
However, the way I created the path was taking the path for the script, getting the directory, and concatenating I've changed the way |
I just download the zip package again but there's no mention of v0.3.1, so where can I get it from? |
Ah sorry - you’ll want v0.3.2 or v0.4 now (v0.4 also requires |
Sorry, I must be dumb, but Read.me is the same as before. Where can I get 0.4 from? |
While you were away, I released v0.4. It’s called ‘Markdown formatting and Embedded Images Update’. This link should work. v0.4 introduces a new dependency, |
I downloaded the .py file from the linked-to page. |
Hmm, pip should be installed with python. See if you can get pip to work if you have it, or install it if you don’t. |
Success, I believe:
|
Great! I’ll close this issue now - if you have any further problems, please open a new issue. |
Here is what I tried via the terminal; please advise:
The text was updated successfully, but these errors were encountered: