Re: [sage-support] Lambda functions vs. defining functions

2016-08-10 Thread William Stein
On Wednesday, August 10, 2016, Todd Zimmerman 
wrote:

> I assumed that SageMath converts the functions into symbolic expressions.
> If I enter the following it will work:
>
>
> f=lambda x: x*sin(x)
> diff(f(x),x)
>

f is a python function

f(x) is a symbolic expression - the result of calling f with input x.



>
> def g(x):
> return x*sin(x)
>
> diff(g(x),x)
>
> On Wednesday, August 10, 2016 at 4:01:09 PM UTC-5, Harald Schilly wrote:
>>
>> On Wed, Aug 10, 2016 at 10:46 PM, Todd Zimmerman
>>  wrote:
>> >  You can integrate and differentiate both types of functions in
>> SageMath as
>> > well as use them for solving differential equations.
>>
>> So, can you copy/paste us an example? It does work, if that small
>> python-function is evaluated and returns a symbolic expression. That
>> will work, I don't doubt that, but the python-function in itself is
>> then no longer part of this. Key for understanding this is, that
>> nested functions are evaluated from the inside out and there is no
>> direct concept of lazyness in Python. In some situations, it might
>> look like that, so I fully understand that this is confusing.
>>
>> -- h
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to sage-support@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sent from my massive iPhone 6 plus.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Lambda functions vs. defining functions

2016-08-10 Thread Todd Zimmerman
I assumed that SageMath converts the functions into symbolic expressions.
If I enter the following it will work:


f=lambda x: x*sin(x)
diff(f(x),x)

def g(x):
return x*sin(x)

diff(g(x),x)

On Wednesday, August 10, 2016 at 4:01:09 PM UTC-5, Harald Schilly wrote:
>
> On Wed, Aug 10, 2016 at 10:46 PM, Todd Zimmerman 
>  wrote: 
> >  You can integrate and differentiate both types of functions in SageMath 
> as 
> > well as use them for solving differential equations. 
>
> So, can you copy/paste us an example? It does work, if that small 
> python-function is evaluated and returns a symbolic expression. That 
> will work, I don't doubt that, but the python-function in itself is 
> then no longer part of this. Key for understanding this is, that 
> nested functions are evaluated from the inside out and there is no 
> direct concept of lazyness in Python. In some situations, it might 
> look like that, so I fully understand that this is confusing. 
>
> -- h 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Lambda functions vs. defining functions

2016-08-10 Thread Harald Schilly
On Wed, Aug 10, 2016 at 10:46 PM, Todd Zimmerman
 wrote:
>  You can integrate and differentiate both types of functions in SageMath as
> well as use them for solving differential equations.

So, can you copy/paste us an example? It does work, if that small
python-function is evaluated and returns a symbolic expression. That
will work, I don't doubt that, but the python-function in itself is
then no longer part of this. Key for understanding this is, that
nested functions are evaluated from the inside out and there is no
direct concept of lazyness in Python. In some situations, it might
look like that, so I fully understand that this is confusing.

-- h

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Lambda functions vs. defining functions

2016-08-10 Thread William Stein
On Wednesday, August 10, 2016, Todd Zimmerman 
wrote:

> I'm aware of the difference between the two approaches in vanilla Python,
> I was just trying to figure out if SageMath treats the two differently.
>
>
No it doesn't.



>
>  You can integrate and differentiate both types of functions in SageMath
> as well as use them for solving differential equations.
>
> -Todd
>
>
> On Wednesday, August 10, 2016 at 1:51:38 PM UTC-5, Harald Schilly wrote:
>>
>>
>>
>> On Wednesday, August 10, 2016 at 8:37:18 PM UTC+2, Todd Zimmerman wrote:
>>>
>>> Is there any significant difference in SageMath between defining a
>>> function using lambda vs. defining it using 'def ...:'?
>>>
>>>
>> This is actually a pure Python question, and the answer is yes.
>> Technically:
>>
>> def f1(x):
>> return x
>>
>> f2 = lambda x : x
>>
>> import dis # disassembler
>>
>>
>> dis.dis(f1)
>>
>> 2 0 LOAD_FAST 0 (x)
>>   3 RETURN_VALUE
>>
>> dis.dis(f2)
>>
>> 1 0 LOAD_FAST 0 (x)
>>   3 RETURN_VALUE
>>
>>
>>
>> But you cannot integrate or differentiate them! For that, you need a
>> function/symbolic expression, which is a Sage-specific object!
>>
>> Under the hood, f(x) = x is constructed like:
>>
>> x = var("x")
>> f = symbolic_expression(x).function(x)
>>
>>
>> -- harald
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to sage-support@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sent from my massive iPhone 6 plus.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Lambda functions vs. defining functions

