Joseph Nunn | 6 May 11:42 2016
Picon
Gravatar

Wrong OSX platform in sysconfig.py causing installation problems

Hello Everyone, my first post.  I would also like to subscribe but 
haven't seen how yet.  

So I've an issue with how the 3.5.1 OSX 
package installs on OSX.  The problem was first made apparent 
when trying to create a virtual environment and `pip install ZODB`, 
which failed as clang and the linker could not find either the 
include or lib directories for a dependency.  By adding a -v option
to the compiler options I was able to see in the  compiler flags 
the following:

-isysroot /Developer/SDKs/MacOSX10.6.sdk

Which was not present in the compiler flags of other people 
who I was talking with.  The isysroot flag changes the location 
of includes and libs from the system default, which would be 
why they can't be found.  After grepping around a bit I found 
this file:

/Library/Frameworks/Python.framework/Versions/3.5
/lib/python3.5/_sysconfigdata.py

Within which are many mentions of this flag, as so:

'CONFIGURE_CFLAGS': '-arch i386 -arch x86_64 -isysroot 
/Developer/SDKs/MacOSX10.6.sdk -g',
'CONFIGURE_CFLAGS_NODIST': '-Werror=declaration-after
-statement',
'CONFIGURE_CPPFLAGS': 
'-isysroot /Developer/SDKs/MacOSX10.6.sdk',
(Continue reading)

Stefan Krah | 6 May 00:22 2016

Re: Yearly PyPI breakage

Nick Coghlan <ncoghlan <at> gmail.com> writes:
> I know you're not happy with myself and the other distutils-sig folks
> regarding the decision to deprecate and remove automatic link
> spidering,

More accurately: Not happy with the removal of the checksummed "explicit"
mode. What I would have preferred is a FreeBSD-like ports system. FreeBSD
has been used in huge and secure installations, so the I don't buy the
reliability and security arguments that are used in favor of centralization.
But centralization seems to be a goal in and of itself these days (and
that isn't limited to Python).

> nor with the PSF regarding the current Terms of Service
> around uploads to PyPI, but that doesn't make it OK to start off-topic
> threads on python-dev just because you're a CPython core developer in
> addition to being a PyPI user.

Alexander thought otherwise:

  https://mail.python.org/pipermail/python-dev/2015-October/141840.html

"Given that ensurepip is part of stdlib, I am not sure this is an accurate
statement.  Even if it was, did you make any effort to discuss the proposal
outside of a small group subscribed to distutils ML?"

I completely agree with that.

Fredrik Lundh is also affected (and might not have received any mail,
same as me):

(Continue reading)

zreed | 5 May 20:28 2016

Re: Wordcode: new regular bytecode using 16-bit units

Here is something I wrote because I was also unsatisfied with byteplay's
API: https://github.com/zachariahreed/byteasm. Maybe it's useful in a
discussion of "minimum viable" api for bytecode manipulation.

Deepak Srivastava | 5 May 10:24 2016
Picon

Need help in OCR implementation with Python3.5.1 or pyCharm Community edition


<!-- /* Font Definitions */ <at> font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} <at> font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-priority:99; mso-style-link:"Balloon Text Char"; margin:0in; margin-bottom:.0001pt; font-size:8.0pt; font-family:"Tahoma","sans-serif";} span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;} span.BalloonTextChar {mso-style-name:"Balloon Text Char"; mso-style-priority:99; mso-style-link:"Balloon Text"; font-family:"Tahoma","sans-serif";} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif";} <at> page WordSection1 {size:8.5in 11.0in; margin:70.85pt 70.85pt 56.7pt 70.85pt;} div.WordSection1 {page:WordSection1;} -->

Dear All,

I am new to python and very much excited to learn this technology.

I have done setup of python 3.5.1 with PyCharm community edition on windows 7(64bit service pack 1).

I am trying to execute some piece of code but it fails . Requesting you to please help.

 

My Piece of code is

import pytesseract
from PIL import Image
from PIL import ImageFilter
import os
print (os.getcwd())
url
="Polish.png"
def process_image(url):
   
image = _get_image(url)
    image
= image.filter(ImageFilter.SHARPEN)
#    image = image.convert('1')
   
print (pytesseract.image_to_string(image))

def _get_image(url):
   
return Image.open(url)

process_image(url)

 

Error which I am getting ,

C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\python.exe C:/Temp/Opt/src/ocr.py

C:\Temp\Opt\src

in subprocess

None

0

None

None

<subprocess.STARTUPINFO object at 0x02EA4BF0>

Traceback (most recent call last):

  File "C:/Temp/Opt/src/ocr.py", line 17, in <module>

    process_image(url)

  File "C:/Temp/Opt/src/ocr.py", line 12, in process_image

    print (pytesseract.image_to_string(image))

  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string

    config=config)

  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract

    stderr=subprocess.PIPE)

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 950, in __init__

    restore_signals, start_new_session)

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1226, in _execute_child

    startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

 

