It works with strings:

sage: natsorted(a,key=*lambda* z:str(z))

[x8, x9, x10, x11]

Thank you to all of you for your help.

On Mon, 22 Apr 2019 at 22:56, G. M.-S. <lists....@gmail.com> wrote:

>
> So I got the tarball and it got installed but complaining still about SSL
> (why?):
>
> $ ./sage --pip install /src/natsort-6.0.0.tar.gz
>
> pip is configured with locations that require TLS/SSL, however the ssl
> module in Python is not available.
>
> Processing /src/natsort-6.0.0.tar.gz
>
> Installing collected packages: natsort
>
>   Running setup.py install for natsort ... done
>
> Successfully installed natsort-6.0.0
>
> pip is configured with locations that require TLS/SSL, however the ssl
> module in Python is not available.
>
> Could not fetch URL https://pypi.org/simple/pip/: There was a problem
> confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org',
> port=443): Max retries exceeded with url: /simple/pip/ (Caused by
> SSLError("Can't connect to HTTPS URL because the SSL module is not
> available.",)) - skipping
>
> $
>
> Then I tried natsorted, but it does not work:
>
> ┌────────────────────────────────────────────────────────────────────┐
>
> │ SageMath version 8.7, Release Date: 2019-03-23                     │
>
> │ Using Python 2.7.15. Type "help()" for help.                       │
>
> └────────────────────────────────────────────────────────────────────┘
>
> sage: *from* *natsort* *import* natsorted
>
> sage: var('x10,x8,x11,x9')
>
> (x10, x8, x11, x9)
>
> sage: natsorted([x10,x8,x11,x9])
>
> [x10, x8, x11, x9]
>
> sage: x = SR.var('x', *20*)
>
> sage: a = [x[*11*], x[*8*], x[*10*], x[*9*]]
>
> sage: a
>
> [x11, x8, x10, x9]
>
> sage: natsorted(a)
>
> [x11, x8, x10, x9]
>
> sage:
>
> Am I doing something wrong?
>
> On Mon, 22 Apr 2019 at 22:10, slelievre <samuel.lelie...@gmail.com> wrote:
>
>> Mon 2019-04-22 19:23:32 UTC, John H Palmieri:
>> >
>> > Alternatively, you should be able to download
>> > a tar.gz file from https://pypi.org/project/natsort/#files, and then do
>> >
>> > ./sage --pip install /path/to/natsort-6.0.0.tar.gz
>>
>> Thanks for the reminder! I often forget one can download
>> the tarball oneself and then "pip install" the downloaded
>> tarball, allowing "pip installation" with a Python whose
>> openssl module is missing.
>>
>

-- 
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.

Reply via email to