2016-08-10 Thread Todd Zimmerman
I'm aware of the difference between the two approaches in vanilla Python, I 
was just trying to figure out if SageMath treats the two differently.  You 
can integrate and differentiate both types of functions in SageMath as well 
as use them for solving differential equations. 

-Todd


On Wednesday, August 10, 2016 at 1:51:38 PM UTC-5, Harald Schilly wrote:
>
>
>
> On Wednesday, August 10, 2016 at 8:37:18 PM UTC+2, Todd Zimmerman wrote:
>>
>> Is there any significant difference in SageMath between defining a 
>> function using lambda vs. defining it using 'def ...:'? 
>>
>>
> This is actually a pure Python question, and the answer is yes. 
> Technically:
>
> def f1(x):
> return x
>
> f2 = lambda x : x
>
> import dis # disassembler
>
>
> dis.dis(f1)
>
> 2 0 LOAD_FAST 0 (x)
>   3 RETURN_VALUE   
>
> dis.dis(f2)
>
> 1 0 LOAD_FAST 0 (x)
>   3 RETURN_VALUE 
>
>
>
> But you cannot integrate or differentiate them! For that, you need a 
> function/symbolic expression, which is a Sage-specific object!
>
> Under the hood, f(x) = x is constructed like:
>
> x = var("x")
> f = symbolic_expression(x).function(x)
>
>
> -- harald
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Lambda functions vs. defining functions

2016-08-10 Thread William Stein
On Wed, Aug 10, 2016 at 7:36 AM, Todd Zimmerman
 wrote:
> Is there any significant difference in SageMath between defining a function
> using lambda vs. defining it using 'def ...:'?  Both situations result in
> functions that can be differentiated, integrated, etc so I'm not sure if
> there is any functional difference between the two methods in SageMath.
>

Both def and lambda are from Python (unlike f(x,y) = sin(x+y), say,
which is Sage specific), so this question is heavily discussed online
already:

  
https://www.google.com/search?q=python+lambda+versus+def=1C5CHFA_enUS691US691=python+lambda+versus+def=chrome..69i57j0.4431j0j7=chrome=UTF-8

> -Todd
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Lambda functions vs. defining functions

2016-08-10 Thread Harald Schilly


On Wednesday, August 10, 2016 at 8:37:18 PM UTC+2, Todd Zimmerman wrote:
>
> Is there any significant difference in SageMath between defining a 
> function using lambda vs. defining it using 'def ...:'? 
>
>
This is actually a pure Python question, and the answer is yes. Technically:

def f1(x):
return x

f2 = lambda x : x

import dis # disassembler


dis.dis(f1)

2 0 LOAD_FAST 0 (x)
  3 RETURN_VALUE   

dis.dis(f2)

1 0 LOAD_FAST 0 (x)
  3 RETURN_VALUE 



But you cannot integrate or differentiate them! For that, you need a 
function/symbolic expression, which is a Sage-specific object!

Under the hood, f(x) = x is constructed like:

x = var("x")
f = symbolic_expression(x).function(x)


-- harald

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Lambda functions vs. defining functions

2016-08-10 Thread Todd Zimmerman
Is there any significant difference in SageMath between defining a function 
using lambda vs. defining it using 'def ...:'?  Both situations result in 
functions that can be differentiated, integrated, etc so I'm not sure if 
there is any functional difference between the two methods in SageMath.

-Todd


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread William Stein
I was really surprised when I started Sage that people would often try
to **install all optional packages**, then report anything that went
wrong.I bet people still try to do this...

