OpenGauss environment installation problem - database

Traceback (most recent call last):
File "/opt/software/openGauss/script/gspylib/os/gsfile.py", line 31, in <module>
import psutil
File "/opt/software/openGauss/script/gspylib/os/../../../lib/psutil/__init__.py", line 95, in <module>
from . import _pslinux as _psplatform
File "/opt/software/openGauss/script/gspylib/os/../../../lib/psutil/_pslinux.py", line 26, in <module>
from . import _psutil_linux as cext
File "/opt/software/openGauss/script/gspylib/os/../../../lib/psutil/_psutil_linux.py", line 7, in <module>
__bootstrap__()
File "/opt/software/openGauss/script/gspylib/os/../../../lib/psutil/_psutil_linux.py", line 6, in __bootstrap__
imp.load_dynamic(__name__,__file__)
File "/usr/local/python3/lib/python3.7/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /opt/software/openGauss/script/gspylib/os/../../../lib/psutil/_psutil_linux.so: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "gs_preinstall", line 32, in <module>
from gspylib.common.DbClusterInfo import dbClusterInfo, \
File "/opt/software/openGauss/script/gspylib/common/DbClusterInfo.py", line 36, in <module>
from gspylib.os.gsfile import g_file
File "/opt/software/openGauss/script/gspylib/os/gsfile.py", line 65, in <module>
import psutil
File "/opt/software/openGauss/script/gspylib/os/../../../lib/psutil/__init__.py", line 95, in <module>
from . import _pslinux as _psplatform
File "/opt/software/openGauss/script/gspylib/os/../../../lib/psutil/_pslinux.py", line 26, in <module>
from . import _psutil_linux as cext
ImportError: /opt/software/openGauss/script/gspylib/os/../../../lib/psutil/_psutil_linux.so: cannot open shared object file: No such file or directory

The error is that the python dependency cannot be found. Look for the dependency package ‘psutil’

Related

ModuleNotFoundError: No module named 'google.cloud.location'

We have an application that uses firestore. It is running on Python 3.x on standard Google app engine. The application was running fine, till this morning when we tried to run the new version. The deployment of the new version is executed without any error. The requirement.txt is as follows -
firebase_admin==3.0.0
sendgrid==6.9.3
google-auth==1.35.0
google-auth-httplib2==0.1.0
jinja2==3.0.3
MarkupSafe==2.0.1
pytz==2021.3
Flask==2.0.2
twilio==6.46.0
httplib2==0.20.2
requests==2.24.0
requests_toolbelt==0.9.1
google-cloud-tasks==2.7.1
google-cloud-logging==1.15.1
googleapis-common-protos==1.54.0
protobuf==3.20.1
We get the following error.
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/services/firestore/client.py", line 55, in <module>
from google.cloud.location import locations_pb2 # type: ignore
ModuleNotFoundError: No module named 'google.cloud.location'
Please help.
Updated (9-24-2022) with the complete error output.
Traceback (most recent call last):
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 92, in init_process
super().init_process()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/opt/python3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/srv/main.py", line 8, in <module>
from controllers import server, common, header
File "/srv/controllers/server.py", line 19, in <module>
from controllers import basehandler
File "/srv/controllers/basehandler.py", line 12, in <module>
from google.cloud import firestore
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore/__init__.py", line 18, in <module>
from google.cloud.firestore_v1 import __version__
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/__init__.py", line 36, in <module>
from google.cloud.firestore_v1.async_client import AsyncClient
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/async_client.py", line 45, in <module>
from google.cloud.firestore_v1.async_transaction import AsyncTransaction
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/async_transaction.py", line 49, in <module>
from google.cloud.firestore_v1.client import Client
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/client.py", line 44, in <module>
from google.cloud.firestore_v1.services.firestore import client as firestore_client
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/services/firestore/__init__.py", line 16, in <module>
from .client import FirestoreClient
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/firestore_v1/services/firestore/client.py", line 55, in <module>
from google.cloud.location import locations_pb2 # type: ignore
ModuleNotFoundError: No module named 'google.cloud.location'
It looks like Google made a mistake in setting requirements for one its Python packages.
If you create a new virtual environment, install with pip install -r you should be able to recreate the error you are seeing in production.
To fix it, I would do pip list on your local machine (in the environment that is still working) and add fixed versions of other installed google packages until it works.
You can test by creating a new Python virtual environment, installing with pip install -r and seeing if it works.
It is a tedious process unfortunately.
I got this exact same error just now while trying to link a Python script to Firestore. I don't know if this is a "correct" solution but I got my code to run and save data to my Firestore database after this doing this.
In the error message, this line specifies the file where google.cloud.location is being imported:
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/google/cloud/firestore_v1/services/firestore/client.py", line 55, in <module>
If you open the client.py file and comment out the line 55 ("from google.cloud.location import locations_pb2 # type: ignore"), then run your code again, the next error message will show the other file where google.cloud.location is being imported. Repeat this process for all five files where this module is imported. (client.py, base.py, grpc.py, grpc_asyncio.py, async_client.py)
From searching through the code, I'm seeing that locations_pb2 (imported from google.cloud.location) is never used. I suspect that commenting this out entirely won't affect the functionality of firebase_admin.

AttributeError: module 'collections' has no attribute 'Mapping'

