Syntax Error running bin/buildout on Plone 3.2.3 - plone

I get the folowing error when I run bin/buildout.
I´ve check this issue here on Plone.org and they say that it ´s not dangerous
but they do not say how to resolve it.
I want to skip this error in order to execute bin/buildout withouth errors, til now I´m updating my products manually. How can I solve this?
root#sevilla2:/var/plone/zinstance# bin/buildout
While:
Installing.
Getting section precompile.
Initializing section precompile.
Loading zc.buildout recipe entry plone.recipe.precompiler:default.
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 1509, in main
getattr(buildout, command)(args)
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 357, in install
[self[part]['recipe'] for part in install_parts]
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 888, in __getitem__
options._initialize()
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 969, in _initialize
recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
File "/var/plone/buildout-cache/eggs/zc.buildout-1.1.2-py2.4.egg/zc/buildout/buildout.py", line 932, in _install_and_load
return pkg_resources.load_entry_point(
File "/var/plone/buildout-cache/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py", line 277, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/var/plone/buildout-cache/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py", line 2180, in load_entry_point
return ep.load()
File "/var/plone/buildout-cache/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py", line 1913, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/var/plone/buildout-cache/eggs/plone.recipe.precompiler-0.6-py2.4.egg/plone/recipe/precompiler/__init__.py", line 7, in ?
from pythongettext.msgfmt import Msgfmt
File "/var/plone/buildout-cache/eggs/python_gettext-2.1-py2.4.egg/pythongettext/msgfmt.py", line 265
except Exception as msg:
^
SyntaxError: invalid syntax
I came from a migration of my site (successfully completed but builded without buildout)
Plone 3.2.3
CMF 2.1.2 Zope (Zope 2.10.7-final, python 2.4.5, linux2)
Python 2.4.5 [GCC 4.4.5]
PIL 1.1.6

You'll need to pin python-gettext to use a version before version 2.0. That version introduced syntax that requires Python 2.6 or newer (to make the package work on Python 3 as well).
In your buildout versions section, add:
python-gettext = 1.2

Related

Jupyter notebook ValueError: Unable to configure formatter 'console'

I installed Django in a virtual environment. However, the nb_conda gets an error in another virtual env.
I tried to reinstall the nb_conda, and the error message output is:
Enabling: nb_conda
- Writing config: /home/run/.miniconda3/envs/d2l/etc/jupyter
- Validating...
nb_conda 2.2.1 OK
Exception ignored in: <function Application.__del__ at 0x7fa35ad9c3a0>
Traceback (most recent call last):
File "/home/run/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 955, in __del__
File "/home/run/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 945, in close_handlers
File "/home/run/.local/lib/python3.8/site-packages/traitlets/traitlets.py", line 683, in __get__
File "/home/run/.local/lib/python3.8/site-packages/traitlets/traitlets.py", line 657, in get
File "/home/run/.local/lib/python3.8/site-packages/traitlets/traitlets.py", line 1428, in _notify_observers
File "/home/run/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 273, in _observe_logging_default
File "/home/run/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 278, in _configure_logging
File "/home/run/.miniconda3/envs/d2l/lib/python3.8/logging/config.py", line 808, in dictConfig
File "/home/run/.miniconda3/envs/d2l/lib/python3.8/logging/config.py", line 545, in configure
ValueError: Unable to configure formatter 'console'
Apparently this is a traitlets defect:
https://github.com/ipython/traitlets/issues/722
That has been solved using patch 727
https://github.com/ipython/traitlets/pull/727
So updating traitlets may solved the issue
It did for I when trying to enbale jupytext:
jupyter serverextension enable jupytext
was showing the same error, doing
mamba/conda update traitlets solved the issue by updating traitlets from 5.2 to 5.3

Read the Docs with nbsphinx

I created my own docs for Read the Docs. See my repository
Some of my docs files are jupyter notebook so I used nbshpinx for it.
In my computer I installed all the dependencies and it works great when I use make html.
However, Read the docs throws the error:
Running Sphinx v1.8.5
loading translations [en]... done
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 472, in load_extension
mod = __import__(extname, None, None, ['setup'])
ModuleNotFoundError: No module named 'nbsphinx'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 303, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 228, in __init__
self.setup_extension(extension)
File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 449, in setup_extension
self.registry.load_extension(self, extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 475, in load_extension
raise ExtensionError(__('Could not import extension %s') % extname, err)
sphinx.errors.ExtensionError: Could not import extension nbsphinx (exception: No module named 'nbsphinx')
Extension error:
Could not import extension nbsphinx (exception: No module named 'nbsphinx')
Following this tutorial I created two yml files and the error changed to:
Error
Problem in your project's configuration. Invalid "conda.environment": environment not found
Solved it!
I followed this tutorial
I added in readthedocs.yml:
python:
version: 3
install:
- requirements: docs/requirements.txt
system_packages: true
And then in docs/requirements.txt:
ipykernel
nbsphinx
If questions you can always check the repository where I do it.

DistributionNotFound when trying to install ZRS

I have a site with Plone 4.2.5 in which I want to install ZRS.
I added the [zrs] extra to the zeoserver part:
[zeoserver]
recipe = plone.recipe.zeoserver[zrs]
I also pinned the right versions of the recipes and packages involved:
[versions]
plone.recipe.zeoserver = 1.2.8
plone.recipe.zope2instance = 4.2.18
Twisted = 15.4.0
zc.zrs = 2.4.4
But, when I run buildout, I get the following error:
$ bin/buildout
...
While:
Installing.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/plone/my.project/eggs/zc.buildout-2.4.3-py2.7.egg/zc/buildout/buildout.py", line 1992, in main
getattr(buildout, command)(args)
File "/home/plone/my.project/eggs/zc.buildout-2.4.3-py2.7.egg/zc/buildout/buildout.py", line 565, in install
self._compute_part_signatures(install_parts)
File "/home/plone/my.project/eggs/zc.buildout-2.4.3-py2.7.egg/zc/buildout/buildout.py", line 810, in _compute_part_signatures
sig = _dists_sig(pkg_resources.working_set.resolve([req]))
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 839, in resolve
raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'zc.zrs' distribution was not found and is required by plone.recipe.zeoserver
The exact same thing runs fine in Plone 4.3.
I'm using the following versions also:
[versions]
setuptools = 18.3.2
zc.buildout = 2.4.3
Any hint?
You need to add "plone.recipe.zeoserver[zrs]" to your eggs section.
See https://github.com/kitconcept/buildout.zrs for an example of a working master/slave setup.

zc.buildout 2.0.0 release somehow ends up breaking Plone buildouts

I am trying to run old Plone 3.3 buildout.cfg. In [versions] I pin down buildout as the following:
cat buildout.cfg|grep -i zc.buildout
zc.buildout = 1.4.3
However, for some reason bootstrap.py generated bin/buildout ends up using the latest 2.0.0 release:
cat bin/buildout|grep -i zc.buildout
'/srv/plone/x/eggs/zc.buildout-2.0.0-py2.4.egg',
Which fails when trying to run bin/buildout:
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/tmp/tmpjc_Zhu/zc.buildout-2.0.0-py2.4.egg/zc/buildout/buildout.py", line 1808, in main
File "/tmp/tmpjc_Zhu/zc.buildout-2.0.0-py2.4.egg/zc/buildout/buildout.py", line 455, in install
File "/tmp/tmpjc_Zhu/zc.buildout-2.0.0-py2.4.egg/zc/buildout/buildout.py", line 888, in _maybe_upgrade
File "/tmp/tmpjc_Zhu/zc.buildout-2.0.0-py2.4.egg/zc/buildout/easy_install.py", line 759, in install
File "/tmp/tmpjc_Zhu/zc.buildout-2.0.0-py2.4.egg/zc/buildout/easy_install.py", line 578, in install
TypeError: get_dist() takes exactly 4 arguments (3 given)
*********************************************
Overwriting versions.cfg
How to make buildout to bootstrap itself as 1.4.3 (compatible version)?
This concerns only fresh runs of this buildout.cfg. On my old system which uses zc.buildout 1.4.3 already I cannot repeat the problem.
Looks like you need to use this bootstrap.py:
http://downloads.buildout.org/1/bootstrap.py
This one is not good:
http://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/bootstrap.py
More details here:
https://github.com/miohtama/senorita.plonetool/commit/75f54c818801e9eeb10c38962e5ccc58f8b2f031

plone Assertion error in themes

Iam new to Plone. I installed Plone 4 and i have gone through http://noenieto.com/blog/theming-plone-4 and created theme product.
When i run ./bin/buildout,
iam getting the error as
Develop: '/usr/local/Plone/zinstance/src/plonetheme.hanging'
error in plonetheme.hanging setup command: Distribution contains no modules or packages for namespace package 'plonetheme'
While:
Installing.
Processing develop directory '/usr/local/Plone/zinstance/src/plonetheme.hanging'.
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 1683, in main
getattr(buildout, command)(args)
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 417, in install
installed_develop_eggs = self._develop()
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 657, in _develop
zc.buildout.easy_install.develop(setup, dest)
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/easy_install.py", line 895, in develop
*args) == 0
AssertionError
Can anyone help me to rectify this error?
Create a module or package for namespace package 'plonetheme', e.g.:
mkdir -p src/plonetheme.hanging/plonetheme/hanging
touch src/plonetheme.hanging/plonetheme/__init__.py
touch src/plonetheme.hanging/plonetheme/hanging/__init__.py
src/plonetheme.hanging/plonetheme/__init__.py should contain something like:
from pkg_resources import declare_namespace
declare_namespace(__name__)

Resources