I guess this is a python path problem (on FreeBSD 8.1).
Im trying to convert a Data.fs to Postgresql using zodbconvert. Ive downloaded RelStorage-1.5.0b2 and is running:
/usr/local/Plone/Python-2.6/bin/python zodbconvert.py fstodb.conf
, to use the version that Plone is running with.
The error I get:
Traceback (most recent call last):
File "zodbconvert.py", line 22, in <module>
from persistent.TimeStamp import TimeStamp
ImportError: No module named persistent.TimeStamp
Versions:
- Plone 4.0.5 (python 2.6)
- Postgresql 9.0.3
- FreeBSD 8.1
- python26-2.6.6_1
- python27-2.7.1_1
PS by default "python --version" is 2.7.1
Thanks. Nikolaj G.
If you are using
buildout
(I do hope you are) the easiest way to get all thezodbconvert
dependencies properly included in the python path is to havebuildout
create the script for you:Buildout then will create a new
bin/zodbconvert
script for you that includes all the buildout eggs insys.path
.Alternatively, you can create a generic python script runner that includes all eggs in your buildout and can run arbitrary scripts; you can use this instead of the bare-bones python interpreter to run arbitrary python scripts with all the buildout eggs in
sys.path
:The
bin/zopepy
script can then be use to run arbitrary python scripts with all your buildout eggs already insys.path
, sobin/zopepy zodbconvert.py fstodb.conf
should work.Note that the Plone unified installer already comes with the
zopepy
part included, and my choice of partname for this script was deliberately using the same name.If you are not using
buildout
(and with Plone 4, that's not a good idea on the whole), you can also list the required packages (ZODB3, zope.interface, RelStorage, psycopg2) in yourPYTHONPATH
environment variable.