not sure what to do
and having a tough time installing an older version of python
Traceback (most recent call last):
File "/home/g/.local/bin/cairo-compile", line 7, in <module>
from starkware.cairo.lang.compiler.cairo_compile import main # noqa
File "/home/g/.local/lib/python3.10/site-packages/starkware/cairo/lang/compiler/cairo_compile.py", line 9, in <module>
from starkware.cairo.lang.compiler.assembler import assemble
File "/home/g/.local/lib/python3.10/site-packages/starkware/cairo/lang/compiler/assembler.py", line 7, in <module>
from starkware.cairo.lang.compiler.program import CairoHint, Program
File "/home/g/.local/lib/python3.10/site-packages/starkware/cairo/lang/compiler/program.py", line 25, in <module>
from starkware.starkware_utils.marshmallow_dataclass_fields import IntAsHex
File "/home/g/.local/lib/python3.10/site-packages/starkware/starkware_utils/marshmallow_dataclass_fields.py", line 6, in <module>
from frozendict import frozendict
File "/home/g/.local/lib/python3.10/site-packages/frozendict/__init__.py", line 16, in <module>
class frozendict(collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'
❯ vim +16 /home/g/.local/lib/python3.10/site-packages/frozendict/__init__.py
and modified line 16 this way:
- class frozendict(collections.Mapping):
+ class frozendict(collections.abc.Mapping):
good as new :)

Can't generate an OpenAPI

I have been working through the tutorial: Getting started with Endpoints Frameworks for Python same as this person How do I fix OpenAPI document generation on Google Cloud Endpoints?
and I'm having a similar problem
Traceback (most recent call last):
File "lib/endpoints/endpointscfg.py", line 28, in <module>
from endpoints._endpointscfg_impl import main
File "/endpoints-frameworks-v2/echo/lib/endpoints/__init__.py", line 33, in <module>
from .apiserving import *
File "/endpoints-frameworks-v2/echo/lib/endpoints/apiserving.py", line 71, in <module>
from endpoints_management.control import client as control_client
File "/endpoints-frameworks-v2/echo/lib/endpoints_management/__init__.py", line 19, in <module>
from . import auth, config, control, gen
File "/endpoints-frameworks-v2/echo/lib/endpoints_management/auth/__init__.py", line 19, in <module>
from . import suppliers, tokens
File "/endpoints-frameworks-v2/echo/lib/endpoints_management/auth/suppliers.py", line 21, in <module>
from jwkest import jwk
File "/endpoints-frameworks-v2/echo/lib/jwkest/jwk.py", line 11, in <module>
from Crypto.PublicKey import RSA
File "/endpoints-frameworks-v2/echo/lib/Crypto/PublicKey/RSA.py", line 78, in <module>
from Crypto import Random
File "/endpoints-frameworks-v2/echo/lib/Crypto/Random/__init__.py", line 28, in <module>
from Crypto.Random import OSRNG
ImportError: cannot import name OSRNG
when I run this line with my project-ID
python lib/endpoints/endpointscfg.py get_openapi_spec main.EchoApi --hostname [YOUR_PROJECT_ID].appspot.com
any idea if this is a bug that can be fixed

GAE Launcher (Python) could not start

I believe this is related a number of python packages I have recently installed environmental variables that I have changed. I have re-installed Numpy and GAE, which did not help. So any suggestions on this? Thanks!
The GAE log indicated that the failure was lined to file import
2013-12-11 11:45:20 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8094', '--admin_port=8004', 'D:\\Dropbox\\ubertool_src']"
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 197, in <module>
_run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 193, in _run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 27, in <module>
import tempfile
File "C:\Python27\Lib\tempfile.py", line 34, in <module>
from random import Random as _Random
File "C:\Python27\Lib\site-packages\numpy\random\__init__.py", line 102, in <module>
ranf = random = sample = random_sample
NameError: name 'random_sample' is not defined
2013-12-11 11:45:21 (Process exited with code 1)
Update
just did a little test.
I can run from numpy import random
but if I run import random
The error msg is:
>>> import random
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\Lib\site-packages\numpy\random\__init__.py", line 102, in <module>
ranf = random = sample = random_sample
NameError: name 'random_sample' is not defined
Update
The problem is solved after removing C:\Python27\Lib\site-packages\numpy (I am not sure how this was added) from PYTHONPATH in Environmental Variable

How can I fix this error when executing GAE SDK in Ubuntu?

I was following the outlines of this guide (http://www.instructables.com/id/Aquaponics-Online-Temperature-and-Humidity/step3/Testing-GAE-SDK/), so I can try to innovate the design for my own aquaponic system.
However, when I typed "$ python2.7 AppEngine/dev_appserver.py IAquaponics_DHT/myapsystem" into my terminal, I received an error: http://i.imgur.com/ueO4MA1.jpg (my stacktrace is below).
note: "__" is to blank out my name.
____#____-Linux:~$ python2.7 AppEngine/dev_appserver.py
Traceback (most recent call last):
File "AppEngine/dev_appserver.py", line 182, in <module>
_run_file(__file__, globals())
File "AppEngine/dev_appserver.py", line 178, in _run_file
execfile(script_path, globals_)
File "/home/____/AppEngine/google/appengine/tools/devappserver2/devappserver2.py", line 32, in <module>
from google.appengine.tools.devappserver2.admin import admin_server
File "/home/____/AppEngine/google/appengine/tools/devappserver2/admin/admin_server.py", line 25, in <module>
import webapp2
File "/home/____/AppEngine/lib/webapp2-2.5.1/webapp2.py", line 25, in <module>
import webob
File "/home/____/AppEngine/lib/webob-1.2.3/webob/__init__.py", line 3, in <module>
from webob.response import *
File "/home/____/AppEngine/lib/webob-1.2.3/webob/response.py", line 9, in <module>
import zlib
ImportError: No module named zlib
Have you tried (run enter this in the terminal window to install the install a package for zlib)
sudo apt-get install zlib
start there

Resources