Error while running executable created by PyInstaller (python 2.7) - python

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

Related

ImportError: No module named decorator after making executable with pyinstaller

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!

pyinstaller AttributeError: 'module' object has no attribute 'compat'

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.

Pyinstaller No module named msvc

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)
}

pip install pyublas fails with `NameError: name 'sys_platform' is not defined`

Under Ubuntu 16.04 and Python 2.7.12 sudo -H pip install pyublas fails with the following stacktrace:
Collecting pyublas
Using cached PyUblas-2013.1.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.35.tar.gz
Extracting in /tmp/tmpnYhYMx
Now working in /tmp/tmpnYhYMx/distribute-0.6.35
Building a Distribute egg in /tmp/pip-build-vvsChR/pyublas
Traceback (most recent call last):
File "setup.py", line 248, in <module>
scripts = scripts,
File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
self.finalize_options()
File "/tmp/tmpnYhYMx/distribute-0.6.35/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2027, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2237, in requires
dm = self._dep_map
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2466, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2499, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/tmp/tmpnYhYMx/distribute-0.6.35/pkg_resources.py", line 2496, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/tmp/tmpnYhYMx/distribute-0.6.35/_markerlib/markers.py", line 109, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/tmp/pip-build-vvsChR/pyublas/distribute-0.6.35-py2.7.egg
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 143, in <module>
main()
File "/tmp/pip-build-vvsChR/pyublas/setup.py", line 29, in main
from aksetup_helper import hack_distutils, get_config, setup, \
File "aksetup_helper.py", line 3, in <module>
distribute_setup.use_setuptools()
File "distribute_setup.py", line 152, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 132, in _do_download
_build_egg(egg, tarball, to_dir)
File "distribute_setup.py", line 123, in _build_egg
raise IOError('Could not build the egg.')
IOError: Could not build the egg.
Following various related SO answers, I have confirmed that distribute is not installed, setuptools is up to date (setuptools (36.0.1)).
I have also tried manually running setup per this answer to no avail.

python sqlite3 error in FreeBSD 9 [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
Trying to install this ipython version. infact there's a django-starter project which uses buildout for his needs.. And that scripts tried to get ipython 0.11 with easy_install.I tried to grep everything out from this package but there's no ipython mentioned in any files at all. so I can't install newer version I need ipython0.11 to work. Please =)
roman# easy_install "ipython==0.11" > errors
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1712, in main
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 211, in run
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 54, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/__init__.py", line 46, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/embed.py", line 32, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/interactiveshell.py", line 26, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/interactiveshell.py", line 36, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/history.py", line 20, in <module>
File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
register_adapters_and_converters()
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined
update:
importing sqlite3 from python console gives this error:
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
register_adapters_and_converters()
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined
Judging from your error message and our exchange in the comments, I think the big problem is you might just be missing sqlite3 support for python.
From your error messages I take it you're running FreeBSD, so you should install the databases/py-sqlite3 package from ports.
I don't know much about FreeBSD's ports system, but after you install the py-sqlite3 package, your problem should hopefully be cleared up.
I'm going to assume, from brief reading, you do something like this, assuming you have the ports tree on your system:
cd /usr/ports/databases/py-sqlite3
make && make install

Categories