On Wed, Aug 10, 2016 at 7:09 AM, Dima Pasechnik  wrote:
>
>
> On Wednesday, August 10, 2016 at 9:34:59 AM UTC+1, Dima Pasechnik wrote:
>>
>>
>>
>> On Wednesday, August 10, 2016 at 9:22:46 AM UTC+1, Dima Pasechnik wrote:
>>>
>>>
>>>
>>> On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko wrote:

 I just encountered this problem sage -i py3 ( to install python3)...
 broke my whole system... Is there a single "undo" operation so that I can
 return to my working copy?
>>>
>>>
>>> do you mean
>>>
>>> sage -i python3
>>
>>
>> this breaks sage, as it makes the symbolic link 'python' to point to
>> 'python3' in SAGE_LOCAL/bin.
>> To fix, it suffices to make it point to python2 instead:
>>
>> cd SAGE_ROOT # where your Sage is installed
>> cd local/bin
>> ln -sf python2 python
>>
>> Then everything works as before
>> (and you may also use python3 script from 'sage -sh')
>
>
> in fact, it turned out that I also needed to rebuild python2 package, and
> then run make.
>
> sage -f python2
> make
>
> otherwise ipython, doctesting, and some stuff related to dictionaries didn't
> quite work.
> So this is not that trivial, apparently, and needs further investigation.
>
>>
>>
>> Perhaps a proper fix would be to leave python symbolic link as it is.
>>
>> Dima
>>
>>>
>>> IMHO Sage does not have a package named py3
>>>
>>>


 On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel Charpentier
 wrote:
>
> This is probably related to Trac#18521, but on Linux (Debian testing) :
> Installing the optional python3 package breaks my Sage installation. After
> installing it, I get :
>
> charpent@SAP5057241:~$ sage
> /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 Abandon
> "$SAGE_ROOT/local/bin/python" -c 'import pkg_resources;
> pkg_resources.get_distribution("matplotlib").version' 2> /dev/null
> ┌┐
> │ SageMath Version 6.9, Release Date: 2015-10-10 │
> │ Type "notebook()" for the browser-based notebook interface.│
> │ Type "help()" for help.│
> └┘
> Fatal Python error: Py_Initialize: Unable to get the locale encoding
>   File "/usr/local/sage/local/lib/python/encodings/__init__.py", line
> 123
> raise CodecRegistryError,\
> ^
> SyntaxError: invalid syntax
> /usr/local/sage/src/bin/sage : ligne 388 :  3493 Abandon
> sage-location
>
> After this, my Sage installation is broken real good : I can't even
> make...
>
> Shouldn't we displace python3 in "experimental" packages ?
>
> HTH,
>
> --
> Emmanuel Charpentier
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread Dima Pasechnik


On Wednesday, August 10, 2016 at 9:34:59 AM UTC+1, Dima Pasechnik wrote:
>
>
>
> On Wednesday, August 10, 2016 at 9:22:46 AM UTC+1, Dima Pasechnik wrote:
>>
>>
>>
>> On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko wrote:
>>>
>>> I just encountered this problem sage -i py3 ( to install python3)... 
>>> broke my whole system... Is there a single "undo" operation so that I can 
>>> return to my working copy?
>>>
>>
>> do you mean 
>>
>> sage -i python3 
>>
>
> this breaks sage, as it makes the symbolic link 'python' to point to 
> 'python3' in SAGE_LOCAL/bin.
> To fix, it suffices to make it point to python2 instead:
>
> cd SAGE_ROOT # where your Sage is installed
> cd local/bin
> ln -sf python2 python
>
> Then everything works as before
> (and you may also use python3 script from 'sage -sh')
>

in fact, it turned out that I also needed to rebuild python2 package, and 
then run make.

sage -f python2
make

otherwise ipython, doctesting, and some stuff related to dictionaries 
didn't quite work.
So this is not that trivial, apparently, and needs further investigation.
 

