Issue
I had a problem. I created an app with PyQt5, numpy, scipy, redis, etc. There is no problem run with python console. It works. But when I use the pyinstaller to make an exe file and run it, I have many errors.
First I had;
(haydars_env) C:\Users\haydarc\analysis_result>dist\app.exe
Traceback (most recent call last):
File "app.py", line 18, in <module>
from scipy import stats
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "c:\users\haydarc\.conda\envs\haydars_env\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\__init__.py", line 136, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "c:\users\haydarc\.conda\envs\haydars_env\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\scipy\_distributor_init.py", line 61, in <module>
File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 170, in __init__
File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 133, in _frozen_name
AttributeError: 'list' object has no attribute 'join'
[7028] Failed to execute script app
Second I had;
I read from google, someone said it may be numpy issue. So I uninstalled and reinstalled, there is no difference. I installed numpy+mkl, I had dll errors.
I also tried to use fbs, again there is no difference.
Can someone help me?
Note: Here is my libraries;
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtWidgets import QMainWindow, QPlainTextEdit
# from pandasmodel import PandasModel
# Other libraries
import sys as os
import sys
import numpy as np
from scipy import stats
import pickle
import redis
import zlib
import pandas
from pandasmodel import PandasModel
from PyQt5.QtWidgets import QMessageBox
from gui import Ui_MainWindow
Solution
Issue is coming from import sys as os
. os
is another frequently used module and many libraries are using it. The error you have is from os.path.join
: instead of calling the join
method of os.path
module the scipy init is trying to access attribute join
of sys.path
attribute. just rename sys
to a non popular name.
Answered By - Eric Mathieu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.