Sphinx throws an exception on Python 3.4/Windows - python-3.x

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.

Related

cannot use the pip command on termux ubunty , says OSError , cant fint path to android path folder

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>.

Cannot import pyrebase GAE

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

Getting DLL error with 'jupyter lab' command in Anaconda Installation

Getting DLL error with 'jupyter lab' command in Anaconda Installation:
Details for system:
conda 4.5.11
Python 3.7.0
jupyter 4.4.0
Height of weirdness is that I am able to launch jupyter lab from Anaconda Navigator, but 'jupyter lab' is not working and throwing below exception:
Traceback (most recent call last):
File "c:\ml\installed_tools\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\ml\installed_tools\anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ML\installed_tools\anaconda3\Scripts\jupyter-lab.EXE\__main__.py", line 5, in <module>
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 12, in <module>
from jupyterlab_server import slugify, WORKSPACE_EXTENSION
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab_server\__init__.py", line 4, in <module>
from .app import LabServerApp
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab_server\app.py", line 9, in <module>
from .server import ServerApp
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyterlab_server\server.py", line 32, in <module>
from jupyter_server.serverapp import ServerApp, aliases, flags # noqa
File "c:\ml\installed_tools\anaconda3\lib\site-packages\jupyter_server\serverapp.py", line 46, in <module>
from zmq.eventloop import ioloop
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "c:\ml\installed_tools\anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
Although I have posted this question, but now I also got a solution for the same.
Please add following in the path variable, it will be resolved thereafter (I just checked):
C:\ML\installed_tools\anaconda3 (was already present)
C:\ML\installed_tools\anaconda3\Scripts (was already present)
C:\ML\installed_tools\anaconda3\Library\bin (added now)
C:\ML\installed_tools\anaconda3\Library\mingw-w64\bin (added now)

Tensorflow Object Detection Training Error

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.

Scrapy ImportError: DLL load failed: The specified procedure was not found

I'm trying to create a scrapy project but everytime I try scrapy startproject tutorial I get the following error:
Traceback (most recent call last):
File "c:\python 3.6\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python 3.6\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python 3.6\Scripts\scrapy.exe\__main__.py", line 5, in <module>
File "c:\python 3.6\lib\site-packages\scrapy\__init__.py", line 34, in <module>
from scrapy.spiders import Spider
File "c:\python 3.6\lib\site-packages\scrapy\spiders\__init__.py", line 10, in <module>
from scrapy.http import Request
File "c:\python 3.6\lib\site-packages\scrapy\http\__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "c:\python 3.6\lib\site-packages\scrapy\http\request\form.py", line 11, in <module>
import lxml.html
File "c:\python 3.6\lib\site-packages\lxml\html\__init__.py", line 54, in <module>
from .. import etree
ImportError: DLL load failed: The specified procedure was not found.
I'm on Windows 10 and lxml version is 3.8.0
EDIT
after installing the unofficial build(lxml-3.8.0-cp36-cp36m-win32.whl) from here it works.

Resources