>
> Perhaps a proper fix would be to leave python symbolic link as it is.
>
> Dima
>
>
>> IMHO Sage does not have a package named py3
>>  
>>  
>>
>>>
>>> On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel Charpentier 
>>> wrote:

 This is probably related to Trac#18521 
 , but on Linux (Debian testing) 
 : Installing the optional python3 package breaks my Sage installation. 
 After installing it, I get :

 charpent@SAP5057241:~$ sage
 /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 
 Abandon "$SAGE_ROOT/local/bin/python" -c 'import 
 pkg_resources; pkg_resources.get_distribution("matplotlib").version' 2> 
 /dev/null
 ┌┐
 │ SageMath Version 6.9, Release Date: 2015-10-10 │
 │ Type "notebook()" for the browser-based notebook interface.│
 │ Type "help()" for help.│
 └┘
 Fatal Python error: Py_Initialize: Unable to get the locale encoding
   File "/usr/local/sage/local/lib/python/encodings/__init__.py", line 
 123
 raise CodecRegistryError,\
 ^
 SyntaxError: invalid syntax
 /usr/local/sage/src/bin/sage : ligne 388 :  3493 
 Abandon sage-location

 After this, my Sage installation is broken real good : I can't even 
 make...

 Shouldn't we displace python3 in "experimental" packages ?

 HTH,

 --
 Emmanuel Charpentier



-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread leif
Dima Pasechnik wrote:
> On Wednesday, August 10, 2016 at 10:39:44 AM UTC+1, leif wrote:
> 
> Dima Pasechnik wrote:
> > this is now https://trac.sagemath.org/ticket/21199
> 
> 
> Is it at all supposed to be used that way?  (I don't think so.  IMHO
> it's an optional package to use *instead* just like GMP vs. MPIR at
> Sage
> *configure* time, not to be installed afterwards.)
> 
> 
> I cannot see how this can be an optional package this way; in this way
> it would require all the tests passing!
> (i.e. full python3 support for  Sage :-))

And that's the reason we don't have a 'configure' option
'--with-python=...' yet (just the env var SAGE_PYTHON3 which is looked
at when configuring Sage). ;-)

But we don't have a package type 'alternative' either (which would make
sense for Python2/Python3, MPIR/GMP), just 'standard' and 'optional' in
this case.  Hence these packages are explicitly treated specifically in
the build system ('configure' and Makefiles); in fact, the choice made
at *configure* time gets hardcoded into the generated Makefile.


-leif

> Still, as is it's presumably confusing and dangerous.
> 
> 
> -leif


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread Dima Pasechnik


On Wednesday, August 10, 2016 at 10:39:44 AM UTC+1, leif wrote:
>
> Dima Pasechnik wrote: 
> > this is now https://trac.sagemath.org/ticket/21199 
>
> Is it at all supposed to be used that way?  (I don't think so.  IMHO 
> it's an optional package to use *instead* just like GMP vs. MPIR at Sage 
> *configure* time, not to be installed afterwards.) 
>

I cannot see how this can be an optional package this way; in this way it 
would require all the tests passing!
(i.e. full python3 support for  Sage :-))


