Installation of GeoPandas - failed at fiona

2021-12-01 Thread Shaozhong SHI
I am trying to install geopandas.

I navigated to c:\programData|Anaconda3\Scripts>
and typed in 'pip install geopandas'.

It ran but failed at fiona.

I tried import geopandas as gp, but Error Message says: No module names
'geopandas'.

Can anyone help?

Regards,

David
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installation of GeoPandas - failed at fiona

2021-12-01 Thread Mats Wichmann

On 12/1/21 03:18, Shaozhong SHI wrote:

I am trying to install geopandas.

I navigated to c:\programData|Anaconda3\Scripts>
and typed in 'pip install geopandas'.


Usually if you're using the Anaconda environment, you should use the 
"conda" installer, for consistency.




It ran but failed at fiona.


Failed how?


I tried import geopandas as gp, but Error Message says: No module names
'geopandas'.


That almost certianly means the install went to a different place than 
the environment where you're trying to use it.


--
https://mail.python.org/mailman/listinfo/python-list


NOT ABLE TO SEE PICTURES

2021-12-01 Thread Ragavendar
   When the python runs in file explorer when I open a folder it shows NO
   ITEAMS FOUND and if I open same folder without python ITEAMS ARE THERE so
   kindly help me

    

    

   Sent from [1]Mail for Windows

    

References

   Visible links
   1. https://go.microsoft.com/fwlink/?LinkId=550986
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: NOT ABLE TO SEE PICTURES

2021-12-01 Thread inhahe
Maybe your file explorer is set to ignore system and/or hidden files, and
Python isn't? You can check that in folder settings..

On Wed, Dec 1, 2021 at 10:31 AM Ragavendar  wrote:

>When the python runs in file explorer when I open a folder it shows NO
>ITEAMS FOUND and if I open same folder without python ITEAMS ARE THERE
> so
>kindly help me
>
>
>
>
>
>Sent from [1]Mail for Windows
>
>
>
> References
>
>Visible links
>1. https://go.microsoft.com/fwlink/?LinkId=550986
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python child process in while True loop blocks parent

2021-12-01 Thread Jen Kris via Python-list
Thanks for your comment re blocking.  

I removed pipes from the Python and C programs to see if it blocks without 
them, and it does.  It looks now like the problem is not pipes.  I use fork() 
and execv() in C to run Python in a child process, but the Python process 
blocks because fork() does not create a new thread, so the Python global 
interpreter lock (GIL) prevents the C program from running once Python starts.  
So the solution appears to be run Python in a separate thread, which I can do 
with pthread create.  See "Thread State and the Global Interpreter Lock" 
https://docs.python.org/3/c-api/init.html#thread-state-and-the-global-interpreter-lock
 and the sections below that "Non-Python created threads" and "Cautions about 
fork()." 

I'm working on that today and I hope all goes well :) 



Nov 30, 2021, 11:42 by ba...@barrys-emacs.org:

>
>
>
>> On 29 Nov 2021, at 22:31, Jen Kris <>> jenk...@tutanota.com>> > wrote:
>>
>> Thanks to you and Cameron for your replies.  The C side has an epoll_ctl 
>> set, but no event loop to handle it yet.  I'm putting that in now with a 
>> pipe write in Python-- as Cameron pointed out that is the likely source of 
>> blocking on C.  The pipes are opened as rdwr in Python because that's 
>> nonblocking by default.  The child will become more complex, but not in a 
>> way that affects polling.  And thanks for the tip about the c-string 
>> termination. 
>>
>>
>
> flags is a bit mask. You say its BLOCKing by not setting os.O_NONBLOCK.
> You should not use O_RDWR when you only need O_RDONLY access or only O_WRONLY 
> access.
>
> You may find
>
> man 2 open
>
> useful to understand in detail what is behind os.open().
>
> Barry
>
>
>
>
>>
>>
>> Nov 29, 2021, 14:12 by >> ba...@barrys-emacs.org>> :
>>
>>>
>>>
 On 29 Nov 2021, at 20:36, Jen Kris via Python-list < 
 python-list@python.org > wrote:

 I have a C program that forks to create a child process and uses execv to 
 call a Python program.  The Python program communicates with the parent 
 process (in C) through a FIFO pipe monitored with epoll(). 

 The Python child process is in a while True loop, which is intended to 
 keep it running while the parent process proceeds, and perform functions 
 for the C program only at intervals when the parent sends data to the 
 child -- similar to a daemon process. 

 The C process writes to its end of the pipe and the child process reads 
 it, but then the child process continues to loop, thereby blocking the 
 parent. 

 This is the Python code:

 #!/usr/bin/python3
 import os
 import select

 #Open the named pipes
 pr = os.open('/tmp/Pipe_01', os.O_RDWR)

>>> Why open rdwr if you are only going to read the pipe?
>>>
 pw = os.open('/tmp/Pipe_02', os.O_RDWR)

>>> Only need to open for write.
>>>

 ep = select.epoll(-1)
 ep.register(pr, select.EPOLLIN)

>>>
>>> Is the only thing that the child does this:
>>> 1. Read message from pr
>>> 2. Process message
>>> 3. Write result to pw.
>>> 4. Loop from 1
>>>
>>> If so as Cameron said you do not need to worry about the poll.
>>> Do you plan for the child to become more complex?
>>>

 while True:

 events = ep.poll(timeout=2.5, maxevents=-1)
 #events = ep.poll(timeout=None, maxevents=-1)

 print("child is looping")

 for fileno, event in events:
 print("Python fileno")
 print(fileno)
 print("Python event")
 print(event)
 v = os.read(pr,64)
 print("Pipe value")
 print(v)

 The child process correctly receives the signal from ep.poll and correctly 
 reads the data in the pipe, but then it continues looping.  For example, 
 when I put in a timeout:

 child is looping
 Python fileno
 4
 Python event
 1
 Pipe value
 b'10\x00'

