Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#16400 closed submission (fixed)

PyXG: Python XGrid interface (Python 2.5)

Reported by: beatrupp (Beat Rupp) Owned by: nerdling (Jeremy Lavergne)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc: der_loewe@…
Port: py25-pyxg

Description

New port. Works for me on Leopard.

Attachments (3)

Portfile (703 bytes) - added by beatrupp (Beat Rupp) 16 years ago.
Portfile.2 (1.0 KB) - added by nerdling (Jeremy Lavergne) 15 years ago.
added different dependency for leopard, removed seemingly bogus maintainer
Portfile.3 (1.0 KB) - added by nerdling (Jeremy Lavergne) 15 years ago.
changed darwin depend to py25-pyobjc2-cocoa

Download all attachments as: .zip

Change History (46)

Changed 16 years ago by beatrupp (Beat Rupp)

Attachment: Portfile added

comment:1 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Port: py25-pyxg added

Thanks for the port!

Can't commit this until #16017 is fixed.

comment:3 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Actually, nevermind. The difference between py-pyxg and py25-pyxg was that in py25-pyxg you changed the dependency from pyobjc to pyobjc2, which has different dependencies, one of which ran into #16017.

I committed py25-pyxg depending on py25-pyobjc, not py25-pyobjc2, because pyobjc2 requires Leopard which I do not have on this machine. If there is a reason why py25-pyxg needs to depend on pyobjc2 while py24-pyxg can depend on pyobjc, please let me know.

comment:4 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Committed py25-pyxg in r39888.

comment:5 Changed 15 years ago by der_loewe@…

Cc: der_loewe@… added

Cc Me!

comment:6 in reply to:  description Changed 15 years ago by der_loewe@…

Replying to beatrupp@…:

New port. Works for me on Leopard.

Hello, and: How does it work. It depends on the py-pyobjectc which is not for Leopard. Help! :-) Marcus

comment:7 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: closedreopened

As originally submitted, the py25-pyxg port only worked on Leopard. I didn't have Leopard, so I committed a version that worked on Tiger, but apparently not on Leopard.

Perhaps we need to change the py25-pyxg port to depend on py25-pyobjc on Tiger and below and py25-pyobjc2 on Leopard and above.

I never received a response to my earlier question about whether these changes should also be made to the py-pyxg port. We should strive to keep the ports for the different Python versions as similar as possible.

comment:8 in reply to:  7 Changed 15 years ago by der_loewe@…

Sorry fot the late response, but is thee a possibility to get the first version for lepopard?

comment:9 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from ryandesign@… to macports-tickets@…
Status: reopenednew

I should let someone else own this ticket as I am not really a Python person.

Changed 15 years ago by nerdling (Jeremy Lavergne)

Attachment: Portfile.2 added

added different dependency for leopard, removed seemingly bogus maintainer

comment:10 Changed 15 years ago by nerdling (Jeremy Lavergne)

Version: 1.6.01.7.0

While I'm no python guy either, I believe this is easily solved by building darwin_X variants. The newly attached portfile built on my Leopard system.

comment:11 Changed 15 years ago by nerdling (Jeremy Lavergne)

Owner: changed from macports-tickets@… to snc@…
Status: newassigned

Does the new portfile work for you? I'll commit if you approve.

comment:12 in reply to:  11 Changed 15 years ago by der_loewe@…

Replying to snc@…:

Does the new portfile work for you? I'll commit if you approve.

Sorry for nor having responded yet. In fact I haven't figured out how to use it (downloaded it, tried to run it from a local file structure and more, but always ran in either an error or the old version) but didn't want to annoy you with my shortcomings and wanted to figure it out myself. So I really can't answer the question (yet). Any tip how to make it work?

comment:13 Changed 15 years ago by nerdling (Jeremy Lavergne)

There are instructions up for creating a local repository. This is as permanent as you want to keep it.

Another option — I've not tried but makes sense — is to place the Portfile into ${prefix}/var/macports/sources/rysnc.macports.org/release/ports/python/pyxg/ and running sudo portindex inside the ${prefix}/var/macports/sources/rysnc.macports.org/release/ports/ directory. The next time you do a sync or selfupdate these changes will be automatically removed, so keep that in mind.

