I use python2.7.1 and pyinstaller compile a executable exe
pyinstaller compile perfectly but the exe can't run
following is error message
Traceback (most recent call last):
File "main_Preview_v4_4.py", line 12, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\openpyxl\__init__.py", line 6, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\openpyxl\workbook\__init__.py", line 5, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\openpyxl\workbook\workbook.py", line 8, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\openpyxl\worksheet\worksheet.py", line 29, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\openpyxl\cell\__init__.py", line 4, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\openpyxl\cell\cell.py", line 65, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\pandas\__init__.py", line 42, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\pandas\core\api.py", line 26, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
File "c:\users\alphalin\appdata\local\temp\pip-unpacked-wheel-dw4d2a\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
File "site-packages\pandas\core\groupby\groupby.py", line 20, in <module>
AttributeError: 'module' object has no attribute 'compat'
[16068] Failed to execute script main_Preview_v4_4
I try to figure out what happen about the error
but google result just lead me to pandas error
I am not using pandas in my code so I am so confuse
any device?
This happens when the icon file (.ico) is collapsed or in incorrect format. If you try it without the --icon argument when running the command in your terminal it might work.
If you try to pass as an argument a different file format, other than .ico you will get errors. Take the image you want to use and convert it to an icon.
If you have to specify and icon then try converting a .png image to .ico. An online converter should do the trick.
Related
I am trying to make an executebale out of a .py script I have, in a virtual environment with pyinstaller. however after making my executeable with pyinstaller --onefile myprogram.py when running the resulting myprogram.exe from command prompt, I get this error:
Traceback (most recent call last):
File "myprogram.py", line 4, in <module>
File "Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module
File "site-packages\IPython\__init__.py", line 48, in <module>
File "Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module
File "site-packages\IPython\core\application.py", line 23, in <module>
File "Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module
File "site-packages\traitlets\config\__init__.py", line 6, in <module>
File "Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 395, in load_module
File "site-packages\traitlets\config\application.py", line 17, in <module>
ImportError: No module named decorator
decorator is installed in the env I'm working in so that is not the problem (python 2.7.17, pyinstaller 3.5, windows 10, anaconda)
thanks in advance!
Upon launching spyder 3.3.6, I receive the following error:
Traceback (most recent call last):
File "/usr/bin/spyder", line 11, in <module>
load_entry_point('spyder==3.3.6', 'gui_scripts', 'spyder3')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 473, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2447, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2453, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/spyder/app/start.py", line 14, in <module>
import zmq
File "/usr/lib/python3/dist-packages/zmq/__init__.py", line 55, in <module>
from zmq import backend
File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 40, in <module>
reraise(*exc_info)
File "/usr/lib/python3/dist-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/usr/lib/python3/dist-packages/zmq/backend/select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "/usr/lib/python3/dist-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (/usr/lib/python3/dist-packages/zmq/backend/cython/__init__.py)
Version of pyzmq is 20.0.0. Using pip, I've tried to update, uninstall-reinstall, and downgrade it to 19.0.2, but nothing helped. I'm using Debian testing, it's up to date.
Any ideas?
I am trying to run 'pip install notebook --upgrade' but I am getting this error. I have tried running as administrator but that does not fix the problem
Traceback (most recent call last):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\administrator\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts\pip.exe\__main__.py", line 4, in <module>
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\cli\progress_bars.py", line 12, in <module>
from pip._internal.utils.logging import get_indentation
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\utils\logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_internal\utils\misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3264, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 574, in _build_master
ws = cls()
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 567, in __init__
self.add_entry(entry)
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 623, in add_entry
for dist in find_distributions(entry, True):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2065, in find_on_path
for dist in factory(fullpath):
File "c:\users\administrator\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2127, in distributions_from_metadata
if len(os.listdir(path)) == 0:
PermissionError: [WinError 5] Access is denied: 'c:\\users\\administrator\\appdata\\local\\programs\\python\\python39\\lib\\site-packages\\~etuptools-49.2.1.dist-info'
Try running the cmd as admin. Then, try upgrading the modules. This could also happen when the installation was not done correctly or the module requires a certain version which could occur in 3.9 since it's new.
Sorry for asking stupid questions.
I have packaged my python source code using Pyintaller (with Ubuntu 16.04 and pyinstaller 3.3.1). It runs perfectly on my own computers but get different errors. The typical error I got is
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.[1996] Failed to execute script predict".
The detailed error message is shown below. Please help me with this, i don't know how to fix it now. Many thanks!
/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py:687: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
Using TensorFlow backend.
Traceback (most recent call last):
File "predict.py", line 2, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "data_pre.py", line 3, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "csvdata_pre.py", line 1, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/__init__.py", line 3, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/utils/__init__.py", line 6, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/utils/conv_utils.py", line 9, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/backend/__init__.py", line 84, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/tensorflow/__init__.py", line 24, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/tensorflow/python/__init__.py", line 115, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/tensorflow/python/platform/test.py", line 61, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/mock/__init__.py", line 2, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/mock/mock.py", line 71, in <module>
File "site-packages/pbr/version.py", line 462, in semantic_version
File "site-packages/pbr/version.py", line 449, in _get_version_from_pkg_resources
File "site-packages/pbr/packaging.py", line 812, in get_version
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.
[49902] Failed to execute script predict
I am using Pyinstaller on Ubuntu to create a binary executable for my Python code. This code has a bunch of files and dependencies. One of them is tensorflow. The executable is getting created correctly but when I try to run it, I get the following error:
Traceback (most recent call last):
File "detection_init.py", line 14, in <module>
import lib.tensorboxDetector as tensorboxDetector
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "lib/tensorboxDetector.py", line 20, in <module>
import tensorflow as tf
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "tensorflow/__init__.py", line 24, in <module>
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "tensorflow/python/__init__.py", line 104, in <module>
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "tensorflow/python/platform/test.py", line 57, in <module>
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "mock/__init__.py", line 2, in <module>
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "mock/mock.py", line 71, in <module>
File "pbr/version.py", line 461, in semantic_version
File "pbr/version.py", line 447, in _get_version_from_pkg_resources
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "pbr/packaging.py", line 32, in <module>
File "/tmp/pip-build-EuLWEf/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
File "setuptools/__init__.py", line 160, in <module>
File "setuptools/monkey.py", line 104, in patch_all
File "setuptools/monkey.py", line 156, in patch_for_msvc_specialized_compiler
File "importlib/__init__.py", line 37, in import_module
ImportError: No module named msvc
How can I resolve this error and run the file correctly?
This problem was solved by using the dev version of Pyinstaller. More details here: https://github.com/pyinstaller/pyinstaller/issues/2824
I added msvc to the hidden imports. I'm still battling imports, but seem to be past this one.
{
a = Analysis(['/Users/Ben/Documents/DeepMeerkat/DeepMeerkat/main.py'],
pathex=['/Users/ben/Documents/DeepMeerkat/DeepMeerkat/'],
binaries=[],
datas=[],
hiddenimports=['setuptools.msvc'],
hookspath=[],
runtime_hooks=[],
excludes=[ 'enchant', 'twisted'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
}