I'm using the Plone API to create objects on an (standalone) instance of Plone 5.1 (using the standard installer). In my script to create the objects, I need to add a datetime to the "effective" property ('Publication Date') in the object to be created. In order to do so, I needed to install the datetime module, which I did via pip in the /bin folder. That went all well and good. However, when I ran the code, I got an error message.
Here are the import statements in my python script:
from bs4 import BeautifulSoup
import os, json
from datetime import datetime
from plone import api
from plone.app.textfield.value import RichTextValue
... thereafter, I set the effective field to datetime.now() or whatever the input data requires.
This is what I get when I run the code...
c@lancer:/opt/plone/zinstance/bin$ sudo -u plone_daemon ./instance --object-path="/test" run ./TexAG_Uploader.py
Traceback (most recent call last):
File "/opt/plone/zinstance/parts/instance/bin/interpreter", line 293, in
File "", line 1, in
File "/opt/plone/buildout-cache/eggs/Zope2-2.13.27-py2.7.egg/Zope2/init.py", line 60, in
from Zope2.Startup.run import configure
File "/opt/plone/buildout-cache/eggs/Zope2-2.13.27-py2.7.egg/Zope2/Startup/init.py", line 27, in
from zope.event import notify
ImportError: No module named event
I would have thought that import plone.app.event would have fixed this problem, but it didn't. Does anyone know what I need to import/install/copy to fix this problem? Obviously, I'm missing a module called event, but which code has that particular event module? I just need to know what to import.