Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

python 3.x - Cant import sublime_plugin

I cant import sublime_plugin.

This code worked yesterday: import sublime_plugin But when i came back today it doesn't work. My cmd.py file is inside Sublime Text 3PackagesCMD. It gives me a ModuleNotFoundError. I use sublime text 3 and python 3. It also does not work from the command line.

I also tried to run it in VSCode which didn't work aswell.

Reinstalling sublime text 3 did not fix the problem. After reinstalling Sublime multiple times it now seems to work.

So the whole code i have is:

import os
import sublime_plugin

class CmdCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        os.system("cd " + self.view.file_name() + " & start cmd")

It worked on the day i put it in the folder.

from this link: How can I open command line prompt from Sublime in windows7

Edit: It doesn't work anymore.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try it in Spyder IDE, or try re installing it

-pip install sublime.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...