Plone upgrade 3.3.5 to Plone 4.1.2 - upgrade

I am trying to upgrade a Plone site from 3.3.5 to Plone 4.1.2. I installed a clean copy of 4.1.2 and tried to copy the Data.fs to 4.1.2. I had to delete my members folder as it was of the type LargePloneFolder which is not supported anymore. On a 32 bit virtual machine, this worked just fine. However, I ran into errors on my 64bit virtual machine. Copying the Data.fs from Plone 3.3.5 (same machine) or the Data.fs from Plone 4.1.2 on the 32 bit machine resulted in the same error.
Stack Trace:
Iz#bigBox# bin/zeoserver fg
/usr/local/Plone/zeocluster/parts/zeoserver/bin/runzeo
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZEO/runzeo.py", line 405, in <module>
main()
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZEO/runzeo.py", line 402, in main
s.main()
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZEO/runzeo.py", line 158, in main
self.open_storages()
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZEO/runzeo.py", line 207, in open_storages
self.storages[opener.name] = opener.open()
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZODB/config.py", line 177, in open
return FileStorage(config.path, **options)
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZODB/FileStorage/FileStorage.py", line 185, in __init__
read_only=read_only,
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZODB/FileStorage/FileStorage.py", line 1554, in read_index
h = fmt._read_data_header(pos)
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZODB/FileStorage/format.py", line 150, in _read_data_header
h = DataHeaderFromString(s)
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZODB/FileStorage/format.py", line 236, in DataHeaderFromString
return DataHeader(*struct.unpack(DATA_HDR, s))
File "/usr/local/Plone/buildout-cache/eggs/ZODB3-3.10.3-py2.6-linux-x86_64.egg/ZODB/FileStorage/format.py", line 246, in __init__
"Non-zero version length. Versions aren't supported.")
ValueError: Non-zero version length. Versions aren't supported.
Python Version: 2.6 shipped with Plone 4.1.2 Unified Installer
I tried to pack the db as well. using fsrecover.py on Plone 3.3.5 and using the graphics interface as well. But that does not help either. This is strange because I get absolutely no errors on my 32 bit installation and migration of Data.fs worked just fine.
I copy the db with the cp command preserving all the permissions with -p option which works fine on the 32 bit VM.

Pack your database and/or try to remove any old "ZODB Versions" in the Zope2 /Control_Panel inside your running Plone 3.3.x install before attempting a migration. Or try doing a ZEXP export of your entire Plone site and import it into a clean 3.3.5 install before attempting to do a 4.x migration. "Versions" (long-running transactions) are not supported in newer versions of ZODB and have been deprecated for at least a few years now.
See this thread:
https://mail.zope.org/pipermail/zodb-dev/2010-September/013620.html

Related

PyCUDA -- problems importing pycuda.driver

Windows 10
Python 3.8
CUDA 11.5
I've installed what I believe to be a matching pycuda from this file:
pycuda-2021.1+cuda115-cp38-cp38-win_amd64.whl
This simple example fails
import pycuda.driver as drv
drv.init()
print("Detected {} CUDA devices".format(drv.Device.count()))
With this error:
Traceback (most recent call last):
File "C:/University of Arizona/weeds/tests/cuda-summary.py", line 5, in <module>
import pycuda.driver as drv
File "C:\Users\evan\AppData\Local\Programs\Python\Python38\lib\site-packages\pycuda\driver.py", line 65, in <module>
from pycuda._driver import * # noqa
ImportError: DLL load failed while importing _driver: The specified procedure could not be found.
NVCC is in my path
Adding os.add_dll_directory(os.path.join(os.environ['CUDA_PATH'], 'bin')) has no effect
The script works just fine on my Jetson Nano
Any ideas on how to get past this? I've searched and tried several solutions.
It is quite strange, but updating the Nvidia display driver fixed the issue for me.
But in my case there was no issue on my PC with the same versions of Windows, Python, CUDA and PyCuda. The issue appeared on the different Windows 10 machine, when launching the exe, packaged by PyInstaller. So, updating the display driver was the fix for this machine.