comment:14 Changed 15 years ago by der_loewe@…

Thanks a lot! That seemed to have done it. It build and installed without problems. :-)

comment:15 in reply to:  11 ; Changed 15 years ago by der_loewe@…

Replying to snc@…:

Does the new portfile work for you? I'll commit if you approve.

Sadly, after trying these days I can't seem to get xg.py to be used by python. When I try to install it ist says thee is "no module named Foundation", which possibly comes with pyobjc? Any suggestions?

comment:16 in reply to:  15 Changed 15 years ago by nerdling (Jeremy Lavergne)

Replying to der_loewe@…:

Any suggestions?

It seems you need to require py25-pyobjc2-cocoa. I'm checking this presently.

Changed 15 years ago by nerdling (Jeremy Lavergne)

Attachment: Portfile.3 added

changed darwin depend to py25-pyobjc2-cocoa

comment:17 Changed 15 years ago by nerdling (Jeremy Lavergne)

After requiring the cocoa bindings, this compiled, installed, and loaded into python2.5.

Please check and let me know if everything is okay :-)

comment:18 in reply to:  17 Changed 15 years ago by der_loewe@…

Please check and let me know if everything is okay :-)

Oh my, py25-pyobjc-cocoa ist installed, but still I get the 'no module named Foundation'. Did I miss something to load it into python? Sorry for my ignorance.

comment:19 Changed 15 years ago by nerdling (Jeremy Lavergne)

Did you run /opt/local/bin/python25 -m xg?

comment:20 Changed 15 years ago by nerdling (Jeremy Lavergne)

I meant python2.5, my bad.

comment:21 in reply to:  20 Changed 15 years ago by der_loewe@…

That's what I got:

This module requires PyObjC.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/runpy.py", line 85, in run_module
    loader = get_loader(mod_name)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 456, in get_loader
    return find_loader(fullname)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 466, in find_loader
    for importer in iter_importers(fullname):
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/pkgutil.py", line 422, in iter_importers
    __import__(pkg)
  File "/opt/local/lib/python2.5/site-packages/xg.py", line 114, in <module>
    raise e
ImportError: No module named Foundation

:-(

comment:22 Changed 15 years ago by nerdling (Jeremy Lavergne)

That looks like you're using the system's python instead of MacPorts.

Can you run these commands (one inside the other, as they spawn an instance each time):

python2.5
help()
modules xg

It should show xg as being available — can you confirm it does?

quit
^D

comment:23 in reply to:  22 Changed 15 years ago by der_loewe@…

no dice... I tried that before, that's why I tried "python2.5 xg.py install" (in the directory where xg.py is located) but it led to

This module requires PyObjC.
Traceback (most recent call last):
  File "xg.py", line 114, in <module>
    raise e

hrmpf!

comment:24 Changed 15 years ago by nerdling (Jeremy Lavergne)

Alrighty. Time for me to find a python guru :-)

comment:25 Changed 15 years ago by mf2k (Frank Schima)

Have you done the following?

sudo port install python_select
sudo python_select python25

comment:26 in reply to:  25 Changed 15 years ago by der_loewe@…

Replying to macsforever2000@…:

Have you done the following?

sudo port install python_select
sudo python_select python25

Same: No module named Foundation. hrmpf

comment:27 Changed 15 years ago by mf2k (Frank Schima)

What does the following return?

python --version

and

port installed python25 py25-pyobjc2 py25-pyobjc2-cocoa

comment:28 Changed 15 years ago by der_loewe@…

This ist what it returns:

python --version
Python 2.5.2
port installed python25 py25-pyobjc2 py25-pyobjc2-cocoa
The following ports are currently installed:
  py25-pyobjc2 @2.0_0
  py25-pyobjc2 @2.0_1 (active)
  py25-pyobjc2-cocoa @2.0_1 (active)
  python25 @2.5.2_7+darwin_9
  python25 @2.5.4_0+darwin_9+macosx (active)

comment:29 Changed 15 years ago by nerdling (Jeremy Lavergne)

