我安装了模块docopt,即:pip install --user docopt
。但是,如果我执行脚本,则会收到ImportError
Traceback (most recent call last):
File "compare_files.py", line 19, in <module>
from docopt import docopt
ImportError: No module named docopt
我列出了已安装的模块,并且docopt在其中:
pip list
docopt(0.6.2)
from subprocess import Popen, PIPE
from docopt import docopt
import os
import sys
import re
import csv
import difflib
def main():
print("This line will be printed.")
main ()
将打印此行。
答案 0 :(得分:0)
输入此名称即可
pip install docopt
然后
from docopt import *
或
import docopt