Question: Install Problems On Os X With Python From Macports
0
gravatar for James Casbon
10.2 years ago by
James Casbon370
James Casbon370 wrote:
Hi Everyone, 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. 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. How can I safely add something to galaxy's pythonpath and ensure it is not removed? thanks, James
galaxy • 1.1k views
ADD COMMENTlink modified 10.2 years ago • written 10.2 years ago by James Casbon370
0
gravatar for Nate Coraor
10.2 years ago by
Nate Coraor3.2k
United States
Nate Coraor3.2k wrote:
Hi James, Thanks! Good to know. 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: -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. 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.). --nate
ADD COMMENTlink written 10.2 years ago by Nate Coraor3.2k
0
gravatar for James Casbon
10.2 years ago by
James Casbon370
James Casbon370 wrote:
Hi Nate, Your fix works for the scramble fine, but not for the run.sh which now fails. On removing the -ES from run.sh, I get an error importing simplejson (see below). simplejson.egg is in the eggs/py2.5-noplatform dir so I dont' see why it doesn't pick this up if it manages to pick up WebHelpers. Traceback (most recent call last): File "./scripts/paster.py", line 26, in <module> command.run() File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteScript -1.3.6-py2.5.egg/paste/script/command.py", line 78, in run File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteScript -1.3.6-py2.5.egg/paste/script/command.py", line 117, in invoke File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteScript -1.3.6-py2.5.egg/paste/script/command.py", line 212, in run File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteScript -1.3.6-py2.5.egg/paste/script/serve.py", line 227, in command File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteScript -1.3.6-py2.5.egg/paste/script/serve.py", line 250, in loadapp File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 193, in loadapp File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 213, in loadobj File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 237, in loadcontext File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 267, in _loadconfig File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 397, in get_context File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 439, in _context_from_explicit File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/PasteDeploy -1.3.1-py2.5.egg/paste/deploy/loadwsgi.py", line 18, in import_string File "/Users/james/Src/galaxy_dist/lib/pkg_resources.py", line 1912, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/Users/james/Src/galaxy_dist/lib/galaxy/web/__init__.py", line 5, in <module> from framework import expose, json, require_login, url_for, error, form, FormBuilder File "/Users/james/Src/galaxy_dist/lib/galaxy/web/framework/__init__.py", line 17, in <module> import webhelpers File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/WebHelpers- 0.2-py2.5.egg/webhelpers/__init__.py", line 1, in <module> File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/WebHelpers- 0.2-py2.5.egg/webhelpers/rails/__init__.py", line 7, in <module> File "/Users/james/Src/galaxy_dist/eggs/py2.5-noplatform/WebHelpers- 0.2-py2.5.egg/webhelpers/rails/scriptaculous.py", line 16, in <module> ImportError: No module named simplejson 2008/9/12 Nate Coraor <nate@bx.psu.edu>:
ADD COMMENTlink written 10.2 years ago by James Casbon370
The problem is this: _hashlib.so and zlib.so live in site-packages because macports bundles them separately. Since you do python -S these cannot be seen. The quick fix was to copy these files from site-packages into the python dir, which I will probably forget about when I upgrade ;) This raises the question of why you are being so protective over your python path? Presumbaly this was discussed before. thanks, James 2008/9/15 James Casbon <casbon@gmail.com>:
ADD REPLYlink written 10.2 years ago by James Casbon370
Hi James, Is this to say that it resolved your problem in the message below (importing simplejson)? The reason for -ES: site or PYTHONPATH installed dependencies often conflict with those dependencies provided with Galaxy. Since setuptools doesn't currently offer a method to continue trying the search path when adding dependencies, conflicting versions in the path almost always cause problems. For example, if you had Cheetah 2.x in your PYTHONPATH or site- installed and it happened to be found before ours, loading would fail, since setuptools would see the wrong version and never continue down the path to find the correct version. --nate
ADD REPLYlink written 10.2 years ago by Nate Coraor3.2k
0
gravatar for James Casbon
10.2 years ago by
James Casbon370
James Casbon370 wrote:
2008/9/15 Nate Coraor <nate@bx.psu.edu>: Yes. I think this is a MacPorts issue. If python -S doesn't get you python, it's their problem, right? The joys of setuptools! Thanks for taking the time to help. Now I have it up and running I hope to integrate some tools. I love the work you have done with the workflow interface. cheers, James
ADD COMMENTlink written 10.2 years ago by James Casbon370
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 182 users visited in the last hour