If python 2.5.4 is from macports then which python are you running?

What does this show: ls -l `which python`

comment:30 in reply to:  29 Changed 15 years ago by der_loewe@…

Replying to snc@…:

If python 2.5.4 is from macports then which python are you running?

What does this show: ls -l `which python`

That's the output: /Library/Frameworks/Python.framework/Versions/Current/bin/python -> python2.5

comment:31 Changed 15 years ago by nerdling (Jeremy Lavergne)

Okay, that means you're using the apple-provided python — which has no clue about the modules. You need to have python_select installed (it's a port) and set it to python25 instead of python25-apple.

Once it's done, you should see this for ls -l `which python`: /opt/local/bin/python -> /opt/local/bin/python2.5

comment:32 in reply to:  31 Changed 15 years ago by der_loewe@…

Once it's done, you should see this for ls -l `which python`: /opt/local/bin/python -> /opt/local/bin/python2.5

Nope, there seems to be something rotten in the state of python ... :

$ sudo python_select python25
Selecting version "python25" for python
$ ls -l `which python`
lrwxr-xr-x  1 root  admin  9  4 Mai  2008 /Library/Frameworks/Python.framework/Versions/Current/bin/python -> python2.5

comment:33 Changed 15 years ago by nerdling (Jeremy Lavergne)

Well, let's check something I assumed then. What does echo $PATH show?

comment:34 in reply to:  33 Changed 15 years ago by der_loewe@…

This here:

$ echo $PATH
/Users/fairefils/DarwinPorts/local-sources/python devel/py25-pyxg/files/PyXG-0.2.0:/Users/fairefils/DarwinPorts/local-sources:/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/texbin

comment:35 Changed 15 years ago by nerdling (Jeremy Lavergne)

Okay, there's your problem. The system python is found before the MacPorts python.

Can you change your path (probably defined in ~/.profile or ~/.bash_rc) so that MacPorts (/opt/local) comes before at least the System path for python (/Library/Frameworks/python…)?

comment:36 in reply to:  35 ; Changed 15 years ago by der_loewe@…

This:

##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
    PATH=$PATH:/usr/local/bin
    export PATH
fi
#
# Your previous .profile  (if any) is saved as .profile.mpsaved
# Setting the path for MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

# Setting standard editor
export EDITOR=/usr/bin/pico


export PATH=/Users/fairefils/DarwinPorts/local-sources:$PATH
export PATH=/Users/fairefils/DarwinPorts/local-sources/python\ devel/py25-pyxg/files/PyXG-0.2.0:$PATH

export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

# Setting PATH for MacPython 2.5
# The orginal version is saved in .profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH

still leads to that:

echo $PATH
/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/fairefils/DarwinPorts/local-sources/python devel/py25-pyxg/files/PyXG-0.2.0:/Users/fairefils/DarwinPorts/local-sources:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/texbin

comment:37 in reply to:  36 ; Changed 15 years ago by danielluke (Daniel J. Luke)

Replying to der_loewe@…:

> # Setting PATH for MacPython 2.5
> # The orginal version is saved in .profile.pysave
> PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
> export PATH

This part is what is causing problems for you.

comment:38 in reply to:  37 ; Changed 15 years ago by der_loewe@…

EUREKA! After commenting out the offending line it worked! Thanks a lot! Phew! Now on to using it :-) Thanks again!

comment:39 in reply to:  38 ; Changed 15 years ago by nerdling (Jeremy Lavergne)

Replying to der_loewe@…:

Now on to using it :-)

Is the latest portfile working for you?

comment:40 in reply to:  39 Changed 15 years ago by der_loewe@…

Replying to snc@…:

Replying to der_loewe@…:

Now on to using it :-)

Is the latest portfile working for you?

Yep, works fine, thanks!

comment:41 Changed 15 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: assignedclosed

committed, r47037.

comment:42 Changed 15 years ago by jmroot (Joshua Root)

Type: enhancementsubmission

comment:43 Changed 15 years ago by (none)

Milestone: Port Submissions

Milestone Port Submissions deleted

Note: See TracTickets for help on using tickets.