> Still, as is it's presumably confusing and dangerous. 
>
>
> -leif 
>
> > On Wednesday, August 10, 2016 at 9:34:59 AM UTC+1, Dima Pasechnik wrote: 
> > 
> > 
> > 
> > On Wednesday, August 10, 2016 at 9:22:46 AM UTC+1, Dima Pasechnik 
> wrote: 
> > 
> > 
> > 
> > On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko 
> wrote: 
> > 
> > I just encountered this problem sage -i py3 ( to install 
> > python3)... broke my whole system... Is there a single 
> > "undo" operation so that I can return to my working copy? 
> > 
> > 
> > do you mean 
> > 
> > sage -i python3 
> > 
> > 
> > this breaks sage, as it makes the symbolic link 'python' to point to 
> > 'python3' in SAGE_LOCAL/bin. 
> > To fix, it suffices to make it point to python2 instead: 
> > 
> > cd SAGE_ROOT # where your Sage is installed 
> > cd local/bin 
> > ln -sf python2 python 
> > 
> > Then everything works as before 
> > (and you may also use python3 script from 'sage -sh') 
> > 
> > Perhaps a proper fix would be to leave python symbolic link as it 
> is. 
> > 
> > Dima 
> > 
> > 
> > IMHO Sage does not have a package named py3 
> >   
> >   
> > 
> > 
> > On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel 
> > Charpentier wrote: 
> > 
> > This is probably related to Trac#18521 
> > , but on Linux 
> > (Debian testing) : Installing the optional python3 
> > package breaks my Sage installation. After installing 
> > it, I get : 
> > 
> > charpent@SAP5057241:~$ sage 
> > /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 
> > Abandon "$SAGE_ROOT/local/bin/python" -c 
> > 'import pkg_resources; 
> > pkg_resources.get_distribution("matplotlib").version' 2> 
> > /dev/null 
> > 
> ┌┐ 
> > │ SageMath Version 6.9, Release Date: 
> > 2015-10-10 │ 
> > │ Type "notebook()" for the browser-based notebook 
> > interface.│ 
> > │ Type "help()" for 
> > help.│ 
> > 
> └┘ 
> > Fatal Python error: Py_Initialize: Unable to get the 
> > locale encoding 
> >   File 
> > 
> "/usr/local/sage/local/lib/python/encodings/__init__.py", line 
> > 123 
> > raise CodecRegistryError,\ 
> > ^ 
> > SyntaxError: invalid syntax 
> > /usr/local/sage/src/bin/sage : ligne 388 :  3493 
> > Abandon sage-location 
> > 
> > After this, my Sage installation is broken real good : I 
> > can't even make... 
> > 
> > Shouldn't we displace python3 in "experimental" packages 
> ? 
> > 
> > HTH, 
> > 
> > -- 
> > Emmanuel Charpentier 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread leif
Dima Pasechnik wrote:
> this is now https://trac.sagemath.org/ticket/21199

Is it at all supposed to be used that way?  (I don't think so.  IMHO
it's an optional package to use *instead* just like GMP vs. MPIR at Sage
*configure* time, not to be installed afterwards.)

Still, as is it's presumably confusing and dangerous.


-leif

> On Wednesday, August 10, 2016 at 9:34:59 AM UTC+1, Dima Pasechnik wrote:
> 
> 
> 
> On Wednesday, August 10, 2016 at 9:22:46 AM UTC+1, Dima Pasechnik wrote:
> 
> 
> 
> On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko wrote:
> 
> I just encountered this problem sage -i py3 ( to install
> python3)... broke my whole system... Is there a single
> "undo" operation so that I can return to my working copy?
> 
> 
> do you mean 
> 
> sage -i python3 
> 
> 
> this breaks sage, as it makes the symbolic link 'python' to point to
> 'python3' in SAGE_LOCAL/bin.
> To fix, it suffices to make it point to python2 instead:
> 
> cd SAGE_ROOT # where your Sage is installed
> cd local/bin
> ln -sf python2 python
> 
> Then everything works as before
> (and you may also use python3 script from 'sage -sh')
> 
> Perhaps a proper fix would be to leave python symbolic link as it is.
> 
> Dima
> 
> 
> IMHO Sage does not have a package named py3
>  
>  
> 
> 
> On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel
> Charpentier wrote:
> 
> This is probably related to Trac#18521
> , but on Linux
> (Debian testing) : Installing the optional python3
> package breaks my Sage installation. After installing
> it, I get :
> 
> charpent@SAP5057241:~$ sage
> /usr/local/sage/src/bin/sage-env : ligne 423 :  3485
> Abandon "$SAGE_ROOT/local/bin/python" -c
> 'import pkg_resources;
> pkg_resources.get_distribution("matplotlib").version' 2>
> /dev/null
> 
> ┌┐
> │ SageMath Version 6.9, Release Date:
> 2015-10-10 │
> │ Type "notebook()" for the browser-based notebook
> interface.│
> │ Type "help()" for
> help.│
> 
> └┘
> Fatal Python error: Py_Initialize: Unable to get the
> locale encoding
>   File
> "/usr/local/sage/local/lib/python/encodings/__init__.py", line
> 123
> raise CodecRegistryError,\
> ^
> SyntaxError: invalid syntax
> /usr/local/sage/src/bin/sage : ligne 388 :  3493
> Abandon sage-location
> 
> After this, my Sage installation is broken real good : I
> can't even make...
> 
> Shouldn't we displace python3 in "experimental" packages ?
> 
> HTH,
> 
> --
> Emmanuel Charpentier


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread Dima Pasechnik
this is now https://trac.sagemath.org/ticket/21199