Process finished with exit code 1

 

Thanks and Regards

Deepak Srivastava

 

<div>
<div><span></span></div>
<div>
<div><br></div>
<blockquote type="cite"><div>&lt;!--
/* Font Definitions */
 <at> font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 <at> font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
 <at> page WordSection1
	{size:8.5in 11.0in;
	margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--&gt;<div class="WordSection1">
<p class="MsoNormal">Dear All,<p></p></p>
<p class="MsoNormal">I am new to python and very much excited to learn this technology.<p></p></p>
<p class="MsoNormal">I have done setup of python 3.5.1 with PyCharm community edition on windows 7(64bit service pack 1).<p></p></p>
<p class="MsoNormal">I am trying to execute some piece of code but it fails . Requesting you to please help. <p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">My Piece of code is <p></p></p>
<p class="MsoNormal"><span>import </span><span>pytesseract<br></span><span>from </span><span>PIL </span><span>import </span><span>Image<br></span><span>from </span><span>PIL </span><span>import </span><span>ImageFilter<br></span><span>import </span><span>os<br></span><span>print </span><span>(os.getcwd())<br>url</span><span>=</span><span>"Polish.png"<br></span><span>def </span><span>process_image</span><span>(</span><span>url</span><span>)</span><span>:<br>&nbsp;&nbsp;&nbsp; </span><span>image </span><span>= </span><span>_get_image(</span><span>url</span><span>)<br>&nbsp;&nbsp;&nbsp; image </span><span>= </span><span>image.filter(ImageFilter.SHARPEN)<br></span><span>#&nbsp;&nbsp;&nbsp; image = image.convert('1')<br>&nbsp;&nbsp;&nbsp; </span><span>print </span><span>(pytesseract.image_to_string(image))<br><br></span><span>def </span><span>_get_image</span><span>(</span><span>url</span><span>)</span><span>:<br>&nbsp;&nbsp;&nbsp; </span><span>return </span><span>Image.open(</span><span>url</span><span>)<br><br>process_image(url)<p></p></span></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Error which I am getting ,<p></p></p>
<p class="MsoNormal"><span>C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\python.exe C:/Temp/Opt/src/ocr.py<p></p></span></p>
<p class="MsoNormal"><span>C:\Temp\Opt\src<p></p></span></p>
<p class="MsoNormal"><span>in subprocess<p></p></span></p>
<p class="MsoNormal"><span>None<p></p></span></p>
<p class="MsoNormal"><span>0<p></p></span></p>
<p class="MsoNormal"><span>None<p></p></span></p>
<p class="MsoNormal"><span>None<p></p></span></p>
<p class="MsoNormal"><span>&lt;subprocess.STARTUPINFO object at 0x02EA4BF0&gt;<p></p></span></p>
<p class="MsoNormal"><span>Traceback (most recent call last):<p></p></span></p>
<p class="MsoNormal"><span>&nbsp; File "C:/Temp/Opt/src/ocr.py", line 17, in &lt;module&gt;<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; process_image(url)<p></p></span></p>
<p class="MsoNormal"><span>&nbsp; File "C:/Temp/Opt/src/ocr.py", line 12, in process_image<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; print (pytesseract.image_to_string(image))<p></p></span></p>
<p class="MsoNormal"><span>&nbsp; File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; config=config)<p></p></span></p>
<p class="MsoNormal"><span>&nbsp; File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; stderr=subprocess.PIPE)<p></p></span></p>
<p class="MsoNormal"><span>&nbsp; File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 950, in __init__<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; restore_signals, start_new_session)<p></p></span></p>
<p class="MsoNormal"><span>&nbsp; File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1226, in _execute_child<p></p></span></p>
<p class="MsoNormal"><span>&nbsp;&nbsp;&nbsp; startupinfo)<p></p></span></p>
<p class="MsoNormal"><span>FileNotFoundError: [WinError 2] The system cannot find the file specified<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Process finished with exit code 1</span><p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thanks and Regards<p></p></p>
<p class="MsoNormal">Deepak Srivastava<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div>
</div></blockquote>
</div>
</div>
Picon

Restore functions pickling

Hello,

I was recently porting my application from Py2 to Py3 and encountered error, when I accidentally became unable to define my own pickling mechanism for functions.
Before that I was using it to pickle pure lambdas, registering my own handler for cPickle with copy_reg, but after [1] (and release 3.4) it seems that feature has been removed.

As it mentioned in commit message, this was done for compatibility with pure-python pickle. So I have to ask, may be it would be better to revert the commit and add the corresponding feature to pure-python pickle implementation?


[1] https://hg.python.org/cpython/rev/6bd1f0a27e8e

