Error after adding plone.app.dexterity to Plone 4.3 buildout - plone

I've used https://github.com/plone/plonedev.vagrant to set up a Plone 4.3 development environment on Windows. I've been trying to add Dexterity support to my installation, but have run into problems.
The steps I have taken are as follows:
Added zopeskel.dexterity and plone.app.dexterity [relations, grok] to the [eggs] section of my buildout.cfg
Added ZopeSkel <= 2.99 to the [versions] section of buildout.cfg
I re-run buildout and try to start the server in foreground mode, but get this traceback:
vagrant#precise32:~$ ./runbin.sh plonectl fg
instance: Traceback (most recent call last):
File "/home/vagrant/Plone/zinstance/bin/instance", line 290, in <module>
import plone.recipe.zope2instance.ctl
File "/home/vagrant/Plone/buildout-cache/eggs/plone.recipe.zope2instance-4.2.9-py2.7.egg/plone/recipe/__init__.py", line 1, in <module>
__import__('pkg_resources').declare_namespace(__name__)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 704, in subscribe
callback(dist)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2262, in activate
map(declare_namespace, self._get_metadata('namespace_packages.txt'))
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1847, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1817, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
ImportError: No module named script.templates
EDIT: I forgot to mention that buildout.cfg extends base.cfg, which contains the following:
[zopeskel]
# installs paster and Zopeskel
recipe = zc.recipe.egg
eggs =
ZopeSkel
Paste
PasteDeploy
PasteScript
${buildout:eggs}
I just tried explicitly adding PasteScript to the [eggs] section in buildout.cfg. After running buildout and attempting to start the server, I get a different traceback:
vagrant#precise32:~$ ./runbin.sh plonectl fg
instance: Traceback (most recent call last):
File "/home/vagrant/Plone/zinstance/bin/instance", line 291, in <module>
import plone.recipe.zope2instance.ctl
File "/home/vagrant/Plone/buildout-cache/eggs/plone.recipe.zope2instance-4.2.9-py2.7.egg/plone/recipe/__init__.py", line 1, in <module>
__import__('pkg_resources').declare_namespace(__name__)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 704, in subscribe
callback(dist)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2262, in activate
map(declare_namespace, self._get_metadata('namespace_packages.txt'))
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1847, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1817, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
File "/vagrant/plone/src/hello.world/PasteScript-1.7.5-py2.7.egg/paste/script/templates.py", line 9, in <module>
from paste.util.template import paste_script_template_renderer
ImportError: No module named util.template
Is this an issue with my Python path? I ran bin/zopepy then did import paste;print paste.__file__ and the output is:
/vagrant/plone/src/hello.world/PasteScript-1.7.5-py2.7.egg/paste/__init__.pyc
The Paste-1.7.5.1 egg directory does contain a paste/util/template.py file, but it looks like the interpreter can't find it.

You don't need to add Dexterity to Plone 4.3, it's already included:
http://plone.org/products/plone/releases/4.3

As documented on the zopeskel.dexterity PyPI page you need to include the PasteScript egg too; the traceback shows you it is missing:
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel < 3.0dev
Paste
PasteDeploy
PasteScript
zopeskel.dexterity
${buildout:eggs}

You may be doing a lot more work than you need to do. The plonedev.vagrant kit comes with zopeskel and zopeskel.dexterity preinstalled. Take a look at this transcript:
steve#lumpy:~/plonedev_vagrant$ vagrant up
[default] Importing base box 'precise32'...
...
steve#lumpy:~/plonedev_vagrant$ vagrant ssh
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-48-generic i686)
...
vagrant#vagrant-ubuntu-precise-32:~/Plone/zinstance$ ll bin
...
-rwxr-xr-x 1 vagrant vagrant 20023 Jul 16 01:41 zopeskel*
...
vagrant#vagrant-ubuntu-precise-32:~/Plone/zinstance$ cd src
...
vagrant#vagrant-ubuntu-precise-32:~/Plone/zinstance/src$ ~/Plone/zinstance/bin/zopeskel dexterity
dexterity: A Dexterity-based product
...
There's one bit of magic in this: due to the way the plonedev.vagrant kit symbolically links the src directory, you can't cd to it and use "../bin/zopeskel". That's why the "~/Plone/zinstance/bin/zopeskel dexterity" command is used.
We should either document that oddity or find a way to avoid it.

