since doing the latest pull after the 1.07 release to the ansible github repository, it seems to be failing during the install phase.
example:
ansible-playbook playbooks/byo/config.yml
returns with:
Traceback (most recent call last):
File "/bin/ansible-playbook", line 324, in <module>
sys.exit(main(sys.argv[1:]))
File "/bin/ansible-playbook", line 264, in main
pb.run()
File "/usr/lib/python2.7/site-packages/ansible/playbook/__init__.py", line 310, in run
play = Play(self, play_ds, play_basedir, vault_password=self.vault_password)
File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 124, in __init__
ds = template(basedir, ds, temp_vars)
File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 140, in template
d[k] = template(basedir, v, templatevars, lookup_fatal, depth, expand_lists, convert_bare, fail_on_undefined, filter_fatal)
File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 140, in template
d[k] = template(basedir, v, templatevars, lookup_fatal, depth, expand_lists, convert_bare, fail_on_undefined, filter_fatal)
File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 124, in template
varname = template_from_string(basedir, varname, templatevars, fail_on_undefined)
File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 346, in template_from_string
environment.filters.update(_get_filters())
File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 54, in _get_filters
plugins = [ x for x in utils.plugins.filter_loader.all()]
File "/usr/lib/python2.7/site-packages/ansible/utils/plugins.py", line 232, in all
self._module_cache[path] = imp.load_source('.'.join([self.package, name]), path)
File "/root/cluster/openshift-ansible/filter_plugins/oo_filters.py", line 10, in <module>
import OpenSSL.crypto
ImportError: No module named OpenSSL.crypto
This was working fine a couple of days ago, before the pull so I have the feeling something in the repository caused this change.
Any ideas?
thx
Reason for this error, that apparently since a couple of days ansible-openshift depends on another additional module, which was not listed in the requirements or is not installed automatically.
executing:
yum install -y pyOpenSSL
seems to fix this issue for now.
Or you can try pip install pyopenssl
Related
Hi I'm trying to make an executable using py2exe, I checked my script but cannot find the actual issue why below error is keep getting pop-up during building of exe
Building 'dist\py.exe'.
Traceback (most recent call last):
File "C:\Users\User\PycharmProjects\Test\pyexe\setup.py", line 15, in <module>
freeze(
File "C:\Python39\lib\site-packages\py2exe\__init__.py", line 176, in freeze
builder.build()
File "C:\Python39\lib\site-packages\py2exe\runtime.py", line 254, in build
self.build_archive(exe_path)
File "C:\Python39\lib\site-packages\py2exe\runtime.py", line 479, in build_archive
base = dist_path.rsplit('\\', 1)[0]
AttributeError: 'NoneType' object has no attribute 'rsplit'
Below is my setup.py script
from py2exe import freeze
from py_version import VERSION, DESCRIPTION # This is my own script
freeze(
console=[{"script": "py.py"}],
options={
"py2exe": {
"dist_dir": "dist",
"bundle_files": 1, # bundle as much as possible
"compressed": True,
}},
version_info={"version":VERSION,
"description":DESCRIPTION,
"company_name":"Priyanshu Kumar",
"copyright":"Opensource, credit goes to David Manthey",
"product_name":"Stand-Alone Python3 Interpreter",
"product_version":VERSION},
zipfile=None)
UPDATE:
I was searching on google for help and found that it should be <<<zipfile="None">>> instead of <<<zipfile=None>>>.
I changed it in my code but now got new error
Traceback (most recent call last):
File "C:\Users\User\PycharmProjects\Test\pyexe\setup.py", line 29, in <module>
options={
File "C:\Python39\lib\site-packages\py2exe\__init__.py", line 176, in freeze
builder.build()
File "C:\Python39\lib\site-packages\py2exe\runtime.py", line 273, in build
self.build_archive(libpath, delete_existing_resources=True)
File "C:\Python39\lib\site-packages\py2exe\runtime.py", line 397, in build_archive
resource.add(type=os.path.basename(pydll), name=1, value=pydll_bytes)
File "C:\Python39\lib\site-packages\py2exe\resources.py", line 49, in add
raise WindowsError(details) from None
OSError: [WinError 87] The parameter is incorrect.
Press any key to continue . . .
I was trying to compute the sentiment using Harvard IV-4dictionary.
I installed the "pysentiment" successfully.
I run the following:
import pysentiment as ps
hiv4 = ps.HIV4()
tokens = hiv4.tokenize(text)
score = hiv4.get_score(tokens)
and I got the following error:
Traceback (most recent call last):
File "C:/Users/df/Desk Top/Finalazed/punctuation.py", line 274, in <module>
hiv4 = ps.HIV4()
File "C:\Users\df\AppData\Local\Programs\Python\Python37\lib\site-packages\pysentiment\base.py", line 55, in __init__
self._tokenizer = Tokenizer()
File "C:\Users\df\AppData\Local\Programs\Python\Python37\lib\site-packages\pysentiment\utils.py", line 36, in __init__
self._stopset = self.get_stopset()
File "C:\Users\df\AppData\Local\Programs\Python\Python37\lib\site-packages\pysentiment\utils.py", line 52, in get_stopset
fin = open('%s/%s'%(STATIC_PATH, f), 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\df\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\pysentiment\\static/Currencies.txt'
Could any body tell why I am getting this? Thanks.
Do copy pysentiment folder in the given path. Actually pysentiment folder doesnt contain static sub folder. You can check it by diplaying hidden folder "local".
When i try to run the pyinstall myFile.py, the build and dist folder are created, and the file myFIle.spec, but the dist folder is empty. In the shell I have a traceback at the end :
File "/home/indiana/anaconda3/bin/pyinstaller", line 11, in <module>
sys.exit(run())
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 31, in <module>
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 411, in __init__
strip_binaries=self.strip, upx_binaries=self.upx,
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 196, in __init__
self.__postinit__()
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 158, in __postinit__
self.assemble()
File "/home/indiana/anaconda3/lib/python3.6/site-packages/PyInstaller/building/api.py", line 273, in assemble
pylib_name = os.path.basename(bindepend.get_python_library_path())
File "/home/indiana/anaconda3/lib/python3.6/posixpath.py", line 146, in basename
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Futhermore, I have a warning during the process :
WARNING: Hidden import "PyQt5.sip" not found!
I'm more concern about the traceback ( since it seems it's not related to my code but more about the environment), so I wonder if somebody had seen this before and if someone has a kind of a solution.
Thanks in advance !
File
"/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/spyder/utils/introspection/manager.py",
line 220, in get_completions
info = self._get_code_info('completions', automatic=automatic) File
"/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/spyder/utils/introspection/manager.py",
line 216, in _get_code_info
**kwargs) File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/spyder/utils/introspection/utils.py",
line 75, in init
self._get_info() File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/spyder/utils/introspection/utils.py",
line 87, in _get_info
lexer = find_lexer_for_filename(self.filename) File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/spyder/utils/introspection/utils.py",
line 180, in find_lexer_for_filename
lexer = get_lexer_for_filename(filename) File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/pygments/lexers/init.py",
line 203, in get_lexer_for_filename
res = find_lexer_class_for_filename(_fn, code) File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/pygments/lexers/init.py",
line 168, in find_lexer_class_for_filename
for cls in find_plugin_lexers(): File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/pygments/plugin.py",
line 53, in find_plugin_lexers
yield entrypoint.load() File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/pkg_resources/init.py",
line 2404, in load
self.require(*args, **kwargs) File "/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/pkg_resources/init.py",
line 2427, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras) File
"/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages/pkg_resources/init.py",
line 872, in resolve
raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (parso 0.1.1
(/home/srikanth/anaconda3/envs/keras/lib/python3.5/site-packages),
Requirement.parse('parso==0.1.0'), {'jedi'})
Please help me regarding this.
Please run in a system terminal (cmd.exe)
conda update jedi
to fix this. If that fails, then please run
conda install parso=0.1.0
I'm trying to execute Google APIs Client Generator to build new ADMIN-SDK for Java Language however I'm stuck in the generator, I've tried step by step using python2.6 and python2.7 both had similar outputs.
$ python $(/bin/pwd)/googleapis/codegen/generate_library.py --api_name=plus --api_version=v1 --language=java --output_dir=/tmp/gen --language=java
Traceback (most recent call last): File
"/Users/alejacquet/Development/git/google-apis-client-generator/src/googleapis/codegen/generate_library.py",
line 245, in
app.run() File "/Library/Python/2.7/site-packages/google_apputils-0.3.0-py2.7.egg/google/apputils/app.py",
line 216, in run
return _actual_start() File "/Library/Python/2.7/site-packages/google_apputils-0.3.0-py2.7.egg/google/apputils/app.py",
line 244, in _actual_start
really_start() File "/Library/Python/2.7/site-packages/google_apputils-0.3.0-py2.7.egg/google/apputils/app.py",
line 203, in really_start
sys.exit(main(argv)) File "/Users/alejacquet/Development/git/google-apis-client-generator/src/googleapis/codegen/generate_library.py",
line 152, in main
language_variant=FLAGS.language_variant) File "/Users/alejacquet/Development/git/google-apis-client-generator/src/googleapis/codegen/generate_library.py",
line 179, in Generate
language_variations = Targets().VariationsForLanguage(language) File
"/Users/alejacquet/Development/git/google-apis-client-generator/src/googleapis/codegen/targets.py",
line 68, in init
files.GetFileContents(self.targets_path)) File "/Users/alejacquet/Development/git/google-apis-client-generator/src/googleapis/codegen/json_with_comments.py",
line 54, in Loads
return json.loads(stripped, **kw) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py",
line 326, in loads
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 366, in decode File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py",
line 382, in raw_decode ValueError: Expecting property name: line 9
column 9 (char 198)
Any ideas?
You may have to specify --language_variant=XXX, where XXX is one of the directory names under .../templates/java