On Wednesday, August 10, 2016 at 9:34:59 AM UTC+1, Dima Pasechnik wrote:
>
>
>
> On Wednesday, August 10, 2016 at 9:22:46 AM UTC+1, Dima Pasechnik wrote:
>>
>>
>>
>> On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko wrote:
>>>
>>> I just encountered this problem sage -i py3 ( to install python3)... 
>>> broke my whole system... Is there a single "undo" operation so that I can 
>>> return to my working copy?
>>>
>>
>> do you mean 
>>
>> sage -i python3 
>>
>
> this breaks sage, as it makes the symbolic link 'python' to point to 
> 'python3' in SAGE_LOCAL/bin.
> To fix, it suffices to make it point to python2 instead:
>
> cd SAGE_ROOT # where your Sage is installed
> cd local/bin
> ln -sf python2 python
>
> Then everything works as before
> (and you may also use python3 script from 'sage -sh')
>
> Perhaps a proper fix would be to leave python symbolic link as it is.
>
> Dima
>
>
>> IMHO Sage does not have a package named py3
>>  
>>  
>>
>>>
>>> On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel Charpentier 
>>> wrote:

 This is probably related to Trac#18521 
 , but on Linux (Debian testing) 
 : Installing the optional python3 package breaks my Sage installation. 
 After installing it, I get :

 charpent@SAP5057241:~$ sage
 /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 
 Abandon "$SAGE_ROOT/local/bin/python" -c 'import 
 pkg_resources; pkg_resources.get_distribution("matplotlib").version' 2> 
 /dev/null
 ┌┐
 │ SageMath Version 6.9, Release Date: 2015-10-10 │
 │ Type "notebook()" for the browser-based notebook interface.│
 │ Type "help()" for help.│
 └┘
 Fatal Python error: Py_Initialize: Unable to get the locale encoding
   File "/usr/local/sage/local/lib/python/encodings/__init__.py", line 
 123
 raise CodecRegistryError,\
 ^
 SyntaxError: invalid syntax
 /usr/local/sage/src/bin/sage : ligne 388 :  3493 
 Abandon sage-location

 After this, my Sage installation is broken real good : I can't even 
 make...

 Shouldn't we displace python3 in "experimental" packages ?

 HTH,

 --
 Emmanuel Charpentier



-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread Dima Pasechnik


On Wednesday, August 10, 2016 at 9:22:46 AM UTC+1, Dima Pasechnik wrote:
>
>
>
> On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko wrote:
>>
>> I just encountered this problem sage -i py3 ( to install python3)... 
>> broke my whole system... Is there a single "undo" operation so that I can 
>> return to my working copy?
>>
>
> do you mean 
>
> sage -i python3 
>

this breaks sage, as it makes the symbolic link 'python' to point to 
'python3' in SAGE_LOCAL/bin.
To fix, it suffices to make it point to python2 instead:

cd SAGE_ROOT # where your Sage is installed
cd local/bin
ln -sf python2 python

Then everything works as before
(and you may also use python3 script from 'sage -sh')

Perhaps a proper fix would be to leave python symbolic link as it is.

Dima


