pyramid pserve pviews P* re.compile syntax error - python-3.x

I used to launch the command pserve --reload development.ini in my vagrant box to launch a pyramid server locally. The command was working until the last few days.
However, I now have a syntax error preventing me from launching pserve with or without conf file.
(py32)vagrant.vm bin # pserve
Traceback (most recent call last):
File "/var/virtualenv/py32/bin/pserve", line 9, in <module>
load_entry_point('pyramid==1.5.1', 'console_scripts', 'pserve')()
File "/var/virtualenv/py32/lib/python3.2/site-packages/pkg_resources/__init__.py", line 519, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pkg_resources/__init__.py", line 2630, in load_entry_point
return ep.load()
File "/var/virtualenv/py32/lib/python3.2/site-packages/pkg_resources/__init__.py", line 2310, in load
return self.resolve()
File "/var/virtualenv/py32/lib/python3.2/site-packages/pkg_resources/__init__.py", line 2316, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 31, in <module>
from pyramid.paster import setup_logging
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/paster.py", line 10, in <module>
from pyramid.scripting import prepare
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/scripting.py", line 1, in <module>
from pyramid.config import global_registries
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/config/__init__.py", line 9, in <module>
from webob.exc import WSGIHTTPException as WebobWSGIHTTPException
File "/var/virtualenv/py32/lib/python3.2/site-packages/webob/__init__.py", line 2, in <module>
from webob.request import *
File "/var/virtualenv/py32/lib/python3.2/site-packages/webob/request.py", line 10, in <module>
import simplejson as json
File "/var/virtualenv/py32/lib/python3.2/site-packages/simplejson/__init__.py", line 113, in <module>
from .encoder import JSONEncoder, JSONEncoderForHTML
File "/var/virtualenv/py32/lib/python3.2/site-packages/simplejson/encoder.py", line 22
ESCAPE = re.compile(u'[\\x00-\\x1f\\\\"\\b\\f\\n\\r\\t\u2028\u2029]')
^
SyntaxError: invalid syntax
I use python 3.2.3 in this virtualenv
pviews and proutes give the same error
Any help appreciated :)
Regards
==========================
Thanks to Steve Piercy I uninstalled simplejson and pserve now works launched alone! Thanks again.
However, when I launch pserve development.ini, I now have another error:
(py32)vagrant.vm app # pserve --reload development.ini
Starting subprocess with file monitor
Traceback (most recent call last):
File "/var/virtualenv/py32/bin/pserve", line 9, in <module>
load_entry_point('pyramid==1.5.1', 'console_scripts', 'pserve')()
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 51, in main
return command.run()
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 316, in run
global_conf=vars)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/scripts/pserve.py", line 340, in loadapp
return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
File "/var/virtualenv/py32/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/var/virtualenv/py32/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/var/virtualenv/py32/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/var/virtualenv/py32/lib/python3.2/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/var/virtualenv/py32/lib/python3.2/site-packages/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/var/www/app/app/__init__.py", line 63, in main
request_factory=RequestFactory,
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/config/__init__.py", line 301, in __init__
exceptionresponse_view=exceptionresponse_view,
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/config/__init__.py", line 412, in setup_registry
self.include(inc)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid/config/__init__.py", line 755, in include
c(configurator)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid_jinja2/__init__.py", line 468, in includeme
_get_or_build_default_environment(config.registry)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid_jinja2/__init__.py", line 309, in _get_or_build_default_environment
filters = parse_config(settings.get('jinja2.filters', ''))
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid_jinja2/__init__.py", line 62, in parse_config
result[name.strip()] = maybe_import_string(impl)
File "/var/virtualenv/py32/lib/python3.2/site-packages/pyramid_jinja2/__init__.py", line 44, in maybe_import_string
return import_string(val.strip())
File "/var/virtualenv/py32/lib/python3.2/site-packages/jinja2/utils.py", line 213, in import_string
return getattr(__import__(module, None, None, [obj]), obj)
File "/var/www/app/app/views/filters.py", line 1, in <module>
from babel.dates import format_datetime, get_timezone, format_timedelta, format_date, UTC
File "/usr/lib/python3.2/importlib/_bootstrap.py", line 436, in load_module
return self._load_module(fullname)
File "/usr/lib/python3.2/importlib/_bootstrap.py", line 141, in decorated
return fxn(self, module, *args, **kwargs)
File "/usr/lib/python3.2/importlib/_bootstrap.py", line 342, in _load_module
exec(code_object, module.__dict__)
File "/tmp/pip-build-z2s2e9/babel/babel/__init__.py", line 20, in <module>
File "/var/virtualenv/py32/lib/python3.2/site-packages/babel/core.py", line 394
retval += ' (%s)' % u', '.join(details)
^
SyntaxError: invalid syntax
I tried to uninstall-reinstall babel with no luck.
Thanks for your help!