Related

Jupyter notebook cannot connect to the kernel

Jupyter notebook cannot connect to the kernel. I tried all the methods. I also reinstalled the computer system, reset the c drive, reinstalled anaconda, etc., but the same error was reported. I also changed the file path to Chinese, but Still fails, why? How to deal with it? The error is as follows: (the front part is the startup part, you can start to see it from the end, and the startup fails at the end)
[W 2022-12-11 19:23:10.102 LabApp] 'notebook_dir' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-12-11 19:23:10.102 LabApp] 'notebook_dir' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2022-12-11 19:23:10.111 LabApp] JupyterLab extension loaded from C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab
[I 2022-12-11 19:23:10.111 LabApp] JupyterLab application directory is C:\ProgramData\Anaconda3\share\jupyter\lab
[I 19:23:10.117 NotebookApp] Serving notebooks from local directory: C:\Users\dilim
[I 19:23:10.117 NotebookApp] Jupyter Notebook 6.4.12 is running at:
[I 19:23:10.117 NotebookApp] http://localhost:8888/?token=a2380da4760b3519ffd6c9e8bc15220404126807c6c4f538
[I 19:23:10.117 NotebookApp] or http://127.0.0.1:8888/?token=a2380da4760b3519ffd6c9e8bc15220404126807c6c4f538
[I 19:23:10.117 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:23:10.149 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/dilim/AppData/Roaming/jupyter/runtime/nbserver-7544-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=a2380da4760b3519ffd6c9e8bc15220404126807c6c4f538
or http://127.0.0.1:8888/?token=a2380da4760b3519ffd6c9e8bc15220404126807c6c4f538
[I 19:23:17.357 NotebookApp] Kernel started: 1474a909-0184-4cc9-995e-713135cea29f, name: python3
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 5, in <module>
from .connect import * # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 11, in <module>
import jupyter_client
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\__init__.py", line 8, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\channels.py", line 4, in <module>
import asyncio
File "C:\ProgramData\Anaconda3\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 23, in <module>
import socket
File "C:\ProgramData\Anaconda3\lib\socket.py", line 54, in <module>
import os, sys, io, selectors
File "C:\ProgramData\Anaconda3\lib\selectors.py", line 12, in <module>
import select
File "C:\Users\dilim\Desktop\chooseexce\select.py", line 3, in <module>
X = data=np.loadtxt("1.xlsx",delimiter=',',unpack=False)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 1338, in loadtxt
arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 999, in _read
arr = _load_from_filelike(
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 50: illegal multibyte sequence
[I 19:23:20.341 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\__init__.py", line 5, in <module>
from .connect import * # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\ipykernel\connect.py", line 11, in <module>
import jupyter_client
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\__init__.py", line 8, in <module>
from .asynchronous import AsyncKernelClient # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\asynchronous\__init__.py", line 1, in <module>
from .client import AsyncKernelClient # noqa
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\asynchronous\client.py", line 6, in <module>
from jupyter_client.channels import HBChannel
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_client\channels.py", line 4, in <module>
import asyncio
File "C:\ProgramData\Anaconda3\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 23, in <module>
import socket
File "C:\ProgramData\Anaconda3\lib\socket.py", line 54, in <module>
import os, sys, io, selectors
File "C:\ProgramData\Anaconda3\lib\selectors.py", line 12, in <module>
import select
File "C:\Users\dilim\Desktop\chooseexce\select.py", line 3, in <module>
X = data=np.loadtxt("1.xlsx",delimiter=',',unpack=False)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 1338, in loadtxt
arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\npyio.py", line 999, in _read
arr = _load_from_filelike(
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 50: illegal multibyte sequence

Apache Airflow on Ubuntu 20.04 not running after fresh install

I followed the steps from Running Airflow on Ubuntu 20.04 (TypeError: required field "type_ignores" missing from Module```), and received the following:
(airflow-uGvev7QO) root#testing2:/opt/airflow# airflow db init
DB: sqlite:////root/airflow/airflow.db
[2021-03-30 21:17:43,978] {db.py:674} INFO - Creating tables
/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy/orm/relationships.py:3454 SAWarning: relationship 'DagRun.serialized_dag' will copy column serialized_dag.dag_id to column dag_run.dag_id, which conflicts with relationship(s): 'TaskInstance.dag_run' (copies task_instance.dag_id to dag_run.dag_id), 'DagRun.task_instances' (copies task_instance.dag_id to dag_run.dag_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. The 'overlaps' parameter may be used to remove this warning.
/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy/orm/relationships.py:3454 SAWarning: relationship 'SerializedDagModel.dag_runs' will copy column serialized_dag.dag_id to column dag_run.dag_id, which conflicts with relationship(s): 'TaskInstance.dag_run' (copies task_instance.dag_id to dag_run.dag_id), 'DagRun.task_instances' (copies task_instance.dag_id to dag_run.dag_id). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. The 'overlaps' parameter may be used to remove this warning.
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/bin/airflow", line 8, in <module>
sys.exit(main())
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/__main__.py", line 40, in main
args.func(args)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/cli/cli_parser.py", line 48, in command
return func(*args, **kwargs)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/cli/commands/db_command.py", line 31, in initdb
db.initdb()
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/utils/db.py", line 549, in initdb
upgradedb()
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/utils/db.py", line 684, in upgradedb
command.upgrade(config, 'heads')
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/command.py", line 294, in upgrade
script.run_env()
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/base.py", line 490, in run_env
util.load_python_file(self.dir, "env.py")
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
module = load_module_py(module_id, path)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/util/compat.py", line 182, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/migrations/env.py", line 108, in <module>
run_migrations_online()
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/migrations/env.py", line 102, in run_migrations_online
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/runtime/environment.py", line 813, in run_migrations
self.get_context().run_migrations(**kw)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/runtime/migration.py", line 548, in run_migrations
for step in self._migrations_fn(heads, self):
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/command.py", line 283, in upgrade
return script._upgrade_revs(revision, rev)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/base.py", line 365, in _upgrade_revs
revs = list(revs)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/revision.py", line 916, in _iterate_revisions
uppers = util.dedupe_tuple(self.get_revisions(upper))
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/revision.py", line 457, in get_revisions
resolved_id, branch_label = self._resolve_revision_number(id_)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/revision.py", line 640, in _resolve_revision_number
self._revision_map
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/util/langhelpers.py", line 234, in __get__
obj.__dict__[self.__name__] = result = self.fget(obj)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/revision.py", line 156, in _revision_map
for revision in self._generator():
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/base.py", line 115, in _load_revisions
script = Script._from_filename(self, vers, file_)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/script/base.py", line 904, in _from_filename
module = util.load_python_file(dir_, filename)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 97, in load_python_file
module = load_module_py(module_id, path)
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/alembic/util/compat.py", line 182, in load_module_py
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/migrations/versions/2c6edca13270_resource_based_permissions.py", line 29, in <module>
from airflow.www.app import create_app
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/www/app.py", line 38, in <module>
from airflow.www.extensions.init_views import (
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/www/extensions/init_views.py", line 29, in <module>
from airflow.www.views import lazy_add_provider_discovered_options_to_connection_form
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/www/views.py", line 96, in <module>
from airflow.www import auth, utils as wwwutils
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/airflow/www/utils.py", line 27, in <module>
from flask_appbuilder.models.sqla.interface import SQLAInterface
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py", line 16, in <module>
from sqlalchemy_utils.types.uuid import UUIDType
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", line 1, in <module>
from .aggregates import aggregated # noqa
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
from .functions.orm import get_column_key
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in <module>
from .database import ( # noqa
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 11, in <module>
from .orm import quote
File "/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in <module>
from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/root/.local/share/virtualenvs/airflow-uGvev7QO/lib/python3.7/site-packages/sqlalchemy/orm/query.py)
(airflow-uGvev7QO) root#testing2:/opt/airflow#
Advice is welcome.
Thank you
I was able to reproduce the error and the reason seems to be the release of sqlalchemy 1.4 that introduces breaking changes. Airflow by default depends on the latest version of sqlalchemy, but cannot work with version 1.4. A workaround is to downgrade sqlalchem to a version < 1.4.0:
pipenv uninstall sqlalchemy
pipenv install 'sqlalchemy < 1.4.0'
When installing Airflow fresh:
pipenv install 'sqlalchemy < 1.4.0' apache-airflow
Please use below
pip install "apache-airflow[celery]==2.2.2" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.2/constraints-3.6.txt"
It will definitely work.

QT conflict between Anaconda and MacPort

I'm on OS X 10.10.4 with Macports and Anaconda (condo 3.15.1).
During the process of building the robotic simulator ARGoS,
https://github.com/ilpincy/argos3
we ran into runtime 'qt' issues running the ARGoS examples.
[FATAL] Can't load library "/usr/local/lib/argos3/libargos3plugin_simulator_epuck.dylib" even after trying to add extensions for shared library (dylib) and module library (so):
/usr/local/lib/argos3/libargos3plugin_simulator_epuck.dylib: dlopen(/usr/local/lib/argos3/libargos3plugin_simulator_epuck.dylib, 1): Library not loaded: #rpath/./libQtOpenGL.4.dylib
I learned that cmake found 'qt' within Anaconda which had runtime problems.
-- Found Qt4: /Users/davidlaxer/anaconda/bin/qmake (found version "4.8.6")
Next, I installed qt4-mac:
sudo port install qt4-mac
---> Computing dependencies for qt4-mac
---> Fetching archive for qt4-mac
---> Attempting to fetch qt4-mac-4.8.7_0.darwin_14.x86_64.tbz2 from http://packages.macports.org/qt4-mac
---> Attempting to fetch qt4-mac-4.8.7_0.darwin_14.x86_64.tbz2.rmd160 from http://packages.macports.org/qt4-mac
---> Installing qt4-mac #4.8.7_0
---> Activating qt4-mac #4.8.7_0
NOTE: Qt database plugins for mysql55, postgresql91, and sqlite2 are NOT installed by this port; they are installed by qt4-mac-*-plugin instead.
---> Cleaning qt4-mac
---> Updating database of binaries
---> Scanning binaries for linking errors
---> No broken files found.
When I installed 'qt' with Macports, ipython qtconsole broke.
David-Laxers-MacBook-Pro:build_simulator davidlaxer$ ipython qtconsole
Traceback (most recent call last):
File "/Users/davidlaxer/anaconda/bin/ipython", line 6, in <module>
sys.exit(start_ipython())
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 573, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 321, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/core/application.py", line 369, in initialize
self.parse_command_line(argv)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 316, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 471, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 75, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/config/application.py", line 402, in initialize_subcommand
subapp = import_item(subapp)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/utils/importstring.py", line 42, in import_item
module = __import__(package, fromlist=[obj])
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/qt/console/qtconsoleapp.py", line 50, in <module>
from IPython.external.qt import QtCore, QtGui
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/external/qt.py", line 23, in <module>
QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/external/qt_loaders.py", line 277, in load_qt
result = loaders[api]()
File "/Users/davidlaxer/anaconda/lib/python2.7/site-packages/IPython/external/qt_loaders.py", line 184, in import_pyqt4
from PyQt4 import QtGui, QtCore, QtSvg
ImportError: dlopen(/Users/davidlaxer/anaconda/lib/python2.7/site-packages/PyQt4/QtGui.so, 2): Symbol not found: _iconv
Referenced from: /Users/davidlaxer/anaconda/lib//libxml2.2.dylib
Expected in: /opt/local/lib//libiconv.2.dylib
How is this supposed to work?

AttributeError: 'module' object has no attribute 'NoDefault'

Running paster on Plone UnifiedInstaller 4.2.5 I get the following errors. Any idea on the problem?
Traceback (most recent call last):
File "../bin/paster", line 382, in <module>
import paste.script.command
File "/var/plone/my.app/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/command.py", line 3, in <module>
import pkg_resources
File "/var/plone/my.app/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/var/plone/my.app/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 704, in subscribe
callback(dist)
File "/var/plone/my.app/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/var/plone/my.app/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2262, in activate
map(declare_namespace, self._get_metadata('namespace_packages.txt'))
File "/var/plone/my.app/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1847, in declare_namespace
_handle_ns(packageName, path_item)
File "/var/plone/my.app/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1817, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/var/plone/my.app/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
File "/var/plone/my.app/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
File "/var/plone/my.app/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
File "/var/plone/my.app/buildout-cache/eggs/PasteScript-1.7.5-py2.7.egg/paste/script/templates.py", line 145, in <module>
NoDefault = command.NoDefault
AttributeError: 'module' object has no attribute 'NoDefault'
My zopeskel section of base.cfg has the following entries
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel <= 2.99
zopeskel.dexterity == 1.4.1
zopeskel.diazotheme
Paste
PasteDeploy
PasteScript
${buildout:eggs}
I can run zopeskel and create a dexterity package but I can not add custom content types because of this paster issue. My dexterity package is already installed in buildout.cfg

Zopeskel ImportError: cannot import name BasicNamespace

I have zopeskel 2.21.2 in my virtualenv python and it works fine. Meanwhile, I also have the same version of zopeskel in my Plone buildout (located in ~/.buildout/eggs). However, it does not work. Running zopeskel --list throws the following error:
ImportError: cannot import name BasicNamespace
An advice from this link says to remove the egg. I have removed the egg as well as the cached package in ~/.buildout/cache/dist/ and ran buildout again. However, the problem persists. The funny thing is that the paster script in the same buildout is working.
My zopeskel section in buildout.cfg looks like below:
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel
Paste
PasteDeploy
PasteScript
zopeskel.dexterity
${instance:eggs}
Some package versions used in my buildout:
'/home/user/.buildout/eggs/Paste-1.7.5.1-py2.6.egg',
'/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg',
'/home/user/.buildout/eggs/PasteDeploy-1.3.4-py2.6.egg',
'/home/user/.buildout/eggs/PasteScript-1.7.4.2-py2.6.egg',
Full traceback:
[user#rizal myplone.site]$ ./bin/zopeskel --list
Traceback (most recent call last):
File "./bin/zopeskel", line 346, in <module>
import zopeskel.zopeskel_script
File "/home/user/.buildout/eggs/ZopeSkel-2.21.2-py2.6.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
File "/home/user/.buildout/eggs/ZopeSkel-2.21.2-py2.6.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
File "/home/user/.buildout/eggs/ZopeSkel-2.21.2-py2.6.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
File "/home/user/.buildout/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/templates.py", line 6, in <module>
import copydir
File "/home/user/.buildout/eggs/PasteScript-1.7.4.2-py2.6.egg/paste/script/copydir.py", line 4, in <module>
import pkg_resources
File "/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg/pkg_resources.py", line 2727, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg/pkg_resources.py", line 700, in subscribe
callback(dist)
File "/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg/pkg_resources.py", line 2727, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg/pkg_resources.py", line 2230, in activate
map(declare_namespace, self._get_metadata('namespace_packages.txt'))
File "/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg/pkg_resources.py", line 1827, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/user/.buildout/eggs/distribute-0.6.24-py2.6.egg/pkg_resources.py", line 1797, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/usr/lib/python2.6/pkgutil.py", line 238, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/user/.buildout/eggs/ZopeSkel-2.21.2-py2.6.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
ImportError: cannot import name BasicNamespace
What could be wrong?
This usually happens you have ZopeSkel / Paster installed both locally (buildout) and in the global Python installation. Due to failures in Python process of managing site packages you end up with an incompatible combiation.
Solution:
http://docs.plone.org/manage/troubleshooting/exceptions.html#from-zopeskel-basic-namespace-import-basicnamespace

Resources