Fwd: Install problems on OS X with python from macports
Oops, missed the mailing list on this reply... ---------- Forwarded message ---------- From: James Casbon <casbon@gmail.com> Date: 2008/9/12 Subject: Re: [galaxy-user] Install problems on OS X with python from macports To: Nate Coraor <nate@bx.psu.edu> 2008/9/12 Nate Coraor <nate@bx.psu.edu>:
Hi James,
James Casbon wrote:
I'm trying to do a local install of Galaxy. My python version is from MacPorts. I realize that you recommend using MacPython, but since all the dev environment I have uses MacPorts, I thought I'd give it a go. BTW, it does work with the shipped python 2.5 with OS X.
Thanks! Good to know.
The problem I have is that the egg downloading part (scramble.py, etc.) seems to monkey with the pythonpath such that _hashlib cannot be imported. I tried to track what happens, but it is not obvious where and why the path is being changed.
I'm not sure what's trying to import _hashlib... but what's stranger is that it should be part of the base python install, and nothing we do affects the base install. We do start Galaxy with these flags:
It's the egg downloader doing md5s on the files. I think there are two ways hashlib can work, and I think the macports way is to use the _hashlib c implementation, which goes missing from the path. This is probably because MacPorts choose to split out hashlib from the base install.
-E Ignore environment variables like PYTHONPATH and PYTHONHOME that modify the behavior of the interpreter.
-S Disable the import of the module site and the site-dependent manipulations of sys.path that it entails.
This is so we can limit conflicts between our provided dependencies, and any you may have installed locally.
If you start the interactive interpreter, are you able to import _hashlib? How about with -E and/or -S? Any output you can provide from where it fails (I assume in scramble.py?) would be helpful.
I can get hashlib from the interactive shell. Is there a way to get a shell with the galaxy environment? Here is the traceback. If you read hashlib, it tries to import _hashlib and if that fails and so it tries to get _md5. The MacPorts python should have _hashlib but not _md5 (as below). _hashlib cannot be found with the path for some reason. Traceback (most recent call last): File "scramble.py", line 11, in <module> use_setuptools( download_delay=8, to_dir=scramble_lib ) File "/Users/james/Src/galaxy_dist/scripts/scramble/build/py2.5-macosx-10.3-i386-ucs2/Cheetah/ez_setup.py", line 91, in use_setuptools return do_download() File "/Users/james/Src/galaxy_dist/scripts/scramble/build/py2.5-macosx-10.3-i386-ucs2/Cheetah/ez_setup.py", line 85, in do_download egg = download_setuptools(version, download_base, to_dir, download_delay) File "/Users/james/Src/galaxy_dist/scripts/scramble/build/py2.5-macosx-10.3-i386-ucs2/Cheetah/ez_setup.py", line 120, in download_setuptools import urllib2, shutil File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 91, in <module> import hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 133, in <module> md5 = __get_builtin_constructor('md5') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5
How can I safely add something to galaxy's pythonpath and ensure it is not removed?
Remove -E from run.sh, if necessary, but this may cause other problems. Tools do run without these flags so they can find other site-installed dependencies (such as numpy, etc.).
OK I will try these flags out and see what happens. Thanks for the quick reply, James
participants (1)
-
James Casbon