Skip to content
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

Only when creating an EXE with pyinstaller, 'urlopen error' is found and the 'swagger_spec_validator' folder can not be found. #296

Closed
yanyancyan opened this issue Aug 18, 2018 · 4 comments

Comments

@yanyancyan
Copy link

Running with source code on windows is fine.
ex. python hoge.py

However, if you make EXE with pyinstaller and execute it, the following error will be returned.
Even if you make EXE on windows 7, 8.1, or 10, you get an error.

Please tell me how to solve this problem.

i use version.
pyinstaller-3.3.1-py3.5 and pyinstaller-3.4dev

error messeage
("<urlopen error [WinError 3]:
'C:\\Users\\username\\AppData\\Local\\Temp\\_MEI66722\\swagger_spec_validator\\schemas\\v2.0\\schema.json'>", URLError(FileNotFoundError

i found C:\Users\username\AppData\Local\Temp_MEI66722,
but, i cannot found folder 'swagger_spec_validator' under it.

i use lib.

urllib3 1.23
bravado 10.1.0
bravado-core 5.0.6

import sys
import os
import json
import time
import threading
from tkinter import *
from tkinter import messagebox as message

from urllib.parse import urlparse
import time, hashlib, hmac
from bravado.client import SwaggerClient
from bravado.requests_client import RequestsClient, Authenticator
from bravado.swagger_model import Loader

@verata-veritatis
Copy link

I'm having the same issue. I'm guessing it's something you have to include with the installation but I don't know what.

@pavs94
Copy link

pavs94 commented Jun 18, 2020

I'm having this same issue

@ezequieljardim
Copy link

Hey everyone, I found the same issue. I was running this in a virtualenv, so I'll share my solution in this scope.

The code I executed to generate the exe was: pyinstaller myfile.py --onedir. With this, instead of packaging everything into a single file, it creates an EXE with the libraries in a folder. Once inside the folder that was created, if I executed the EXE it would throw the same error.

The solution I found was: I went to [myVirtualEnv]/Lib/site-packages/swagger_spec_validator and copied that folder. I pasted it into the folder that was generated by pyinstaller, and it worked as expected!

Good luck!

@bwoodsend
Copy link
Member

--collect-data=swagger_spec_validator should be all you need.

@bwoodsend bwoodsend transferred this issue from pyinstaller/pyinstaller Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants