I want to read xml and treat that as python data structure.
I am using amara bindery tools to do this.
I use bindery.parse to read the xml and that returns the xml in the format of the data structures I want. This works fine on the interpreter. I am then using py2exe to convert my script into a windows executable.
When I run the executable I get the following error:
File "zipextimporter.pyo", line 82, in load_module
File "amara\bindery\__init__.pyo", line 38, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "amara\bindery\nodes.pyo", line 27, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "amara\xpath\__init__.pyo", line 99, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "amara\xpath\parser\__init__.pyo", line 2, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: No module named predicates
Can anyone suggest the reason for these and what could be the issues?
Thanks in advance.
Related
I'm trying to run ~/ERP/bitnami-odoo/python/bin/python ~/ERP/bitnami-odoo/apps/odoo/bin/odoo.py help and now I am getting this error:
~/ERP/bitnami-odoo/python/lib/python2.7/site-packages/setuptools-20.9.0-py2.7.egg/pkg_resources/__init__.py:1268: UserWarning: ~/ERP/bitnami-odoo/.tmp is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
Traceback (most recent call last):
File "~/ERP/bitnami-odoo/apps/odoo/bin/odoo.py", line 4, in <module>
__import__('pkg_resources').run_script('odoo==8.0.post20151126', 'odoo.py')
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 719, in run_script
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1504, in run_script
File "~/ERP/bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/EGG-INFO/scripts/odoo.py", line 160, in <module>
main()
File "~/ERP/bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/EGG-INFO/scripts/odoo.py", line 157, in main
openerp.cli.main()
File "~/ERP/bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/cli/__init__.py", line 58, in main
for m in module.get_modules():
File "~/ERP/bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/module.py", line 351, in get_modules
plist.extend(listdir(ad))
File "~/ERP/bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/module.py", line 346, in listdir
return map(clean, filter(is_really_module, os.listdir(dir)))
OSError: [Errno 2] No such file or directory: '~/ERP/odoo/openerp/addons'
This directory is not correct (obviously), but I can't find where it is defined. The full path should be ~/ERP/bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons and this error shows a wrong path without /bitnami-odoo/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/
I've tried passing the path to openerp-server.conf ~/ERP/bitnami-odoo/python/bin/python ~/ERP/bitnami-odoo/apps/odoo/bin/odoo.py help -c ~/ERP/bitnami-odoo/apps/odoo/conf/openerp-server.conf, where the addons path is the correct, but the error continues. Is it a bitnami error? If it is not, Where do I can solve that.
Note: I use ~/ to not expose the whole path. ;-)
There is a default config file in ~/.openerp_server.rc.
you can use addons_path = to set addons file.
Colors selector box in program Sublime Text, as implemented in this editor:
I'm install the package Colopicker in ST3, when I press ctrl+shift+c:
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 549, in run_
return self.run(edit)
File "sublimecp in C:\Users\konst\AppData\Roaming\Sublime Text 3\Installed Packages\ColorPicker.sublime-package", line 172, in run
File "sublimecp in C:\Users\konst\AppData\Roaming\Sublime Text 3\Installed Packages\ColorPicker.sublime-package", line 240, in pick_win
File "X/ctypes/__init__.py", line 431, in LoadLibrary
File "X/ctypes/__init__.py", line 353, in __init__
OSError: [WinError 193] %1 не является приложением Win32
How to fix it?
Search Package Control for a plug-in.
The VisualColorPicker.dll doesn't have an x64 bit version, we can use a proxy exe wrapper. It should work properly.
The ansewer read https://github.com/weslly/ColorPicker/pull/44
I'm learning how to use gitstats to create reports with git. So I downloaded and installed Git-1.8.1.2-preview20130201.exe , python-2.6.2.msi , gp463-win32-setup.exe(gnuplot) and cloned gitstats
from http://gitstats.com/. And I also add my git, python, gnuplot, gitstats to my PATH. Then I created a repository with "Git Bash" by myself named repo1. But when I input the command to create the
reporting about repo1, it output an error like this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Dynamsoft220\Desktop>e:
E:\>cd Jeremy\Git\gitstats
E:\Jeremy\Git\gitstats>python gitstats e:\Jeremy\Git\repo1 e:\Jeremy\Git\report
[0.08100] >> gnuplot --version
Output path: e:\Jeremy\Git\report
Git path: e:\Jeremy\Git\repo1
Collecting data...
[0.12600] >> git shortlog -s HEAD | wc -l
[0.08300] >> git show-ref --tags
[0.18100] >> git rev-list --pretty=format:"%at %ai %aN <%aE>" HEAD | grep -v ^co
mmit
[0.09300] >> git rev-list --pretty=format:"%at %T" HEAD | grep -v ^commit
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Python26\lib\multiprocessing\forking.py", line 341, in main
prepare(preparation_data)
File "D:\Python26\lib\multiprocessing\forking.py", line 450, in prepare
file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named gitstats
I really have no idea about how to fix this error. Actually I thought maybe it is because the software version is too late, but it seems not! It seems too simple to be discussed for most of people
TT, so I can't find a lot of article about it. Any suggestions will be appreciate! Thanks~
I was also having problems getting gitstats to run on Windows. This was tricky, because it looks like everything is working, but it just doesn't work!
Here are a few tweaks that helped me.
First, I made sure PYTHON_PATH was set correctly and added it to the path:
C:\> set PYTHON_PATH=C:\Python27;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk
C:\> set PATH=%PATH%;%PYTHON_PATH%
Next, I added gitstats to the path, because, well, why not at this point:
C:\> set PATH=%PATH%;c:\projects\gitstats
Last, rename* gitstats to gitstats.py:
C:\> cd projects\gitstats
C:\> ren gitstats gitstats.py
* The rename was mentioned in the issue log on github, and solved by #danio there: https://github.com/hoxu/gitstats/issues/34
You must add the gitstat folder in the PYTHON_PATH.
See this answer for how to add the PYTHON_PATH in windows.
https://stackoverflow.com/a/3701730/1226582
Slightly more complete instructions for running gitstats in Windows:
Install Python2 from https://www.python.org/downloads/release/python-2718/ (it might be a good idea to not add it to your PATH to avoid messing up your other Python installation)
Install gnuplot from https://sourceforge.net/projects/gnuplot/files/latest/download (you can add it to path)
Now run in git bash:
If you haven't downloaded it yet: "install" gitstats
git clone git://github.com/hoxu/gitstats.git
cd gitstats
Now every time you want to run it, first add Python 2 to (the front of) your PATH temporarily so gitstats can use it:
PYTHON_PATH=/C/Python27:/C/Python27/Lib:/C/Python27/DLLs:/C/Python27/Lib/lib-tk
PATH=$PYTHON_PATH:$PATH:"/C/Program Files/gnuplot/bin"
python gitstats /C/path/to/repo/to/analyze /C/path/to/output/dir
Now open C:\path\to\output\dir\index.html in your browser
When I try to launch ipython qtconsole from anywhere except my Python install dir, I get import errors. It seems to only work if I RUN->cmd.exe; cd C:\Users\me\python\Python27; ipython qtconsole;.
Ive tried Batch files, but it still seems if I don't run it within the context of my install dir, it just doesnt work. Always ipython-script that seems to be complaining. Here is the output...(this was from inside ipython with CurrentWorkingDirectory as my Desktop)
In [2]: !ipython qtconsole
Traceback (most recent call last):
File "C:\Users\me\python\Python27\ipython-script.py", line 770, in <module
>
load_entry_point('ipython==0.12', 'console_scripts', 'ipython')()
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\frontend\terminal\ipapp.py", line 402, in launch_new
_instance
File "<string>", line 2, in initialize
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\config\application.py", line 84, in catch_config_err
or
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\frontend\terminal\ipapp.py", line 302, in initialize
File "<string>", line 2, in initialize
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\config\application.py", line 84, in catch_config_err
or
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\core\application.py", line 325, in initialize
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\frontend\terminal\ipapp.py", line 297, in parse_comm
and_line
File "<string>", line 2, in parse_command_line
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\config\application.py", line 84, in catch_config_err
or
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\config\application.py", line 413, in parse_command_l
ine
File "<string>", line 2, in initialize_subcommand
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\config\application.py", line 84, in catch_config_err
or
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\config\application.py", line 349, in initialize_subc
ommand
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\utils\importstring.py", line 40, in import_item
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\frontend\qt\console\qtconsoleapp.py", line 30, in <m
odule>
File "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin\lib\site-packages\ipy
thon-0.12-py2.7.egg\IPython\external\qt.py", line 42, in <module>
ImportError: Cannot import PySide >= 1.0.3 or PyQt4 >= 4.7
Like I said, it works perfectly fine from within my install dir, and I am 96% sure my ENV variables PATH,PYTHONPATH,PYTHONHOME are kosher. Ive gone from deleting them, to completely overloading them one directory at a time, with no change in results.
And I have made sure the Wow6432None Python entries exist (I tried not to pollute those).
Ipython is not the only module with errors like this (also with same solution), but this is definitely the most annoying (I can't launch qtconsole from Run Prompt!)
EDIT::I did dig up a start menu entry, and after changing the 'start in' property, I was able to launch qtconsole, but I still don't quite understand why this import is being performed relative to the current directory.
I believe it had to do with qtconsole dependencies living in locations not directly on my defined PATH, and I believe there were some conflicts in my modules search PATHS.
The easiest solution I found was to use the environment variable PYTHONPATH.
It has been a while since my original post, and several things have changed since then, but I believe the important factors were these:
-Be careful of 32bit python installed on 64bit windows.
-Utilize PYTHONPATH to include important sub-directories, such as '/install-dir/Lib' or any others.
If you still have trouble with your env variables, use absolute commands as a failsafe (wrap these up in a script that makes it easier to use),
C:\Users\johnny42\python\Python27\pythonw.exe
C:\Users\johnny42\python\Python27\ipython-script.py qtconsole
The above example should be on ONE LINE. Do not just copy and paste it.
I have Python 32 bit in my 64 bit Windows OS. Even I have a similar error "c:\cpd-svn\branches\qt-4.8\win32-12-01\install\bin". I do not know where is it being set. Can you please share your findings as to where Python is getting this path from? And which path it should be updated with?
D:\TDDOWNLOAD\WWW1\pyinstaller>python Makespec.py C:\Documents and Settings\Admi
nistrator\桌面\a.py
wrote D:\TDDOWNLOAD\WWW1\pyinstaller\Documents\Documents.spec
now run Build.py to build the executable
D:\TDDOWNLOAD\WWW1\pyinstaller>python Build.py D:\TDDOWNLOAD\WWW1\pyinstaller\Do
cuments\Documents.spec
Traceback (most recent call last):
File "Build.py", line 1158, in <module>
main(args[0], configfilename=opts.configfile)
File "Build.py", line 1146, in main
build(specfile)
File "Build.py", line 1109, in build
execfile(spec)
File "D:\TDDOWNLOAD\WWW1\pyinstaller\Documents\Documents.spec", line 3, in <mo
dule>
pathex=['D:\\TDDOWNLOAD\\WWW1\\pyinstaller'])
File "Build.py", line 232, in __init__
raise ValueError, "script '%s' not found" % script
ValueError: script 'C:\Documents' not found
D:\TDDOWNLOAD\WWW1\pyinstaller>
put quotes around the paths with spaces
python Makespec.py "C:\Documents and Settings\Admi nistrator\桌面\a.py"
use full dir
cd D:\TDDOWNLOAD\WWW1\pyinstaller
python Makespec.py D:\TDDOWNLOAD\WWW1\pyinstaller\ss\a.py
python Build.py D:\TDDOWNLOAD\WWW1\pyinstaller\a\a.spec
it's ok