Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25001 > unrolled thread

git_revision issues with scipy/numpy/matplotlib

Started byStephen Webb <sdavis.webb@gmail.com>
First post2012-07-06 23:47 -0600
Last post2012-07-07 09:57 -0600
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  git_revision issues with scipy/numpy/matplotlib Stephen Webb <sdavis.webb@gmail.com> - 2012-07-06 23:47 -0600
    Re: git_revision issues with scipy/numpy/matplotlib Hans Mulder <hansmu@xs4all.nl> - 2012-07-07 12:18 +0200
      Re: git_revision issues with scipy/numpy/matplotlib Ousmane Wilane <ousmane@wilane.org> - 2012-07-07 14:09 +0200
        Re: git_revision issues with scipy/numpy/matplotlib Hans Mulder <hansmu@xs4all.nl> - 2012-07-07 16:40 +0200
          Re: git_revision issues with scipy/numpy/matplotlib Stephen Webb <sdavis.webb@gmail.com> - 2012-07-07 09:57 -0600

#25001 — git_revision issues with scipy/numpy/matplotlib

FromStephen Webb <sdavis.webb@gmail.com>
Date2012-07-06 23:47 -0600
Subjectgit_revision issues with scipy/numpy/matplotlib
Message-ID<mailman.1882.1341640081.4697.python-list@python.org>
I installed py27-numpy / scipy / matplotlib using macports, and it ran without failing.

When I run Python I get the following error:

$>> which python

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

$>> python

Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 128, in <module>
    from version import git_revision as __git_revision__
ImportError: cannot import name git_revision

I get the same error for all three packages. Is this a MacPorts issue or a different issue?

I am running OS X 10.6 with the Intel Core i5 architecture. At one point I thought this was a 64-bit versus 32-bit issue, viz.:

>>> import platform
>>> platform.architecture()
('64bit', '')

but I would have thought the MacPorts install would have resolved that.

Any help would be appreciated.

Thanks!

-s

[toc] | [next] | [standalone]


#25012

FromHans Mulder <hansmu@xs4all.nl>
Date2012-07-07 12:18 +0200
Message-ID<4ff80d06$0$6909$e4fe514c@news2.news.xs4all.nl>
In reply to#25001
On 7/07/12 07:47:56, Stephen Webb wrote:
> I installed py27-numpy / scipy / matplotlib using macports, and it ran without failing.
> 
> When I run Python I get the following error:
> 
> $>> which python
> 
> /Library/Frameworks/Python.framework/Versions/2.7/bin/python

That's a python from python.org, not from MacPorts.

> $>> python
> 
> Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import numpy
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 128, in <module>
>     from version import git_revision as __git_revision__
> ImportError: cannot import name git_revision
> 
> I get the same error for all three packages. Is this a MacPorts issue or a different issue?

You have (at least) three pythons on your Mac: one from Apple
in /usr/bin, one from python.org (the one you found) and one
from MacPorts in /opt/local/bin/python

You may want to add /opt/local/bin to the front of your PATH;
that will also pick up the MacPorts version of other software
you've installed from MacPorts.

Or you can explicitly type the full path of the python you want.

Or you can define aliases, for example:

alias apple_python=/usr/bin/python
alias macport_python=/opt/local/bin/python

lfpv=/Library/Frameworks/Python.framework/Versions
alias python_org_python=$lfpv/2.7/bin/python


Hope this helps,

-- HansM

[toc] | [prev] | [next] | [standalone]


#25016

FromOusmane Wilane <ousmane@wilane.org>
Date2012-07-07 14:09 +0200
Message-ID<87zk7bg4bv.wl%ousmane@wilane.org>
In reply to#25012
>>>>> "H" == Hans Mulder <hansmu@xs4all.nl> writes:

    H> Or you can explicitly type the full path of the python you want.

    H> Or you can define aliases, for example:

    H> alias apple_python=/usr/bin/python alias
    H> macport_python=/opt/local/bin/python

    H> lfpv=/Library/Frameworks/Python.framework/Versions alias
    H> python_org_python=$lfpv/2.7/bin/python


Or alternatively use `port select --set' to make one of the MacPort version the
default:

imac:~ wilane$ port select --list python
Available versions for python:
          none
          python25-apple
          python26
          python26-apple
          python27 (active)
          python27-apple
          python32


Cheers

--
Ousmane

[toc] | [prev] | [next] | [standalone]


#25020

FromHans Mulder <hansmu@xs4all.nl>
Date2012-07-07 16:40 +0200
Message-ID<4ff84a7c$0$6878$e4fe514c@news2.news.xs4all.nl>
In reply to#25016
On 7/07/12 14:09:56, Ousmane Wilane wrote:
>>>>>> "H" == Hans Mulder <hansmu@xs4all.nl> writes:
> 
>     H> Or you can explicitly type the full path of the python you want.
> 
>     H> Or you can define aliases, for example:
> 
>     H> alias apple_python=/usr/bin/python alias
>     H> macport_python=/opt/local/bin/python
> 
>     H> lfpv=/Library/Frameworks/Python.framework/Versions alias
>     H> python_org_python=$lfpv/2.7/bin/python
> 
> 
> Or alternatively use `port select --set' to make one of the MacPort version the
> default:
> 
> imac:~ wilane$ port select --list python
> Available versions for python:
>           none
>           python25-apple
>           python26
>           python26-apple
>           python27 (active)
>           python27-apple
>           python32

That would work if the OP had /opt/local/bin early in his searcht path.
However, the OP has installed Python27 from python.org, and that has
prepended /Library/Frameworks/Python.framework/Versions/2.7/bin to
his PATH, overriding anything he does with "port select".

He could, of course, change his PATH and move /opt/local/bin to the
front and then use "port select".

-- HansM

[toc] | [prev] | [next] | [standalone]


#25024

FromStephen Webb <sdavis.webb@gmail.com>
Date2012-07-07 09:57 -0600
Message-ID<mailman.1894.1341676636.4697.python-list@python.org>
In reply to#25020
I think the easiest thing to do would be to remove the python.org Python entirely, kill it from the path (which I've already done), and install directly a MacPorts version of Python.

Any caveats or warnings about getting rid of the /Library/Frameworks/Python.... directory?

On Jul 7, 2012, at Jul 7 8:40 AM, Hans Mulder wrote:

> On 7/07/12 14:09:56, Ousmane Wilane wrote:
>>>>>>> "H" == Hans Mulder <hansmu@xs4all.nl> writes:
>> 
>>    H> Or you can explicitly type the full path of the python you want.
>> 
>>    H> Or you can define aliases, for example:
>> 
>>    H> alias apple_python=/usr/bin/python alias
>>    H> macport_python=/opt/local/bin/python
>> 
>>    H> lfpv=/Library/Frameworks/Python.framework/Versions alias
>>    H> python_org_python=$lfpv/2.7/bin/python
>> 
>> 
>> Or alternatively use `port select --set' to make one of the MacPort version the
>> default:
>> 
>> imac:~ wilane$ port select --list python
>> Available versions for python:
>>          none
>>          python25-apple
>>          python26
>>          python26-apple
>>          python27 (active)
>>          python27-apple
>>          python32
> 
> That would work if the OP had /opt/local/bin early in his searcht path.
> However, the OP has installed Python27 from python.org, and that has
> prepended /Library/Frameworks/Python.framework/Versions/2.7/bin to
> his PATH, overriding anything he does with "port select".
> 
> He could, of course, change his PATH and move /opt/local/bin to the
> front and then use "port select".
> 
> -- HansM
> -- 
> http://mail.python.org/mailman/listinfo/python-list

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web