> IMHO Sage does not have a package named py3
>  
>  
>
>>
>> On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel Charpentier 
>> wrote:
>>>
>>> This is probably related to Trac#18521 
>>> , but on Linux (Debian testing) 
>>> : Installing the optional python3 package breaks my Sage installation. 
>>> After installing it, I get :
>>>
>>> charpent@SAP5057241:~$ sage
>>> /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 
>>> Abandon "$SAGE_ROOT/local/bin/python" -c 'import 
>>> pkg_resources; pkg_resources.get_distribution("matplotlib").version' 2> 
>>> /dev/null
>>> ┌┐
>>> │ SageMath Version 6.9, Release Date: 2015-10-10 │
>>> │ Type "notebook()" for the browser-based notebook interface.│
>>> │ Type "help()" for help.│
>>> └┘
>>> Fatal Python error: Py_Initialize: Unable to get the locale encoding
>>>   File "/usr/local/sage/local/lib/python/encodings/__init__.py", line 123
>>> raise CodecRegistryError,\
>>> ^
>>> SyntaxError: invalid syntax
>>> /usr/local/sage/src/bin/sage : ligne 388 :  3493 Abandon 
>>> sage-location
>>>
>>> After this, my Sage installation is broken real good : I can't even make
>>> ...
>>>
>>> Shouldn't we displace python3 in "experimental" packages ?
>>>
>>> HTH,
>>>
>>> --
>>> Emmanuel Charpentier
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread Dima Pasechnik


On Wednesday, August 10, 2016 at 9:13:14 AM UTC+1, The Geeko wrote:
>
> I just encountered this problem sage -i py3 ( to install python3)... 
> broke my whole system... Is there a single "undo" operation so that I can 
> return to my working copy?
>

do you mean 

sage -i python3 

IMHO Sage does not have a package named py3
 
 

>
> On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel Charpentier 
> wrote:
>>
>> This is probably related to Trac#18521 
>> , but on Linux (Debian testing) : 
>> Installing the optional python3 package breaks my Sage installation. After 
>> installing it, I get :
>>
>> charpent@SAP5057241:~$ sage
>> /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 
>> Abandon "$SAGE_ROOT/local/bin/python" -c 'import 
>> pkg_resources; pkg_resources.get_distribution("matplotlib").version' 2> 
>> /dev/null
>> ┌┐
>> │ SageMath Version 6.9, Release Date: 2015-10-10 │
>> │ Type "notebook()" for the browser-based notebook interface.│
>> │ Type "help()" for help.│
>> └┘
>> Fatal Python error: Py_Initialize: Unable to get the locale encoding
>>   File "/usr/local/sage/local/lib/python/encodings/__init__.py", line 123
>> raise CodecRegistryError,\
>> ^
>> SyntaxError: invalid syntax
>> /usr/local/sage/src/bin/sage : ligne 388 :  3493 Abandon 
>> sage-location
>>
>> After this, my Sage installation is broken real good : I can't even make
>> ...
>>
>> Shouldn't we displace python3 in "experimental" packages ?
>>
>> HTH,
>>
>> --
>> Emmanuel Charpentier
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread The Geeko
I just encountered this problem sage -i py3 ( to install python3)... 
broke my whole system... Is there a single "undo" operation so that I can 
return to my working copy?

On Wednesday, October 21, 2015 at 6:30:31 AM UTC-5, Emmanuel Charpentier 
wrote:
>
> This is probably related to Trac#18521 
> , but on Linux (Debian testing) : 
> Installing the optional python3 package breaks my Sage installation. After 
> installing it, I get :
>
> charpent@SAP5057241:~$ sage
> /usr/local/sage/src/bin/sage-env : ligne 423 :  3485 
> Abandon "$SAGE_ROOT/local/bin/python" -c 'import 
> pkg_resources; pkg_resources.get_distribution("matplotlib").version' 2> 
> /dev/null
> ┌┐
> │ SageMath Version 6.9, Release Date: 2015-10-10 │
> │ Type "notebook()" for the browser-based notebook interface.│
> │ Type "help()" for help.│
> └┘
> Fatal Python error: Py_Initialize: Unable to get the locale encoding
>   File "/usr/local/sage/local/lib/python/encodings/__init__.py", line 123
> raise CodecRegistryError,\
> ^
> SyntaxError: invalid syntax
> /usr/local/sage/src/bin/sage : ligne 388 :  3493 Abandon 
> sage-location
>
> After this, my Sage installation is broken real good : I can't even make
> ...
>
> Shouldn't we displace python3 in "experimental" packages ?
>
> HTH,
>
> --
> Emmanuel Charpentier
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.