--
Best wishes,
Vsevolod Velichko
<div><div dir="ltr">
<div>
<div>
<div>
<div>Hello,<br><br>
</div>I was recently porting my application from Py2 to Py3 and encountered error, when I accidentally became unable to define my own pickling mechanism for functions.<br>
</div>Before that I was using it to pickle pure lambdas, registering my own handler for cPickle with copy_reg, but after [1] (and release 3.4) it seems that feature has been removed.<br>
</div>
<br>As it mentioned in commit message, this was done for compatibility with pure-python pickle. So I have to ask, may be it would be better to revert the commit and add the corresponding feature to pure-python pickle implementation?<br>
</div>
<div>
<br><div>
<br>[1] <a href="https://hg.python.org/cpython/rev/6bd1f0a27e8e">https://hg.python.org/cpython/rev/6bd1f0a27e8e</a><br clear="all"><div><div><div><div><div>
<br>-- <br><div class="gmail_signature"><div dir="ltr">
<div>Best wishes,<br>
</div>Vsevolod Velichko<br>
</div></div>
</div></div></div></div></div>
</div>
</div>
</div></div>
Stefan Krah | 3 May 21:06 2016

Yearly PyPI breakage


Hello,

Could someone enlighten me which hoops I have to jump through
this year in order to keep pip downloads working?

Collecting cdecimal
  Could not find a version that satisfies the requirement cdecimal (from
versions: )
No matching distribution found for cdecimal
You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

If this continues, I'm going to release a premium version that's
50% faster and only available from bytereef.org or Anaconda.

Stefan Krah

Benjamin Peterson | 3 May 18:07 2016
Gravatar

2.7.12 schedule

I have been reminded that we are due for a 2.7.12 release. I think
Larry's 3.5.2 schedule is perfectly cromulent and am going to piggyback.
Therefore, 2.7.12rc1 will be on June 11th, and the final will be on June
25.

Servus,
Benjamin
Burkhard Meier | 1 May 23:11 2016
Picon

Looking for a Python programming mentor

I don't need Sigmund Freud...


Burkhard
<div>
<p>I don't need Sigmund Freud...</p>
<div><br></div>
<div>Burkhard</div>
</div>
Burkhard Meier | 1 May 10:47 2016
Picon

Memory

~
Die Scheibe klirrt
der Spontie kichert
~
hoffentlich
Alliiance versichert...
~

<div><div dir="ltr">~<div>Die Scheibe klirrt</div>
<div>der Spontie kichert</div>
<div>~</div>
<div>hoffentlich</div>
<div>Alliiance versichert...</div>
<div>~</div>
<div>
<a href="https://youtu.be/m3SjCzA71eM">https://youtu.be/m3SjCzA71eM</a><br>
</div>
<div><br></div>
</div></div>
Greg Ewing | 1 May 03:22 2016
Picon
Picon

Bug in 2to3 concerning import statements?

It seems that 2to3 is a bit simplistic when it comes to
translating import statements. I have a module GUI.py2exe
containing:

    import py2exe.mf as modulefinder

2to3 translates this into:

    from . import py2exe.mf as modulefinder

which is a syntax error.

It looks like 2to3 is getting confused by the fact that
there is both a submodule and a top-level module here
called py2exe. But the original can only be an absolute
import because it has a dot in it, so 2to3 shouldn't be
translating it into a relative one.

Putting "from __future__ import absolute_import" at the
top fixes it, but I shouldn't have to do that, should I?

--

-- 
Greg
Marcos Dione | 29 Apr 20:11 2016
Picon
Gravatar

Re: Convert int() to size_t in Python/C

On Fri, Apr 29, 2016 at 12:18:46PM -0400, Random832 wrote:
> On Fri, Apr 29, 2016, at 10:45, Marcos Dione wrote:
> >     One possible solution hat was suggested to me in the #python IRC
> > channel was to use that, then test if the resulting value is negative,
> > and adjust accordingly, but I wonder if there is a cleaner, more general
> > solution (for instance, what if the type was something else, like loff_t,
> > although for that one in particular there *is* a convertion
> > function/macro).
> 
> In principle, you could just use PyLong_AsUnsignedLong (or LongLong),
> and raise OverflowError manually if the value happens to be out of
> size_t's range. (99% sure that on every linux platform unsigned long is
> the same size as size_t.
> 
> But it's not like it'd be the first function in OS to call a system call
> that takes a size_t. Read just uses Py_ssize_t. Write uses the buffer
> protocol, which uses Py_ssize_t. How concerned are you really about the
> lost range here? What does the system call return (its return type is
> ssize_t) if it writes more than SSIZE_MAX bytes? (This shouldn't be hard
> to test, just try copying a >2GB file on a 32-bit system)

    It's a very good point, but I don't have any 32 bits systems around
with a kernel-4.5. I'll try to figure it out and/or ask in the kernel ML.

> I'm more curious about what your calling convention is going to be for
> off_in and off_out. I can't think of any other interfaces that have
> optional output parameters. Python functions generally deal with output
> parameters in the underlying C function (there are a few examples in
> math) by returning a tuple.

    These are not output parameters, even if they're pointers. they'r
using the NULL pointer to signal that the current offsets should not be
touched, to differentiate from a offset of 0. Something that in Python we
would use None.

Gmane