Vpython not working after update

I'm using ubuntu 16.04 and python files that were using vpython that were working fine before now crash showing
from visual import *
ImportError: No module named visual.
I installed anaconda, still nothing. I launched jupyter notebook on the terminal, it opens on a new window in google chrome. I created a test.py file containing just
import vpython
and it prompts:
Traceback (most recent call last):
File "teste vpython.py", line 1, in <module>
import vpython
File "/home/user/anaconda2/lib/python2.7/site-
packages/vpython/__init__.py", line 10, in <module>
from .vpython import *
File "/home/user/anaconda2/lib/python2.7/site-
packages/vpython/vpython.py", line 507, in <module>
get_ipython().kernel.comm_manager.register_target('glow', GlowWidget)
AttributeError: 'NoneType' object has no attribute 'kernel'
I would appreciate if somebody could help me. I know there are similar tags, but I did as every answer I checked as suggested with no results.
Thank you.
I have Ubuntu 16.04 with Anaconda and Python 3.6. Just now I created another environment that contains Python 2.7. In that environment I did "pip install vpython --upgrade" and verified with "pip show vpython" that the version is indeed 7.0.3. I then executed "jupyter notebook" and demo programs ran fine.
I am puzzled by your comment that you created a test.py file, and by the line that says "File "teste vpython.py", line 1, in ". I would expect a file with the .ipynb extension, so something doesn't seem right.
I'll advertise that a better place to pose VPython questions is in the VPython forum at
https://groups.google.com/forum/?fromgroups&hl=en#!forum/vpython-users

Import error: libjpeg.so.7: cannot open shared object file: No such file or directory

I install the academic Enthought Cannopy on Redhat. When I type in
import _imaging
It print out the error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libjpeg.so.7: cannot open shared object file: No such file or directory
But on the Enthough website, it was said that the libjpeg has been included.
The Canopy's version is 1.1.0. The output of env in terminal is:
MANPATH=/opt/torque/man:/usr/NX/bin:/usr/kerberos/bin:/usr/java/latest/bin:/share/apps/anaconda/bin:/usr/local/bin:/bin:/usr/bin:/opt/bio/ncbi/bin:/opt/bio/mpiblast/bin/:/opt/bio/hmmer/bin:/opt/bio/EMBOSS/bin:/opt/bio/clustalw/bin:/opt/bio/tcoffee/bin:/opt/bio/phylip/exe:/opt/bio/mrbayes:/opt/bio/fasta:/opt/bio/glimmer/bin://opt/bio/glimmer/scripts:/opt/bio/gromacs/bin:/opt/bio/gmap/bin:/opt/bio/tigr/bin:/opt/bio/autodocksuite/bin:/opt/ganglia/bin:/opt/ganglia/sbin:/opt/openmpi/bin/:/opt/maui/bin:/opt/torque/bin:/opt/torque/sbin
BIOROLL=/opt/bio
TERM=xterm-256color
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=141.211.38.9 36340 22
PHENIX_INSTALLER_DATE=300920111225
ROCKSROOT=/opt/rocks/share/devel
PHENIX_MVERSION=redhat-e5.4
PHENIX=/share/apps/phenix-1.7.2-869
SSH_TTY=/dev/pts/8
ANT_HOME=/opt/rocks
USER=xqding
PHENIX_MTYPE=intel-linux-2.6-x86_64
LS_COLORS=
ROCKS_ROOT=/opt/rocks
VIRTUAL_ENV=/home/xq/Enthought/Canopy_64bit/User
MAIL=/var/spool/mail/xq
PATH=/home/xqding/Enthought/Canopy_64bit/User/bin:/home/xq/Enthought/Canopy_64bit/User/bin:/home/xq/apps/bin:/share/apps/phenix-1.7.2-869/build/intel-linux-2.6-x86_64/bin:/library/yzhang/bin/HMMER:/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:/mnt/sysimage/usr/X11R6/bin:/tmp/updates/rocks/bin:/tmp/updates/usr/sbin:/tmp/updates/sbin:/tmp/updates/usr/bin:/opt/rocks/bin:/opt/rocks/sbin:/opt/sun-ct/bin:/home/xq/apps/cd-hit-v4.6.1-2012-08-27:/home/xq/apps/samtools-0.1.19:/library/blast/bin:/home/xq/apps/cd-hit-v4.6-2012-04-25:/home/xq/apps/dssp-2.2.1:/home/xqding/apps/dssp-ver2hor:/home/xq/bin:/home/xq/apps/python/2.7/bin
NXDIR=/usr/NX
INPUTRC=/etc/inputrc
PWD=/home/xqding/appsrc
JAVA_HOME=/usr/java/latest
EDITOR=emacsclient
LANG=en_US.iso885915
PHENIX_USE_MTYPE=intel-linux-2.6-x86_64
PHENIX_ENVIRONMENT=1
BLASTDB=/home/xqding/bio/ncbi/db
PHENIX_VERSION=1.7.2
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
PHENIX_RELEASE_TAG=869
SHLVL=1
HOME=/home/xq
ROLLSROOT=/opt/rocks/share/devel/src/roll
LOGNAME=xqding
CVS_RSH=ssh
LESSOPEN=|/usr/bin/lesspipe.sh %s
BLASTMAT=/opt/bio/ncbi/data
G_BROKEN_FILENAMES=1
_=/usr/bin/env
I download the source code of libjpeg version 7 and install it on the Redhat computer. Then add the library directory to the export LD_LIBRARY_PATH=directory of libjpeg. Then the problem is solved. I appreciate the help I got from here. So I just add the solution.
It's possible that the libjpeg version installed with your RedHat is outdated (are you on RedHat 5?). Try and open the RedHat package manager and look for "jpeg". Installing a later version of the library might fix this issue.

