When I need Initialize a new site in ERPNext - python

when I write the command line in terminal
bench new-site site1.local
This Error Will shown
> Traceback (most recent call last):
File "/home/ubuntu/.local/bin/bench", line 8, in <module>
sys.exit(cli())
File "/home/ubuntu/bench/bench/cli.py", line 71, in cli
cmd_from_sys = get_cmd_from_sysargv()
File "/home/ubuntu/bench/bench/utils/__init__.py", line 554, in get_cmd_from_sysargv
if sys_argv.index(arg) == 0 and arg in Bench(".").apps:
File "/home/ubuntu/bench/bench/bench.py", line 67, in __init__
self.apps = BenchApps(self)
File "/home/ubuntu/bench/bench/bench.py", line 174, in __init__
self.initialize_apps()
File "/home/ubuntu/bench/bench/bench.py", line 281, in initialize_apps
self.apps.remove("frappe")
ValueError: list.remove(x): x not in list
Note I use EC2 On AWS Ubunto server
Can Any One Help With This Problem Please.
I tried to install many lib but no help with this problem

Related

raise ImageFileError(f'Cannot work out file type of "{filename}"') when working with nnunet

I'm working with nnunet network with a custom dataset.
Everything works fine, I've created the new Task 88, I've launched the
!nnUNet_plan_and_preprocess -t 88 --verify_dataset_integrity
command and all the training cases and after the labels are checked, the problem is that; after this, it shows this error:
Verifying test set
Traceback (most recent call last):
File "/home/viberti/miniconda3/bin/nnUNet_plan_and_preprocess", line 8, in <module>
sys.exit(main())
File "/home/viberti/miniconda3/lib/python3.9/site-packages/nnunet/experiment_planning/nnUNet_plan_and_preprocess.py", line 105, in main
verify_dataset_integrity(join(nnUNet_raw_data, task_name))
File "/home/viberti/miniconda3/lib/python3.9/site-packages/nnunet/preprocessing/sanity_checks.py", line 223, in verify_dataset_integrity
all_same, unique_orientations = verify_all_same_orientation(join(folder, "imagesTr"))
File "/home/viberti/miniconda3/lib/python3.9/site-packages/nnunet/preprocessing/sanity_checks.py", line 34, in verify_all_same_orientation
img = nib.load(n)
File "/home/viberti/miniconda3/lib/python3.9/site-packages/nibabel/loadsave.py", line 55, in load
raise ImageFileError(f'Cannot work out file type of "{filename}"')
nibabel.filebasedimages.ImageFileError: Cannot work out file type of "/home/viberti/nnUNet_raw_data_base/nnUNet_raw_data/Task088_BraTS2020/imagesTr/BRATS_001_0000.nii.gz"

Anaconda-navigator won't start

I believe that I installed Anaconda Naviagtor on linux correctly but it is getting stuck on loading applications....
(base) ben#Bens-PC:~$ anaconda-navigator
Traceback (most recent call last):
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/main_window.py", line 541, in setup
self.post_setup(conda_data=conda_data)
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/main_window.py", line 578, in post_setup
self.tab_home.setup(conda_data)
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/tabs/home.py", line 169, in setup
self.set_applications(applications, packages)
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/widgets/tabs/home.py", line 204, in set_applications
apps = self.api.process_apps(applications, prefix=self.current_prefix)
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/anaconda_api.py", line 848, in process_apps
app = app(config=self.config, process_api=self._process_api, conda_api=self._conda_api)
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py", line 48, in __init__
**kwargs
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/base.py", line 43, in __init__
self.init()
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/base.py", line 60, in init
SUBDIR, INST_EXT, INST_DIR = self._find_linux_install_dir()
File "/home/ben/anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py", line 168, in _find_linux_install_dir
if DISTRO_NAME in ['ubuntu', 'debian']:
UnboundLocalError: local variable 'DISTRO_NAME' referenced before assignment
Any help would be great!
Try
conda update anaconda-navigator
Open and Edit the file:
".../anaconda3/lib/python3.7/site-packages/anaconda_navigator/api/external_apps/vscode.py"
Declare this in line 159.
DISTRO_NAME = None
Indent this line with the if statement above it.

fail to setup openstack dynamic inventory

I am trying to setup openstack dynamic inventory,when I am trying execute this command it's throwing me this error.
command: etc/ansible/hosts --list
Traceback (most recent call last):
File "/etc/ansible/hosts", line 263, in <module>
main()
File "/etc/ansible/hosts", line 249, in main
inventory = shade.inventory.OpenStackInventory(**inventory_args)
File "/usr/local/lib/python2.7/dist-packages/shade/inventory.py", line 35, in __init__
config_files=os_client_config.config.CONFIG_FILES + config_files)
File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 221, in __init__
self.cloud_config['clouds'] = {}
TypeError: list indices must be integers, not str

