DLL load failed error while using python imagebot - python-2.7

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.

Related

Error while running odoo in mac

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

Error message after installing fontmake: "No module named py23"

I've installed, uninstalled, reinstalled FontTools and Fontmake via pip.
However, whenever I try to call Fontmake in terminal I get the following error. Py23 appears to be a Fonttools dependency, which is also installed.
Thanks in advance for any help!
Traceback (most recent call last):
File "/usr/local/bin/fontmake", line 9, in
load_entry_point('fontmake==1.3.1.dev0', 'console_scripts', 'fontmake')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/Library/Python/2.7/site-packages/fontmake/main.py", line 18, in
from fontmake.font_project import FontProject
File "/Library/Python/2.7/site-packages/fontmake/font_project.py", line 37, in
from defcon import Font
File "/Library/Python/2.7/site-packages/defcon/init.py", line 10, in
from defcon.objects.font import Font
File "/Library/Python/2.7/site-packages/defcon/objects/font.py", line 6, in
from ufoLib import UFOReader, UFOWriter
File "/Library/Python/2.7/site-packages/ufoLib/init.py", line 6, in
from fontTools.misc.py23 import basestring, unicode
ImportError: No module named py23
I fixed this by installing Fonttools from the source files, instead of installing with pip.

Kivy- Packaging to Windows fails: "No module named ConfigParser"

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.

conda update --all = "ImportError: DLL load failed: %1 is not a valid Win32 application." when trying to import matplotlib.pyplot

I use the Python distribution. Python 2.7 x64 with Windows 7 SP1 x64 Ultimate.
After a conda update --all, whenever I try to import matplotlib.pyplot I get ImportError: DLL load failed: %1 is not a valid Win32 application.. Why?
Full error stack:
Traceback (most recent call last):
File "C:\svn\hw4\code\test_con.py", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 109, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "C:\Anaconda\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "C:\Anaconda\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 17, in <module>
from .backend_qt5agg import NavigationToolbar2QTAgg
File "C:\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 18, in <module>
from .backend_qt5 import QtCore
File "C:\Anaconda\lib\site-packages\matplotlib\backends\backend_qt5.py", line 31, in <module>
from .qt_compat import QtCore, QtGui, QtWidgets, _getSaveFileName, __version__
File "C:\Anaconda\lib\site-packages\matplotlib\backends\qt_compat.py", line 91, in <module>
from PyQt4 import QtCore, QtGui
ImportError: DLL load failed: %1 is not a valid Win32 application.
I had the same issue after running conda update anaconda. The solution that worked for me was to simply to download the latest windows installer, then uninstall and reinstall.
I suspect this is related to the pathname of your conda environment, as if you do a clean install anaconda now wants to live in C:\Users\yourname\AppData\Local\Continuum\Anaconda2, where previously it was just Anaconda (no 2). I suspect after running the upgrade scripts some things are pointing to the nonexistant (for you) "new" path.
I found that if I explicitly activate a conda environment with activate myenvname before running anything it works fine. Likewise if you you run from the "anaconda prompt" (which activates your default environment for you) it works fine. But to get my default environment to stay active from anywhere like its supposed to I had to reinstall.
Here is what worked for me:
Run conda update -f matplotlib (from the Anaconda command prompt)
This gave me a new error:
RuntimeError: module compiled against API version a but this version of numpy is 9
Traceback (most recent call last):
File "C:\svn\hw4\code\test_con.py", line 1, in <module>
import matplotlib.pyplot
File "C:\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 27, in <module>
import matplotlib.colorbar
File "C:\Anaconda\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "C:\Anaconda\lib\site-packages\matplotlib\artist.py", line 12, in <module>
from .transforms import Bbox, IdentityTransform, TransformedBbox, \
File "C:\Anaconda\lib\site-packages\matplotlib\transforms.py", line 39, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: numpy.core.multiarray failed to import
Run conda update -f numpy
This gave me a new error:
Traceback (most recent call last):
File "C:\svn\hw4\code\test_con.py", line 1, in <module>
import matplotlib.pyplot
File "C:\Anaconda\lib\site-packages\matplotlib\pyplot.py", line 27, in <module>
import matplotlib.colorbar
File "C:\Anaconda\lib\site-packages\matplotlib\colorbar.py", line 34, in <module>
import matplotlib.collections as collections
File "C:\Anaconda\lib\site-packages\matplotlib\collections.py", line 27, in <module>
import matplotlib.backend_bases as backend_bases
File "C:\Anaconda\lib\site-packages\matplotlib\backend_bases.py", line 56, in <module>
import matplotlib.textpath as textpath
File "C:\Anaconda\lib\site-packages\matplotlib\textpath.py", line 22, in <module>
from matplotlib.mathtext import MathTextParser
File "C:\Anaconda\lib\site-packages\matplotlib\mathtext.py", line 63, in <module>
import matplotlib._png as _png
ImportError: DLL load failed: The specified module could not be found.
Run conda install anaconda. This rolled your system back to a stable anaconda distribtution, and solved the issue. (I guess you could skip steps 1 and 2, but I don't feel like going through it again to confirm…)

py2exe no module named lgamma

I am trying to create an exe file for a python file. py2exe creates the executable, but when I run the executable, I get the following traceback:
C:\Users\gkumar7\Desktop\AL_gui-master\AL_gui-master\dist>app.exe
Traceback (most recent call last):
File "app.py", line 5, in <module>
File "learning_curve.pyc", line 13, in <module>
File "sklearn\metrics\__init__.pyc", line 34, in <module>
File "sklearn\metrics\scorer.pyc", line 30, in <module>
File "sklearn\metrics\cluster\__init__.pyc", line 8, in <module>
File "sklearn\metrics\cluster\supervised.pyc", line 18, in <module>
File "sklearn\metrics\cluster\expected_mutual_info_fast.pyc", line 12, in <mod
ule>
File "sklearn\metrics\cluster\expected_mutual_info_fast.pyc", line 10, in __lo
ad
File "expected_mutual_info_fast.pyx", line 1, in init sklearn.metrics.cluster.
expected_mutual_info_fast (sklearn\metrics\cluster\expected_mutual_info_fast.c:5
007)
ImportError: No module named lgamma
Here is my setup.py file:
dll_excludes = ['MSVCP90.dll', 'OLEAUT32.dll', 'USER32.dll', 'IMM32.dll', 'SHELL32.dll',
'ole32.dll', 'COMDLG32.dll', 'COMCTL32.dll', 'ADVAPI32.dll', 'mfc90.dll', 'msvcrt.dll',
'WS2_32.dll', 'WINSPOOL.DRV', 'GDI32.dll', 'VERSION.dll', 'KERNEL32.dll', 'ntdll.dll']
from distutils.core import setup
import py2exe, matplotlib, numpy
setup(console=['app.py'],
data_files=matplotlib.get_py2exe_datafiles(),
options = {"py2exe": {
"dll_excludes": dll_excludes,
"includes": ['scipy.sparse.csgraph._validation',
'scipy.special._ufuncs_cxx']
}
}, )
I have also tried cx_freeze, but kept receiving similar errors. Any help would be much appreciated.
Include sklearn.utils.lgamma in your py2exe setup file.