Did you recently install simplejson? It was and never will be compatible with Python 3.0 - 3.2. See https://github.com/simplejson/simplejson/issues/66#issuecomment-15360824

Related

Tests failling after django and python upgrade

I've upgraded Django from 4.0.5 to 4.1.6 and python from 3.9 to 3.11
I've also upgraded dependencies:
pip==23.0
pytest==7.2.1
pytest-django==4.5.2
coverage==7.1.0
pytest-cov==4.0.0
pylint==2.16.2
mock==5.0.1
These are my logs:
django-admin test
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 8, in <module>
sys.exit(execute_from_command_line())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/test.py", line 24, in run_from_argv
super().run_from_argv(argv)
File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 394, in run_from_argv
parser = self.create_parser(argv[0], argv[1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 357, in create_parser
self.add_arguments(parser)
File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/test.py", line 54, in add_arguments
test_runner_class = get_runner(settings, self.test_runner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/test/utils.py", line 394, in get_runner
test_module = __import__(test_module_name, {}, {}, test_path[-1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django_coverage/coverage_runner.py", line 31, in <module>
from django.db.models import get_app, get_apps
ImportError: cannot import name 'get_app' from 'django.db.models' (/usr/local/lib/python3.11/site-packages/django/db/models/__init__.py)
It works with
from django.apps import apps
Import Error :cannot import name get_model
But I have other issues with this library which is very old and I removed it from my project.
Ex:
django-admin test
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 8, in <module>
sys.exit(execute_from_command_line())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/test.py", line 24, in run_from_argv
super().run_from_argv(argv)
File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 394, in run_from_argv
parser = self.create_parser(argv[0], argv[1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 357, in create_parser
self.add_arguments(parser)
File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/test.py", line 54, in add_arguments
test_runner_class = get_runner(settings, self.test_runner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django/test/utils.py", line 394, in get_runner
test_module = __import__(test_module_name, {}, {}, test_path[-1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/django_coverage/coverage_runner.py", line 37, in <module>
from django_coverage.utils.coverage_report import html_report
File "/usr/local/lib/python3.11/site-packages/django_coverage/utils/coverage_report/__init__.py", line 17, in <module>
from html_report import *
ModuleNotFoundError: No module named 'html_report'

PyInstaller --onefile is throwing file not found error

I am trying to make an executable of a python 3.10 file using PyInstaller in the command prompt:
python -m PyInstaller --onefile 1.0.py
with "1.0" being my file name. I have done this many times before on the same PC and with the same python version, but for this file it is throwing a "file specified not found" error:
while run_next_command(read_fh, write_fh):
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\__main__.py", line 188, in <module>
run()
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\__main__.py", line 178, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\__main__.py", line 59, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 934, in main
build(specfile, distpath, workpath, clean_build)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 856, in build
exec(code, spec_namespace)
File "E:\Python Scripts\High Spen\Combined\1.0.spec", line 7, in <module>
a = Analysis(
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 381, in __init__
self.__postinit__()
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\datastruct.py", line 173, in __postinit__
self.assemble()
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 660, in assemble
isolated.call(find_binary_dependencies, list(self.binaries), self.binding_redirects, collected_packages)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\isolated\_parent.py", line 238, in call
return isolated.call(function, *args, **kwargs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\isolated\_parent.py", line 176, in call
raise RuntimeError(f"Child process call to {function.__name__}() failed with:\n" + output)
RuntimeError: Child process call to find_binary_dependencies() failed with:
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\core\cffi\_dll.py", line 23, in _LoadLibraryEx
result = check_null(
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\core\cffi\_util.py", line 81, in __call__
self._raise_error(function_name)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\core\cffi\_util.py", line 92, in _raise_error
raise exception
OSError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command
output = function(*args, **kwargs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\building\build_main.py", line 162, in find_binary_dependencies
return bindepend.Dependencies(binaries, redirects=binding_redirects, xtrapath=extra_libdirs)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\depend\bindepend.py", line 205, in Dependencies
for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\depend\bindepend.py", line 372, in getAssemblyFiles
for assembly in getAssemblies(pth):
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\depend\bindepend.py", line 326, in getAssemblies
res = winmanifest.GetManifestResources(pth)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\utils\win32\winmanifest.py", line 979, in GetManifestResources
return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PyInstaller\utils\win32\winresource.py", line 155, in GetResources
hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\win32api.py", line 42, in LoadLibraryEx
with _pywin32error():
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 153, in __exit__
self.gen.throw(typ, value, traceback)
File "C:\Users\jackp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryEx', 'The system cannot find the file specified')
Please could someone let me know how I would solve this or otherwise another method of turning this into an .exe. Thanks
Update:
I have tried uninstalling my python 3.10 and downloading 3.7 instead, as I saw somewhere that PyInstaller is incompatible with 3.8 and above, but this still didn't work for another reason. So I reinstalled 3.10 (effectively at this point I have uninstalled and reinstalled my python and IDE) and I am still getting the same error.

Connecting mongodb atlas through mongoengine in django after hosting on EC2 apache2

I am trying to host django project on EC2 usnig apache2 which is using mongodb atlas as database.
When I am running this locally on EC2 after openning some port like 8000, it runs properly but on apache it's giving error.
Below is some TLSFeature error, I am facing
mod_wsgi (pid=67994, process='tracky', application='ip-IP_ADDRESS|'): Loading Python script file '/home/tracky/tracky-api/tracky/wsgi.py'.
mongodb+srv://username:password#host/dbname?retryWrites=true&w=majority
mod_wsgi (pid=67994): Exception occurred processing WSGI script '/home/tracky/tracky-api/tracky/wsgi.py'.
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pool.py", line 1278, in _get_socket
sock_info = self.sockets.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site- File "/home/tracky/tracky-api/trackyapi/urls.py", line 2, in <module>
from .views import Tracky
File "/home/tracky/tracky-api/trackyapi/views.py", line 16, in <module>
from .serializers import GoalsSerializer, GoalSerializer
File "/home/tracky/tracky-api/trackyapi/serializers.py", line 9, in <module>
class GoalSerializer(DocumentSerializer):
File "/home/tracky/tracky-api/trackyapi/serializers.py", line 11, in GoalSerializer
uid = ReferenceField(User, write_only=True)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/rest_framework_mongoengine/fields.py", line 217, in __init__
self.queryset = model.objects
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/mongoengine/queryset/manager.py", line 38, in __get__
queryset = queryset_class(owner, owner._get_collection())
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/mongoengine/document.py", line 215, in _get_collection
db = cls._get_db()
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/mongoengine/document.py", line 193, in _get_db
return get_db(cls._meta.get("db_alias", DEFAULT_CONNECTION_NAME))
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/mongoengine/connection.py", line 363, in get_db
db.authenticate(
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/database.py", line 1492, in authenticate
self.client._cache_credentials(
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/mongo_client.py", line 780, in _cache_credentials
with server.get_socket(all_credentials) as sock_info:
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pool.py", line 1231, in get_socket
sock_info = self._get_socket(all_credentials)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pool.py", line 1281, in _get_socket
sock_info = self.connect(all_credentials)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pool.py", line 1180, in connect
sock = _configured_socket(self.address, self.opts)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pool.py", line 1002, in _configured_socket
sock = ssl_context.wrap_socket(sock, server_hostname=host)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pyopenssl_context.py", line 313, in wrap_socket
ssl_conn.do_handshake()
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pyopenssl_context.py", line 116, in do_handshake
return self._call(super(_sslConn, self).do_handshake, *args, **kwargs)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/pyopenssl_context.py", line 107, in _call
return call(*args, **kwargs)
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1915, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1618, in _raise_ssl_error
self._context._ocsp_helper.raise_if_problem()
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 294, in raise_if_problem
raise self._problems.pop(0)
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 590, in wrapper
valid = callback(conn, ocsp_data, data)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/ocsp_support.py", line 292, in _ocsp_callback
ext = _get_extension(cert, _TLSFeature)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/pymongo/ocsp_support.py", line 119, in _get_extension
return cert.extensions.get_extension_for_class(klass)
File "/home/ubuntu/anaconda3/envs/tracky/lib/python3.6/site-packages/cryptography/x509/extensions.py", line 134, in get_extension_for_class
raise ExtensionNotFound(
cryptography.x509.extensions.ExtensionNotFound: No <class 'cryptography.x509.extensions.TLSFeature'> extension was found
Any suggestion will be helpful.
Thanks.

python3 throwing ImportError: No module named concurrent.futures

I am running into following error on python3 when running botocore module,any guidance on how to fix it?
Traceback (most recent call last):
File "./wifi_build_audit_10_1", line 37, in <module>
config=botocore.client.Config(read_timeout=300)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/boto3/__init__.py", line 91, in client
return _get_default_session().client(*args, **kwargs)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/boto3/session.py", line 263, in client
aws_session_token=aws_session_token, config=config)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/botocore/session.py", line 838, in create_client
client_config=config, api_version=api_version)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/botocore/client.py", line 81, in create_client
cls = self._create_client_class(service_name, service_model)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/botocore/client.py", line 114, in _create_client_class
base_classes=bases)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/boto3/utils.py", line 61, in _handler
module = import_module(module)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/boto3/utils.py", line 52, in import_module
__import__(name)
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/boto3/s3/inject.py", line 15, in <module>
from boto3.s3.transfer import create_transfer_manager
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/boto3/s3/transfer.py", line 127, in <module>
from s3transfer.exceptions import RetriesExceededError as \
File "/Users/username/.pyenv/versions/3.7.8/lib/python3.7/site-packages/s3transfer/__init__.py", line 134, in <module>
import concurrent.futures
ImportError: No module named concurrent.futures

canĀ“t start ocsmanager in openchange

I compiled and installed openchange. Started samba and then:
make ocsmanager-install
make pyopenchange
make pyopenchange-install
All ok without errors, but when I try to run
paster serve /etc/ocsmanager/ocsmanager.ini --pid-file /var/run/ocsmanager.pid --log-file /var/log/ocsmanager.log
It aborts and logs this (in log file):
Traceback (most recent call last):
File "/usr/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
result = self.command()
File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 284, in command
relative_to=base, global_conf=vars)
File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 321, in loadapp
**kw)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/usr/lib/python2.7/site-packages/paste/deploy/util.py", line 56, in fix_call
val = callable(*args, **kw)
File "/usr/local/samba/lib/python2.7/site-packages/ocsmanager/config/middleware.py", line 43, in make_app
config = load_environment(global_conf, app_conf)
File "/usr/local/samba/lib/python2.7/site-packages/ocsmanager/config/environment.py", line 157, in load_environment
mstore = mapistore.MAPIStore(config['ocsmanager']['main']['mapistore_root'])
SystemError: error in mapistore_init
Removing PID file /var/run/ocsmanager.pid
My /etc/ocsmanager/ocsmanager.conf is the installed by make scripts with the only change of the location of mapistore:
mapistore_root = /usr/local/samba/private
mapistore_data = /usr/local/samba/private/mapistore

Resources