简体   繁体   English

Windows 错误 3:系统找不到指定的路径 pyinstaller

[英]Windows Error 3 : The system cannot find the path specified pyinstaller

I have converted a .py file to an .exe file.我已将 .py 文件转换为 .exe 文件。 When I run the .exe file on my computer it works well.当我在计算机上运行 .exe 文件时,它运行良好。 When I try another PC it does not work.当我尝试另一台 PC 时,它不起作用。 It says Line 16 by the way.顺便说一句,它说的是第 16 行。 First block below is my code.下面的第一个块是我的代码。 Second one is the error.第二个是错误。

import sys, os 
def resource_path(relative_path):
    if hasattr(sys, '_MEIPASS'):
        return os.path.join(sys._MEIPASS, relative_path)
    return os.path.join(os.path.abspath("."), relative_path)
from tkinter import * 
from tkinter.filedialog import *
from PIL import ImageTk, Image
import numpy as np 
import numpy.random.common
import numpy.random.bounded_integers
import numpy.random.entropy
import pandas as pd 
# Change working directory
pathwd = "E:\\Desktop\\tkinter final backups\\Machine Learning Implementing Program"
os.chdir(pathwd)

WindowsError: [Error 3] The system cannot find the path specified: 'E:\\Desktop\\tkinter final backups\\Machine Learning Implementing Program' WindowsError: [错误 3] 系统找不到指定的路径:'E:\\Desktop\\tkinter final backups\\Machine Learning Implementation Program'

可能是因为另一个系统与您的系统没有相同的目录。

I have solved the problem with these codes below ,我已经解决了下面这些代码的问题,

pathwd = "C:"+os.environ["HOMEPATH"]+"\\Desktop"

os.chdir(pathwd)

But now i have another problem :) .但现在我有另一个问题:)。 In my tkinter project it has some images.在我的 tkinter 项目中,它有一些图像。 But when i open a page on the exe file it says for example The system cannot find the path specified "abcdef.jpeg" how can i embed a picture in exe?但是当我在 exe 文件上打开一个页面时,它说例如系统找不到指定的路径“abcdef.jpeg”我如何在 exe 中嵌入图片?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows / Python错误WindowsError:[错误3]系统找不到指定的路径 - Windows/Python Error WindowsError: [Error 3] The system cannot find the path specified PyInstaller Winerror3:系统无法找到指定的路径 - PyInstaller Winerror3 : System cannot find path specified WindowsError:[错误3]系统找不到指定的路径? - WindowsError: [Error 3] The system cannot find the path specified? WindowsError:[错误3]系统找不到指定的路径 - WindowsError: [Error 3] The system cannot find the path specified Python:[错误3]系统找不到指定的路径: - Python :[Error 3] The system cannot find the path specified: 尝试安装 pyInstaller,但是在创建 venv 时出现错误提示“系统找不到指定的路径”。 - Trying to install pyInstaller, however when creating a venv comes up with error saying “The system cannot find the path specified.” 如何在windows命令promt中创建一个django项目,我收到错误“系统找不到指定的路径” - how to create a django project in windows command promt, i am getting an error of “the system cannot find the the path specified” conda环境激活报错:“系统找不到指定的路径。” (窗户 10) - Conda environment activation error: “The system cannot find the path specified.” (windows 10) Google Cloud SDK Windows 安装程序错误:“系统找不到指定的路径” - Google Cloud SDK Windows Installer Error: "System cannot find the path specified" 该系统找不到指定的路径: - The system cannot find the path specified:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM