Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ModuleNotFoundError:没有名为';tkfilebrowser';_Python_Tkinter_Steganography - Fatal编程技术网

Python ModuleNotFoundError:没有名为';tkfilebrowser';

Python ModuleNotFoundError:没有名为';tkfilebrowser';,python,tkinter,steganography,Python,Tkinter,Steganography,我正在尝试编写一段代码来制作GUI,但我不断得到一个错误ModuleNotFoundError:没有名为“tkfilebrowser”的模块。 代码中存在无法导入“tkfilebrowser”的问题 from PIL import Image import tkinter import tkinter.ttk from tkinter import filedialog from tkfilebrowser import askopendirname, askopenfilename, asks

我正在尝试编写一段代码来制作GUI,但我不断得到一个错误ModuleNotFoundError:没有名为“tkfilebrowser”的模块。 代码中存在无法导入“tkfilebrowser”的问题

from PIL import Image
import tkinter
import tkinter.ttk
from tkinter import filedialog
from tkfilebrowser import askopendirname, askopenfilename, asksaveasfilename

def gendat(data):#convert data into binary data

        newd=[]
        for i in data:
            newd.append(format(ord(i),'08b'))
        return newd

def modpix(pix,data):#To return the modified pixels

    datalist=gendat(data)
    lendata=len(datalist)
    imdata=iter(pix)

    for i in range(lendata):
        pix=[value for value in next(imdata)[:3] + next(imdata)[:3] + next(imdata)[:3]]

        for j in range(0,8):
            if (datalist[i][j]=='0') and (pix[j]%2!=0):
                if (pix[j]%2!=0):
                    pix[j]-=1
            elif (datalist[i][j]=='1') and (pix[j]%2==0):
                pix[j]-=1
#0 means keep reading; 1 means the message is over.
        if i==lendata-1:
            if pix[-1]%2==0:
                pix[-1]-=1
        else:
            if pix[-1]%2!=0:
                pix[-1]-=1

        pix=tuple(pix)
        yield pix[0:3]
        yield pix[3:6]
        yield pix[6:9]

def encode_enc(data):

    s2=tkinter.Tk()
    name=askopenfilename()
    image=Image.open(name,'r')
    global newimg
    newimg=image.copy()

您好根据tkfilebrowser pypi描述,它是本机tkinter模块的替代品,需要单独安装

pip安装tkfilebrowser

更多信息

您是否安装了tkfilebrowser?