I have an application which works perfectly locally. But, for some reason, in GAE (standard python37) it seems to have an issue importing pyrebase (pyrebase==3.0.27 in requirements.txt). Any idea how to fix this?
Thanks in advance!
Traceback (most recent call last):
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
self.load_wsgi()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, 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 52, in load
return self.load_wsgiapp()
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, 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 350, in import_app
__import__(module)
File "/workspace/main.py", line 8, in <module>
import pyrebase
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/pyrebase/__init__.py", line 1, in <module>
from .pyrebase import initialize_app
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/pyrebase/pyrebase.py", line 17, in <module>
from oauth2client.service_account import ServiceAccountCredentials
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/oauth2client/service_account.py", line 25, in <module>
from oauth2client import client
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/oauth2client/client.py", line 47, in <module>
from oauth2client import crypt
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/oauth2client/crypt.py", line 55, in <module>
from oauth2client import _pycrypto_crypt
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/oauth2client/_pycrypto_crypt.py", line 17, in <module>
from Crypto.PublicKey import RSA
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/Crypto/PublicKey/__init__.py", line 29, in <module>
from Crypto.Util.asn1 import (DerSequence, DerInteger, DerBitString,
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/Crypto/Util/asn1.py", line 33, in <module>
from Crypto.Util.number import long_to_bytes, bytes_to_long
File "/layers/google.python.pip/pip/lib/python3.7/site-packages/Crypto/Util/number.py", line 398
s = pack('>I', n & 0xffffffffL) + s
SyntaxError: invalid syntax
Pyrebase 3.0.27 is having compatibility issue with Python version 3. Instead, use the latest version of Pyrebase: Pyrebase4.
The OP solved the problem by changing Pyrebase version in requirements.txt:
From pyrebase==3.0.27 to Pyrebase4==4.5.0
Related
When i tried to use the pip command on ubuntu , on termux it says , no module named jnia
which pip returns /usr/bin/pip
how can I make the pip command usable ,
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py", line 85, in _android_folder from jnius import autoclass
ModuleNotFoundError: No module named 'jnius'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/pip/__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 8, in <module> from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "/usr/lib/python3/dist-packages/pip/_internal/configuration.py", line 26, in <module> from pip._internal.utils.logging import getLogger
File "/usr/lib/python3/dist-packages/pip/_internal/utils/logging.py", line 27, in <module>
from pip._internal.utils.misc import ensure_dir
File "/usr/lib/python3/dist-packages/pip/_internal/utils/misc.py", line 39, in <module> from pip._internal.locations import get_major_minor_version
File "/usr/lib/python3/dist-packages/pip/_internal/locations/__init__.py", line 14, in <module>
from . import _distutils, _sysconfig
File "/usr/lib/python3/dist-packages/pip/_internal/locations/_distutils.py", line 19, in <module>
from .base import get_major_minor_version
File "/usr/lib/python3/dist-packages/pip/_internal/locations/base.py", line 12, in <module>
USER_CACHE_DIR = appdirs.user_cache_dir("pip")
File "/usr/lib/python3/dist-packages/pip/_internal/utils/appdirs.py", line 17, in user_cache_dir
return _appdirs.user_cache_dir(appname, appauthor=False)
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/__init__.py", line 114, in user_cache_dir
return PlatformDirs(appname=appname, appauthor=appauthor, version=version, opinion=opinion).user_cache_dir
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py", line 43, in user_cache_dir return self._append_app_name_and_version(_android_folder(), "cache")
File "/usr/lib/python3/dist-packages/pip/_vendor/platformdirs/android.py", line 97, in _android_folder raise OSError("Cannot find path to android app folder") OSError: Cannot find path to android app folder
Do ANDROID_DATA=anything, so pip will think it is running in a normal linux not android.
Try sudo pip install <package>.
I have installed pip3 on my raspberry pi but when I run it the following error pops up. I already tried reinstalling it. Anyone knows this error?
pi#henriette ~/servokit $ pip3
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 9, in <module>
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2280, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1990, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>
from pip._internal.locations import USER_CACHE_DIR, src_prefix
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/locations.py", line 13, in <module>
from pip._internal.utils import appdirs
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/utils/appdirs.py", line 12, in <module>
from pip._internal.utils.compat import WINDOWS, expanduser
File "/usr/local/lib/python3.2/dist-packages/pip/_internal/utils/compat.py", line 67
return u"".join(u"\\x%x" % c for c in raw_bytes), err.end
^
SyntaxError: invalid syntax
Python 3.2 doesn't support u"" unicode strings. Upgrade to Python 3.4+.
I am following tutorial for Tensorflow Object Detection
link
and getting the following command when i try this command
python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config
error:
FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "train.py", line 49, in <module>
from object_detection import trainer
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\trainer.py", line 32, in <module>
from object_detection.utils import variables_helper
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\utils\variables_helper.py", line 23, in <module>
slim = tf.contrib.slim
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 53, in __getattr__
module = self._load()
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 42, in _load
module = importlib.import_module(self.__name__)
File "C:\Users\ASUS PC\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\__init__.py", line 37, in <module>
from tensorflow.contrib import distributions
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\distributions\__init__.py", line 39, in <module>
from tensorflow.contrib.distributions.python.ops.estimator import *
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\distributions\python\ops\estimator.py", line 21, in <module>
from tensorflow.contrib.learn.python.learn.estimators.head import _compute_weighted_loss
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\learn\__init__.py", line 95, in <module>
from tensorflow.contrib.learn.python.learn import *
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\__init__.py", line 28, in <module>
from tensorflow.contrib.learn.python.learn import *
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\__init__.py", line 40, in <module>
from tensorflow.contrib.learn.python.learn.experiment import Experiment
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 39, in <module>
from tensorflow.contrib.tpu.python.tpu import tpu_estimator
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\tpu\__init__.py", line 54, in <module>
from tensorflow.contrib.tpu.python import profiler
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\tpu\python\profiler\__init__.py", line 23, in <module>
from tensorflow.contrib.tpu.profiler.tpu_profiler_analysis_pb2 import *
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\tpu\profiler\tpu_profiler_analysis_pb2.py", line 16, in <module>
from tensorflow.contrib.tpu.profiler import tpu_profiler_pb2 as tensorflow_dot_contrib_dot_tpu_dot_profiler_dot_tpu__profiler__pb2
File "C:\Users\ASUS PC\Anaconda3\lib\site-packages\tensorflow\contrib\tpu\profiler\tpu_profiler_pb2.py", line 395, in <module>
_sym_db.RegisterServiceDescriptor(_TPUPROFILER)
AttributeError: 'SymbolDatabase' object has no attribute 'RegisterServiceDescriptor'
anybody faced this types of error? If so how can i solve the problem?
I is definitely related to something being off in your setup.py. Here is a thread that may help: https://github.com/GoogleCloudPlatform/cloudml-samples/issues/146. You may need to specify the version of the packages you are using as well.
link
In here the same issue is discussed and they found a solution. The problem is protobuf version i think.
I have an issue when importing Theano into a python script, I cloned the latest dev version as the 0.7.0 version didn't work either:
error message:
File "<ipython-input-1-1145adbc62d9>", line 1, in <module>
runfile('C:/Users/Michael/.spyder2-py3/temp.py', wdir='C:/Users/Michael/.spyder2-py3')
File "C:\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "C:\Anaconda3\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 88, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "C:/Users/Michael/.spyder2-py3/temp.py", line 2, in <module>
import theano.tensor as T
File "C:\Anaconda3\lib\site-packages\theano\__init__.py", line 63, in <module>
from theano.compile import (
File "C:\Anaconda3\lib\site-packages\theano\compile\__init__.py", line 9, in <module>
from theano.compile.function_module import *
File "C:\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 22, in <module>
import theano.compile.mode
File "C:\Anaconda3\lib\site-packages\theano\compile\mode.py", line 12, in <module>
import theano.gof.vm
File "C:\Anaconda3\lib\site-packages\theano\gof\vm.py", line 638, in <module>
from . import lazylinker_c
File "C:\Anaconda3\lib\site-packages\theano\gof\lazylinker_c.py", line 126, in <module>
preargs=args)
File "C:\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2196, in compile_str
(status, compile_stderr.replace('\n', '. ')))
. collect2.exe: error: ld returned 1 exit statusir_Windows-10-10.0.10586-SP0-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.5.1-64/lazylinker_ext/mod.cpp:936: undefined reference to `__imp__Py_TrueStruct'Error' undefined references to `__imp__Py_NoneStruct' followow
I have successfully installed the sphnix on Windows/Python 3.4, then successfully generated a basic structure by calling sphinx-quickstart.
But when calling sphinx-build html or make html, it throws an exception:
D:\my-doc>make html
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main "__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code exec(code, run_globals)
File "C:\Python34\Scripts\sphinx-build.exe\__main__.py", line 9, in <module>
File "C:\Python34\lib\site-packages\sphinx\__init__.py", line 51, in main sys.exit(build_main(argv))
File "C:\Python34\lib\site-packages\sphinx\__init__.py", line 61, in build_main from sphinx import cmdline
File "C:\Python34\lib\site-packages\sphinx\cmdline.py", line 23, in <module> from sphinx.application import Sphinx
File "C:\Python34\lib\site-packages\sphinx\application.py", line 37, in <module> from sphinx.builders import BUILTIN_BUILDERS
File "C:\Python34\lib\site-packages\sphinx\builders\__init__.py", line 23, in <module> from sphinx.util import i18n, path_stabilize
File "C:\Python34\lib\site-packages\sphinx\util\i18n.py", line 15, in <module> from babel.messages.pofile import read_po
File "C:\Python34\lib\site-packages\babel\messages\__init__.py", line 12, in <module> from babel.messages.catalog import *
File "C:\Python34\lib\site-packages\babel\messages\catalog.py", line 23, in <module> from babel.dates import format_datetime
File "C:\Python34\lib\site-packages\babel\dates.py", line 28, in <module> from babel.util import UTC, LOCALTZ
File "C:\Python34\lib\site-packages\babel\util.py", line 278, in <module> from babel import localtime
File "C:\Python34\lib\site-packages\babel\localtime\__init__.py", line 21, in <module> from babel.localtime._win32 import _get_localzone
File "C:\Python34\lib\site-packages\babel\localtime\_win32.py", line 18, in <module> tz_names = get_global('windows_zone_mapping')
File "C:\Python34\lib\site-packages\babel\core.py", line 58, in get_global _global_data = pickle.load(fileobj) TypeError: an integer is required (got type str)
I guess this is about compatibilities, since I have followed the tutorial step by step. Also been googling for this issue for hours and could not find an answer so far. Is it something I'm doing wrong or is it a compatibility issue?
The bug appears to be in babel v2.0. I downgraded to 1.3 (pip install babel==1.3) and the issue went away. Let me know if this works for you.