Error exporting inference graph (ValueError)

So I'm following sentdex's object detection tutorial and I have gotten to the step where you are supposed to export the inference graph. I'm using the "export_inference_graph.py" script from Tensorflow's object_detection folder.
The problem is that I'm getting this ValueError:
Traceback (most recent call last):
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\google\proto
buf\internal\python_message.py", line 545, in _GetFieldByName
return message_descriptor.fields_by_name[field_name]
KeyError: 'layout_optimizer'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "export_inference_graph.py", line 119, in <module>
tf.app.run()
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\p
ython\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "export_inference_graph.py", line 115, in main
FLAGS.output_directory, input_shape)
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\object_detec
tion-0.1-py3.5.egg\object_detection\exporter.py", line 427, in export_inference_graph
input_shape, optimize_graph, output_collection_name)
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\object_detec
tion-0.1-py3.5.egg\object_detection\exporter.py", line 391, in _export_inference_graph
initializer_nodes='')
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\object_detec
tion-0.1-py3.5.egg\object_detection\exporter.py", line 72, in freeze_graph_with_def_protos
layout_optimizer=rewriter_config_pb2.RewriterConfig.ON)
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\google\proto
buf\internal\python_message.py", line 484, in init
field = _GetFieldByName(message_descriptor, field_name)
File "C:\Users\Zelcore-Dator\AppData\Local\Programs\Python\Python35\lib\site-packages\google\proto
buf\internal\python_message.py", line 548, in _GetFieldByName
(message_descriptor.name, field_name))
ValueError: Protocol message RewriterConfig has no "layout_optimizer" field.
I'm guessing that it has something to do with protobuf, but I've reinstalled it several times already with no success.
All help appreciated
Happened to me too. Didn't happen few weeks ago.
Until the bug is fixed, you could use an earlier version that still works.
replace line 72 in 'object_detection/exporter.py':
layout_optimizer=rewriter_config_pb2.RewriterConfig.ON)
with the old and working line:
optimize_tensor_layout=True)
I used:
rewrite_options = rewriter_config_pb2.RewriterConfig(optimize_tensor_layout=True)
but kept running into the same issue UNTIL I went and reran
python setup.py install
from my "research" folder. Then I was able to get everything to work.
Remove optimize_tensor_layout=rewriter_config_pb2.RewriterConfig.ON
change the line 71 in exporter.py
rewrite_options = rewriter_config_pb2.RewriterConfig(optimize_tensor_layout=rewriter_config_pb2.RewriterConfig.ON)
to:
rewrite_options = rewriter_config_pb2.RewriterConfig()

KeyError: 'browser' with Splinter and Behaving automated testing

I followed the instructions here: http://shon.github.io/2014/06/19/ui_testing_and_bdd.html about setting up Splinter with Behaving to run automated tests. I'm able to run a test successfully, but at the end of the test, it throws an error saying:
KeyError: 'browser'
and it won't continue testing any additional feature files. I'm pretty new to python and need some help in troubleshooting this.
Exception KeyError: 'browser'
Traceback (most recent call last):
File "/usr/local/bin/behave", line 11, in <module> sys.exit(main())
File "/Library/Python/2.7/site-packages/behave/__main__.py", line 109, in main
failed = runner.run()
File "/Library/Python/2.7/site-packages/behave/runner.py", line 672, in run
return self.run_with_paths()
File "/Library/Python/2.7/site-packages/behave/runner.py", line 693, in run_with_paths
return self.run_model()
File "/Library/Python/2.7/site-packages/behave/runner.py", line 483, in run_model
failed = feature.run(self)
File "/Library/Python/2.7/site-packages/behave/model.py", line 523, in run
failed = scenario.run(runner)
File "/Library/Python/2.7/site-packages/behave/model.py", line 867, in run
runner.run_hook('before_scenario', runner.context, self)
File "/Library/Python/2.7/site-packages/behave/runner.py", line 405, in run_hook
self.hooks[name](context, *args)
File "features/environment.py", line 48, in before_scenario
context.browser = default_browser
File "/Library/Python/2.7/site-packages/behave/runner.py", line 223, in __setattr__
record = self._record[attr]
KeyError: 'browser'
I found the issue. It is related to the Feature file structure. The Feature file was missing:
Background:
Given a browser
This also required changes to the environment.py file based on the info here: https://github.com/ggozad/behaving

Categories

Resources