I am trying to package a kivy application for Windows, and after following the instructions in the Kivy website for the example TouchTracer app, I get an ImportError: No Module named ConfigParser message when trying to open the .exe file in the dist folder.
I am running Python 2.7.11 and kivy 1.9.1.
Also, while executing the command python -m PyInstaller..., the output includes a line that says:
12612 WARNING: Attempted to add Python module twice with different upper/lowercases: ConfigParser
Below is the traceback printed when attempting to open the .exe file.
Traceback (most recent call last):
File "C:\Users\acasall1\Desktop\TouchApp\demo\touchtracer\main.py", line 22,
in <module>
import kivy
File "c:\users\acasall1\appdata\local\temp\pip-build-21skkd\pyinstaller\PyIns
taller\loader\pyimod03_importers.py", line 389, in load_module
File "c:\python27\lib\site-packages\kivy\__init__.py", line 306, in <module>
from kivy.config import Config
File "c:\users\acasall1\appdata\local\temp\pip-build-21skkd\pyinstaller\PyIns
taller\loader\pyimod03_importers.py", line 389, in load_module
File "c:\python27\lib\site-packages\kivy\config.py", line 284, in <module>
from configparser import RawConfigParser as PythonConfigParser
File "c:\users\acasall1\appdata\local\temp\pip-build-21skkd\pyinstaller\PyIns
taller\loader\pyimod03_importers.py", line 389, in load_module
File "C:\Python27\lib\site-packages\configparser\__init__.py", line 5, in <mo
dule>
from ConfigParser import *
ImportError: No module named ConfigParser
Failed to execute script main
I had the same problem for my kivy application, and I found an ad hoc solution. The error comes from the line "import kivy", so uncomment it and the next line "kivy.require('1.0.6')". There lines are unnecessary if your kivy has proper version.
Related
I am trying to install odoo in mac OS. I have installed all necessary requirements by referring a video on youtube and finally I tried to run server but I am getting an error like this:
lalits-MacBook-Pro:odoo lalitpatidar$ ./odoo-bin
Traceback (most recent call last):
File "./odoo-bin", line 5, in
__import__('pkg_resources').declare_namespace('odoo.addons')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1926, in declare_namespace
declare_namespace(parent)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1942, in declare_namespace
_handle_ns(packageName, path_item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1912, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/__init__.py", line 60, in
import modules
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/modules/__init__.py", line 8, in
from . import db, graph, loading, migration, module, registry
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/modules/graph.py", line 13, in
import odoo.osv as osv
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/osv/__init__.py", line 4, in
import osv
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/osv/osv.py", line 4, in
from ..exceptions import except_orm
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/exceptions.py", line 15, in
from tools.func import frame_codeinfo
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/tools/__init__.py", line 8, in
from misc import *
File "/Users/lalitpatidar/Desktop/v10/odoo/odoo/tools/misc.py", line 16, in
import passlib.utils
ImportError: No module named passlib.utils
I am new in odoo and stackoverflow as well so please avoid my little mistake if any.
You can install passlib module using pip
sudo pip install passlib
I have problem with pyforms and pysettings in python 2.7 after compilation to the executable file.
Script runs normally and without errors when executed by "python godziny.py".
However after I create executable file (currently I use pyinstaller, but I also tried py2exe and cx_freeze with the same problem) I start the app and receive following:
C:\...>dist\godziny\godziny.exe
Traceback (most recent call last):
File "godziny.py", line 10, in <module>
from pyforms import BaseWidget
File "c:\users\...\appdata\local\temp\pip-build-hzzm3w\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
File "site-packages\pyforms\__init__.py", line 6, in <module>
File "site-packages\pysettings\settings_manager.py", line 22, in __add__
File "site-packages\pysettings\settings_manager.py", line 16, in __load_module
AttributeError: 'module' object has no attribute 'settings'
Failed to execute script godziny
I'm using Python 2.7, with pysettings from Pysettings and pyforms from pip (0.1.7.3). Pyinstaller doesn't report any errors during compilation.
cmd.exe view.* I use pypi imagebot which based on python scrapy to download imagesenter image description here and on Windows 10 32 bit get ImportError: DLL load failed: %1 is not a valid Win32 application.*
**How to fix DLL load error? Systems variables image attached. Python and scrapy versions updated.
C:\Users\Vartotojas>imagebot crawl http://seorinkodara.weebly.com
Traceback (most recent call last):
File "C:\Python27\Lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Python27\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\imagebot.exe__main__.py", line 5, in
File "c:\python27\lib\site-packages\imagebot\main.py", line 2, in
from scrapy.crawler import Crawler, CrawlerProcess
File "c:\python27\lib\site-packages\scrapy__init__.py", line 34, in
from scrapy.spiders import Spider
File "c:\python27\lib\site-packages\scrapy\spiders__init__.py", line 10, in
from scrapy.http import Request
File "c:\python27\lib\site-packages\scrapy\http__init__.py", line 11, in
from scrapy.http.request.form import FormRequest
File "c:\python27\lib\site-packages\scrapy\http\request\form.py", line 9, in
import lxml.html
File "c:\python27\lib\site-packages\lxml-3.3.6-py2.7-win32.egg\lxml\html__init__.py", line 42, in
from lxml import etree
ImportError: DLL load failed: %1 is not a valid Win32 application.
I have installed ghostscript on my machine and is located at
C:\Program Files (x86)\gs\gs9.20
and installed the python module via pip
pip install ghostscript
however when I try and import ghostscript I get this error
>>> import ghostscript
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import ghostscript
File "C:\Python27\lib\site-packages\ghostscript\__init__.py", line 33, in <module>
import _gsprint as gs
File "C:\Python27\lib\site-packages\ghostscript\_gsprint.py", line 281, in <module>
libgs = windll.LoadLibrary(libgs)
File "C:\Python27\lib\ctypes\__init__.py", line 440, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 362, in __init__
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be string, not Unicode
Ghost script was not working in python v2.7.13 so running an installation of v2.7.12 and importing via v2.7.12 imports with no errors
I am trying to install QSTK on my python 2.7.3. (on windows 10). During the installation, it seemed there was no problem and I did not face any errors. However, when I run the validation.py (here) to check it seems that QSTK.qstkstudu cannot be imported. Here is the error that I get while running validation.py:
QSTK is installed and can be imported
[...]
QSTK.qstkutil is installed and can be imported
File "C:\Python27\lib\site.py", line 372, in __call__
raise SystemExit(code)
SystemExit: Error : QSTK.qstkstudy can not be imported.
Does anyone have a clue what should I do?
The line in Validation.py which produces the error is:
import QSTK.qstkstudy.EventProfiler
If you try it directly in python, you can see what is missing. In my case it was tkinter.
>>> import QSTK.qstkstudy.EventProfiler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkstudy/EventProfiler.py", line 16, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 114, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from matplotlib.externals.six.moves import tkinter as Tk
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 199, in load_module
mod = mod._resolve()
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 113, in _resolve
return _import_module(self.mod)
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 80, in _import_module
__import__(name)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
I am on Linux so I did
sudo apt-get python-tk
Google how to install python tkinter in Windows.
Good luck