>>> The C code does not need to write a 0 bytes at the end.
>>> I assume the 0 is from the end of a C string.
>>> UDS messages have a length.
>>> In the C just write 2 byes in the case.
>>>
>>> Barry
>>>
 child is looping
 child is looping

 That suggests that a while True loop is not the right thing to do in this 
 case.  My question is, what type of process loop is best for this 
 situation?  The multiprocessing, asyncio and subprocess libraries are very 
 extensive, and it would help if someone could suggest the best alternative 
 for what I am doing here. 

 Thanks very much for any ideas. 


 -- 
 https://mail.python.org/mailman/listinfo/python-list

>>
>>

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: NOT ABLE TO SEE PICTURES

2021-12-01 Thread Calvin Spealman
What does "python runs in file explorer" mean? How do you know its the same
folder? How are you looking at the contents of the folder?

On Wed, Dec 1, 2021 at 10:33 AM Ragavendar  wrote:

>When the python runs in file explorer when I open a folder it shows NO
>ITEAMS FOUND and if I open same folder without python ITEAMS ARE THERE
> so
>kindly help me
>
>
>
>
>
>Sent from [1]Mail for Windows
>
>
>
> References
>
>Visible links
>1. https://go.microsoft.com/fwlink/?LinkId=550986
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] 
TRIED. TESTED. TRUSTED. 
-- 
https://mail.python.org/mailman/listinfo/python-list


PyCharm settings - per: print('\N{flag: Mauritius}') not supported in py3.9

2021-12-01 Thread dn via Python-list
On 29/11/2021 10.08, dn via Python-list wrote:
> On 29/11/2021 02.18, Chris Angelico wrote:
>> On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer
>>  wrote:
>>
>> Flags are actually constructed from multiple codepoints. What you want
>> is to insert each codepoint separately. You can see them listed in the
>> second column of the table you linked to.
>>
> "\U0001F1F2\U0001F1FA"
>> '🇲🇺'
>>
>> To do this with names, you need the names of those two codepoints:
>>
>> '\U0001f1f2' REGIONAL INDICATOR SYMBOL LETTER M
>> '\U0001f1fa' REGIONAL INDICATOR SYMBOL LETTER U
>>
> "\N{REGIONAL INDICATOR SYMBOL LETTER M}\N{REGIONAL INDICATOR SYMBOL 
> LETTER U}"
>> '🇲🇺'
> 
> 
> Don't use Emojis that often. The colored circles (U+1F534 etc) display
> in full, glorious, technicolor.
> 
> However, when trying the above, with our local flag in (Fedora Linux,
> Gnome) Terminal or PyCharm's Run terminal; the two letters "N" and "Z"
> are shown with dotted-outlines. Similarly, the Mauritius' flag is shown
> as "M" and "U".


Investing a bit of time/waiting for a meeting, found a number of Issues
lodged with JetBrains relating to emoji-support/display:-

Among the most recent advice is to add a "Fallback font" which is known
to include (colored!) emojis.

Thus (this includes personal settings):

File > Settings > Editor > Font
Font = IBM Plex Mono
drop down > Typography Settings
Fallback font = Twemoji

After which, patriotic-pride may be expressed!


However, the Issues (that is to say, those which I had time/energy to
read) indicate that there may still be differences between Linux, Mac,
Windows, and that 'franken-thing' which is Linux on top of Windows but
we don't label it "Linux" so that people still think it is "Windows".


Further wrinkles (drifting OT!):

Fedora 33's Gnome Font Viewer shows:
Emoji One
Noto Color Emoji
Twemoji

- don't ask me the why/when/where of Twemoji
- the other two were added via dnf (yum) today

Neither shows in PyCharm's drop-down list of choices - even after
stop/start (which doesn't appear strictly necessary, per above, but...).


Performed:

fc-cache -fv

and the listing verifies their presence, and ensures all is compos-mentis.

In Writer, all three appear (without prefix). Still only the one appears
in PyCharm. (sigh...)


PS thanks to the OP! Certainly opened my eyes and befuddled (what's left
of) my brain. Was planning to use the aforementioned 'colored circles'
in a PUG coding exercise, but have now amended to require coders to
'wave the flag'. Hopefully they will find such slightly more amusing...
Salute!
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A decade or so of Python programming, and I've never thought to "for-elif"

2021-12-01 Thread Rob Cliffe via Python-list
If for ... else was spelt more intelligibly, e.g. for ... nobreak, there 
would be no temptation to use anything like `elif'. `nobreakif' wouldn't 
be a keyword.

Rob Cliffe

On 30/11/2021 06:24, Chris Angelico wrote:

for ns in namespaces:
 if name in ns:
 print("Found!")
 break
elif name.isupper():
 print("All-caps name that wasn't found")

This actually doesn't work. I have been programming in Python for well
over a decade, and never before been in a situation where this would
be useful.

As YAGNIs go, this is right up there.

(For the record, since this was the last thing in the function, I just
made the break a return. Alternatively, an extra indentation level
"else: if name.isupper():" wouldn't have been that terrible.)

Your random piece of amusement for today.

ChrisA


--
https://mail.python.org/mailman/listinfo/python-list