python = 3.8.0
pyinstaller=5.2
commands
pyinstaller --onefile Main.py
Traceback (most recent call last):
File "C:\Users\Testuser\Documents\installed\Python\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Testuser\Documents\installed\Python\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\__main__.py", line 188, in <module>
run()
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\__main__.py", line 178, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\__main__.py", line 59, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\building\build_main.py", line 842, in main
build(specfile, distpath, workpath, clean_build)
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\building\build_main.py", line 764, in build
exec(code, spec_namespace)
File "C:\Users\Testuser\Documents\com\git\testme.spec", line 24, in <module>
exe = EXE(
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\building\api.py", line 524, in __init__
self.__postinit__()
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\building\datastruct.py", line 173, in __postinit__
self.assemble()
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\building\api.py", line 692, in assemble
self.manifest.update_resources(build_name, [1])
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 904, in update_resources
UpdateManifestResourcesFromXML(dstpath, self.toprettyxml().encode("UTF-8"), names, languages)
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 992, in UpdateManifestResourcesFromXML
winresource.UpdateResources(dstpath, xmlstr, RT_MANIFEST, names or [name], languages or [0, "*"])
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\PyInstaller\utils\win32\winresource.py", line 189, in UpdateResources
win32api.EndUpdateResource(hdst, 0)
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\win32ctypes\pywin32\win32api.py", line 228, in EndUpdateResource
with _pywin32error():
File "C:\Users\Testuser\Documents\installed\Python\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\Testuser\Documents\installed\Python\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (5, 'EndUpdateResource', 'Access is denied')
Related
When I try to run spider test suite like described here:
https://github.com/taoyds/test-suite-sql-eval
I get this error:
Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 125, in _main prepare(preparation_data) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 289, in run_path return _run_module_code(code, init_globals, run_name, File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 96, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\user\PycharmProjects\test-suite-sql-eval\evaluate_classical.py", line 20, in <module> m = Manager() File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\context.py", line 57, in Manager m.start() File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\managers.py", line 562, in start self._process.start() File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 121, in start self._popen = self._Popen(self) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\context.py", line 336, in _Popen return Popen(process_obj) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__ prep_data = spawn.get_preparation_data(process_obj._name) File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 154, in get_preparation_data _check_not_importing_main() File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 134, in _check_not_importing_main raise RuntimeError(''' RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. python-BaseException
Can someome please help?
Thanks!
I tried to run this example command:
python3 evaluate_classical.py --pred=evaluation_examples/classical_test_gold.txt --out_file=all_eval_results.json
I expected to get some kind of evaluation, but got the above error.
I try to use some libraries including "https://api.coinbase.com/v2/prices/spot?currency=USD"
but i got this error:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.240.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.240.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "c:\Users\Hessam\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
cli.main()
File "c:\Users\Hessam\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
run()
File "c:\Users\Hessam\.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.240.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 268, in run_path
code, fname = _get_code_from_file(run_name, path_name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.240.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 242, in _get_code_from_file
code = compile(f.read(), fname, 'exec')
File "c:\Users\Hessam\Python code\requests.py", line 3
r = requests.get(https://jsonplaceholder.typicode.com/posts)
^
SyntaxError: invalid syntax
so please guide me on this
thanks in advance
I am using executor.map and storing results in 'results'.
Following code works without any problem on Jupiter notebook. However, it crashes when executing the python script in Windows command prompt.
rop_test.py
print ('start of process')
import concurrent.futures
from funcfile import func
if __name__ == '__main__':
with concurrent.futures.ProcessPoolExecutor() as executor:
results = executor.map(func, varlist1,varlist2)
global master_list
master_list=list(results)
print(master_list)
#do something with master_list
funcfile.py
def func(var1,var2):
var3=var1+var2
return var3
Error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Administrator\notebooks\rop_test.py", line 640, in <module>
print (master_list)
NameError: name 'master_list' is not defined
Finished in 0.0 second(s)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 114, in _main
prepare(preparation_data)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Administrator\notebooks\rop_test.py", line 640, in <module>
print (master_list)
NameError: name 'master_list' is not defined
Traceback (most recent call last):
File "rop_test.py", line 634, in <module>
master_list=list(results)
File "C:\ProgramData\Anaconda3\lib\concurrent\futures\process.py", line 483, in _chain_from_iterable_of_lists
for element in iterable:
File "C:\ProgramData\Anaconda3\lib\concurrent\futures\_base.py", line 598, in result_iterator
yield fs.pop().result()
File "C:\ProgramData\Anaconda3\lib\concurrent\futures\_base.py", line 428, in result
return self.__get_result()
File "C:\ProgramData\Anaconda3\lib\concurrent\futures\_base.py", line 384, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
I have tried putting this in a main command, adding wait, adding [var for var in results], list(results) etc. but to no avail.
N.B. I am on python 3.6
Previously translating the name with a non-bmp map prevented emojis in names from crashing the script, but suddenly it doesn't work and i don't know why.
I tried adding a try/except block to see what the problem is, but the except doesn't catch the exception at all. I used the debugger and the code just jumps to the line after the except block (!?)
Here is the problematic code:
The line
logger.info(f"Liking tweet from user {name}")
throws the following exception:
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\JGC\anaconda3\lib\logging\__init__.py", line 1028, in emit
stream.write(msg + self.terminator)
File "C:\Users\JGC\anaconda3\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 40: character maps to <undefined>
Call stack:
File "C:\Users\JGC\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\JGC\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\Users\JGC\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy\__main__.py", line 45, in <module>
cli.main()
File "c:\Users\JGC\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users\JGC\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 267, in run_file
runpy.run_path(options.target, run_name=compat.force_str("__main__"))
File "C:\Users\JGC\anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\JGC\anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\JGC\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\Users\JGC\Desktop\Python\Templates de bots\Twitter Template\posting-bot\machado.py", line 169, in <module>
stream.filter(track=HASHTAGS, languages=["pt"])
File "C:\Users\JGC\anaconda3\lib\site-packages\tweepy\streaming.py", line 474, in filter
self._start(is_async)
File "C:\Users\JGC\anaconda3\lib\site-packages\tweepy\streaming.py", line 389, in _start
self._run()
File "C:\Users\JGC\anaconda3\lib\site-packages\tweepy\streaming.py", line 289, in _run
self._read_loop(resp)
File "C:\Users\JGC\anaconda3\lib\site-packages\tweepy\streaming.py", line 351, in _read_loop
self._data(next_status_obj)
File "C:\Users\JGC\anaconda3\lib\site-packages\tweepy\streaming.py", line 323, in _data
if self.listener.on_data(data) is False:
File "C:\Users\JGC\anaconda3\lib\site-packages\tweepy\streaming.py", line 54, in on_data
if self.on_status(status) is False:
File "c:\Users\JGC\Desktop\Python\Templates de bots\Twitter Template\posting-bot\machado.py", line 59, in on_status
logger.info(f"Liking tweet from user {name}")
Message: 'Liking tweet from user maya | �; aridante'
Arguments: ()
I am trying to add Persian language to spaCy. I followed almost everything which was said here. But when I issue the below command
python -m spacy train fa fa-model fa-ud-train.json fa-ud-dev.json --n-iter 25 --no-ner
I get some errors that I don't know how to fix.
$ python -m spacy train fa fa-model fa-ud-train.json fa-ud-dev.json --n-iter 25 --no-ner
Itn. N weight N feats UAS NER F. Tag % Token %
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/spacy/__main__.py", line 133, in <module>
plac.Interpreter.call(CLI)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 1142, in call
print(out)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 914, in __exit__
self.close(exctype, exc, tb)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 952, in close
self._interpreter.throw(exctype, exc, tb)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 964, in _make_interpreter
arglist = yield task
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 1139, in call
raise_(task.etype, task.exc, task.tb)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 53, in raise_
raise exc.with_traceback(tb)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 380, in _wrap
for value in genobj:
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 95, in gen_exc
raise_(etype, exc, tb)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 53, in raise_
raise exc.with_traceback(tb)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_ext.py", line 966, in _make_interpreter
cmd, result = self.parser.consume(arglist)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/spacy/__main__.py", line 95, in train
not no_parser, not no_ner, parser_L1)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/spacy/cli/train.py", line 40, in train
entity_cfg, n_iter)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/spacy/cli/train.py", line 62, in train_model
pos=tagger_cfg, deps=parser_cfg, ner=entity_cfg) as trainer:
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/spacy/language.py", line 234, in train
self.vocab = self.Defaults.create_vocab(self)
File "/PATH/TO/PROJECT/MY-PY-ENVIRON/lib/python3.5/site-packages/spacy/language.py", line 42, in create_vocab
tag_map=cls.tag_map, lemmatizer=lemmatizer)
File "spacy/vocab.pyx", line 89, in spacy.vocab.Vocab.load (spacy/vocab.cpp:4742)
File "/usr/lib/python3.5/pathlib.py", line 1151, in open
opener=self._opener)
File "/usr/lib/python3.5/pathlib.py", line 1005, in _opener
return self._accessor.open(self, flags, mode)
File "/usr/lib/python3.5/pathlib.py", line 371, in wrapped
return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: 'fa-model/vocab/strings.json'
I have Persian UniversalDependency treebanks and have converted them to spaCy's expected json format.
I have added fa language to spaCy in MY-PY-ENVIRON virtualenv.
My Environment
installed models: en, en_default
Platform: Linux-4.11.0-14-generic-x86_64-with-LinuxMint-18.2-sonya
Python version: 3.5.2
spaCy version: 1.9.0