Python Hello World in PyObjC on iPhone?

I installed the iphone-python package from Cydia, but the HelloPython app closes immediately when I run it from Springboard.
This may be a red herring, but I found the .py file in Terminal and tried to run it with python and got a python error:
$ python /private/var/stash/Applications.pwn/HelloPython.app/HelloPython.py
Traceback (most recent call last):
File "/private/var/stash/Applications.pwn/HelloPython.app/HelloPython.py", line 9, in <module>
import objc
File "/usr/lib/python2.5/objc/__init__.py", line 17, in <module>
_update()
File "/usr/lib/python2.5/objc/__init__.py", line 14, in _update
import _objc
ImportError: dlopen(/usr/lib/python2.5/lib-dynload/_objc.dylib, 2): Symbol not found: _OBJC_CLASS_$_Object
Referenced from: /usr/lib/python2.5/lib-dynload/_objc.dylib
Expected in: /usr/lib/libobjc.A.dylib
I'm running 4.3.3.
How can I get this app working, so I'll have a working example of PyObjC?
Well due to the changes in the way executables on the new ios run, the dynamic library has become corrupt. The mach-o will no longer run due to the upgraded objective-c so a workaround would be to compile pyobjc from source and run normaly. The only ptoblem with that is that the iphone's version of pyobjc is built for uikit so you would need to find saurik's (Jay Freeman) source code and compile it. I might do that for myself so ill post back with a deb file if i do.

Xcode Target Phase Python Script

