Tag Archives: Daily error

Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘

AttributeError encountered when executing gnocchi metric list related commands using ceilometer and gnocchi: _Environ instance has no attribute ‘。
Control node execution: gnocchi metric list
Traceback (most recent call last):
File “/usr/bin/gnocchi”, line 10, in
sys.exit(main())
File “/usr/lib/python2.7/site-packages/gnocchiclient/shell.py”, line 252, in main
return GnocchiShell().run(args)
File “/usr/lib/python2.7/site-packages/gnocchiclient/shell.py”, line 99, in init
deferred_help=True,
File “/usr/lib/python2.7/site-packages/cliff/app.py”, line 79, in init
self.parser = self.build_option_parser(description, version)
File “/usr/lib/python2.7/site-packages/gnocchiclient/shell.py”, line 130, in build_option_parser
os.environ.set(“OS_AUTH_TYPE”, “password”)
AttributeError: _Environ instance has no attribute ‘set’


Solution:
vi keystonerc_admin
Modify
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=‘openstack password’
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://x.x.x.x:5000/v3
export PS1=’[\u@\h \W(keystone_admin)]$ ’
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
export OS_PLACEMENT_API_VERSION=1.17
export OS_AUTH_TYPE=password
At this point the following command can be used in the terminal:

source ~/keystonerc_admin
gnocchi metric list
gnocchi metric list | grep cpu
gnocchi resource list
gnocchi resource list  --type image
gnocchi measures show 839afa02-1668-4922-a33e-6b6ea7780715

Flutter Error: Cannot run with sound null safety, because the following dependencies don‘t support

Since flutter 2, flutter has enabled null security by default in the configuration. By incorporating null checking into the type system, these errors can be caught during development, so as to prevent crashes caused by the reproduction environment. If empty security is enabled in the current project and the imported third-party plug-in is not adapted, the operation returns the following error.

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:provider

For solutions, see https://dart.dev/go/unsound-null-safety
Restarted application in 341ms.

At this time, you can check whether the new version of the imported plug-in supports empty security. If the plug-in supports empty security, the plug-in platform will mark it as empty security:

if the imported plug-in does not support empty security, you can execute the following commands on the terminal to run the software

flutter run --no-sound-null-safety

The scheme failed with ‘command’ failed

PIP install pylibmc installation failure and its solution. During installation, the following errors are reported, and there may be other errors, similar to the following:

pip install pylibmc==1.6.1
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pylibmc==1.6.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a7/0c/f7a3af34b05c167a69ed1fc330b06b658dac4ab25b8632c52d1022dd5337/pylibmc-1.6.1.tar.gz (64 kB)
Building wheels for collected packages: pylibmc
  Building wheel for pylibmc (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/yangchangjia/PycharmProjects/Nox/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py'"'"'; __file__='"'"'/private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-wheel-73t1n0ft
       cwd: /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/
  Complete output (28 lines):
  /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py:98: DeprecationWarning: 'U' mode is deprecated
    with open("README.rst", "U", encoding="utf-8") as r:
  /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py:100: DeprecationWarning: 'U' mode is deprecated
    with open("src/pylibmc-version.h", "U", encoding="utf-8") as r:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.15-x86_64-3.8
  creating build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/autoconf.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/pools.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/client.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/test.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/consts.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  copying src/pylibmc/__main__.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
  running build_ext
  building '_pylibmc' extension
  creating build/temp.macosx-10.15-x86_64-3.8
  creating build/temp.macosx-10.15-x86_64-3.8/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -DUSE_ZLIB -I/Users/yangchangjia/PycharmProjects/Nox/venv/include -I/Users/yangchangjia/.pyenv/versions/3.8.6/include/python3.8 -c src/_pylibmcmodule.c -o build/temp.macosx-10.15-x86_64-3.8/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
  In file included from src/_pylibmcmodule.c:34:
  src/_pylibmcmodule.h:42:10: fatal error: 'libmemcached/memcached.h' file not found
  #include <libmemcached/memcached.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pylibmc
  Running setup.py clean for pylibmc
Failed to build pylibmc
Installing collected packages: pylibmc
    Running setup.py install for pylibmc ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/yangchangjia/PycharmProjects/Nox/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py'"'"'; __file__='"'"'/private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-record-tox14kc6/install-record.txt --single-version-externally-managed --compile --install-headers /Users/yangchangjia/PycharmProjects/Nox/venv/include/site/python3.8/pylibmc
         cwd: /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/
    Complete output (28 lines):
    /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py:98: DeprecationWarning: 'U' mode is deprecated
      with open("README.rst", "U", encoding="utf-8") as r:
    /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py:100: DeprecationWarning: 'U' mode is deprecated
      with open("src/pylibmc-version.h", "U", encoding="utf-8") as r:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-3.8
    creating build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/autoconf.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/pools.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/client.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/test.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/consts.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    copying src/pylibmc/__main__.py -> build/lib.macosx-10.15-x86_64-3.8/pylibmc
    running build_ext
    building '_pylibmc' extension
    creating build/temp.macosx-10.15-x86_64-3.8
    creating build/temp.macosx-10.15-x86_64-3.8/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -DUSE_ZLIB -I/Users/yangchangjia/PycharmProjects/Nox/venv/include -I/Users/yangchangjia/.pyenv/versions/3.8.6/include/python3.8 -c src/_pylibmcmodule.c -o build/temp.macosx-10.15-x86_64-3.8/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
    In file included from src/_pylibmcmodule.c:34:
    src/_pylibmcmodule.h:42:10: fatal error: 'libmemcached/memcached.h' file not found
    #include <libmemcached/memcached.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/yangchangjia/PycharmProjects/Nox/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py'"'"'; __file__='"'"'/private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-install-14fh8zn_/pylibmc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/x7/zprpyfhx3h3g5qs3c_z_gxqc0000gn/T/pip-record-tox14kc6/install-record.txt --single-version-externally-managed --compile --install-headers /Users/yangchangjia/PycharmProjects/Nox/venv/include/site/python3.8/pylibmc Check the logs for full command output.

Solution:

brew install libmemcached
pip install wheel
pip install pylibmc

Installation successful:

pip install pylibmc
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pylibmc
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a7/0c/f7a3af34b05c167a69ed1fc330b06b658dac4ab25b8632c52d1022dd5337/pylibmc-1.6.1.tar.gz (64 kB)
Building wheels for collected packages: pylibmc
  Building wheel for pylibmc (setup.py) ... done
  Created wheel for pylibmc: filename=pylibmc-1.6.1-cp38-cp38-macosx_10_15_x86_64.whl size=33323 sha256=9a8ecb4933b8a455b7ffe9db042011f3a9865c18441b8e5204d843bc0e6da1a3
  Stored in directory: /Users/yangchangjia/Library/Caches/pip/wheels/a1/8e/7e/d1b6684901c01de15a45efb8b5172c1dc7b9c6a7386d369839
Successfully built pylibmc
Installing collected packages: pylibmc
Successfully installed pylibmc-1.6.1

cv2.error: OpenCV(3.4.2) error: (-215:Assertion failed) !empty() in function ‘detectMultiScale‘

cv2。错误:(-215:断言失败)!empty()函数’ detectMultiScale ‘

报错信息

cv2.error: OpenCV(3.4.2) /Users/travis/build/skvark/opencv-python/opencv/modules/objdetect/src/cascadedetect.cpp:1698: error: (-215:Assertion failed) !empty() in function 'detectMultiScale'

solution

cv2.CascadeClassifier('**/**/**.xml')

check the above path, in any case similar to check the path is correct