I am trying to add a Python script to into my project to obtain the build and marketing numbers directly from Git.
I have created a new target phase and that runs a script as explained in:
http://yeahrightkeller.com/2008/10/19/xcode-run-script-build-phase-tip/
And I have written a Python script that parses the program Info.plist using
from Foundation import NSMutableDictionary
However the script fails while being compiled and reports the following error to the build results:
Running a custom build phase script: gitversion.py
Traceback (most recent call last):
File "/Users/jorge/Documents/Programming iPod/Pruebas/RowOrder/Scripts/gitversion.py", line 9, in <module>
from Foundation import NSMutableDictionary
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/Foundation/__init__.py", line 8, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/objc/__init__.py", line 26, in <module>
from _bridgesupport import *
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 9, in <module>
import pkg_resources
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 651, in <module>
class Environment(object):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 654, in Environment
def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 55, in get_supported_platform
plat = get_build_platform(); m = macosVersionString.match(plat)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 181, in get_build_platform
plat = get_platform()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/util.py", line 97, in get_platform
cfgvars = get_config_vars()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/sysconfig.py", line 525, in get_config_vars
func()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/sysconfig.py", line 408, in _init_posix
raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.5" but "10.6" during configure
Finished running custom build phase script: gitversion.py (exit status = 1)
Clearly, distutils has somehow hardcoded that it is compiled for version 10.6 (Snow Leopard, that is the one I am using), but the project has the MacOSX Deployment target set to 10.5.
If i try to set this variable in the project to 10.6, I then get:
ld: library not found for -lcrt1.10.6.o
Any ideas on how to solve this issue? Thanks in advance.
I have the same problem, and I wanted to keep the python version because handling the plist via NSMutableDictionary is much nicer than using regex on Info.plist.
Building on Maxence's answer, the solution was to strip the python code out of the Run Script build phase into a gitversion.py file:
#!/usr/bin/env python
import os
from Foundation import NSMutableDictionary
from subprocess import Popen, PIPE
p = Popen(
"/sw/bin/git rev-parse --short HEAD",
stdout=PIPE,
close_fds=True,
shell=True)
version = p.stdout.read()
print version
info = os.environ['INFOPLIST_FILE']
print info
plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info)
print plist
plist['revision'] = version[:-1]
plist.writeToFile_atomically_(info, 1)
Then replace the original Run Script with a shell script:
env MACOSX_DEPLOYMENT_TARGET=10.6 python gitversion.py
Be sure to remember to change the Shell setting to /bin/sh.
Apple distributes Python 2.5 and 2.6 with Snow Leopard (10.6) and both are built with a deployment target of 10.6. If you really do need to target your application for 10.5, you can't safely use the Apple-supplied Pythons on 10.6 to deploy on 10.5.
The easiest solution may be to download and install a Python 2.6 from python.org. That Python is targeted for 10.3+, so it will work on both 10.5 and 10.6. You'll probably also need to ensure that that Python is installed on all machines where your app will be deployed.
Another option might be to create a separate stand-alone helper app using py2app with the python.org 2.6 and deploy that along with your main app. Or create your whole app under py2app. In either case, the app would contain its own python framework interpreter and framework, independent of the system version.
EDIT: Based on your comment, I'm not sure I understand your problem. Since you are running on 10.6, it's not clear to me (1) why you have the deployment target set to 10.5 and (2) if you need to have the deployment set to 10.5. I'm going to guess that you had an existing Xcode project that was developed on 10.5 and then imported or upgraded from Xcode on 10.5 to Xcode on 10.6. If that is the case, then I think the only thing that should have been needed to be done is to change the Active SDK from 10.5 to 10.6 (in the overview) in the top of the project window. Doing just that and forcing a Clean All Targets should solve the crt library not found error; if not, there is something wrong with the project dependencies.
On the other hand, if you really do need to develop on 10.6 for 10.5, then it seems that your gitversion.py is introducing an inadvertent dependency on python 2.6 (as can be seen by the traceback), which is not part of 10.5. Unless you really need python 2.6 features, you should be able to eliminate that by using python 2.5 which Apple provides on both 10.5 and 10.6. In that case, perhaps all you need to do is to ensure that you invoke python in the build phase script with /usr/bin/python2.5 rather than just python.
For the purposes of this script, you can simply temporarily set the value of MACOSX_DEPLOYMENT_TARGET to 10.6. So your command would be:
env MACOSX_DEPLOYMENT_TARGET=10.6 gitversion.py
Here you can find ths SOLUTION:
http://marcocattai.posterous.com/xcode-project-version-number-using-gitsvn