Re: [pypy-dev] pip installation for pypy is slow

2021-11-28 Thread Hao Wang
Thanks Matti, I switched to Cython due to PyPy's incompatibility with pandas 
(The error is given below. If you know how to fix this, please let me know.)

cpyext, the emulation layer, detected that while it is calling
an object's tp_dealloc, the C code calls back a function that
tries to recreate the PyPy version of the object.  Usually it
means that tp_dealloc calls some general PyXxx() API.  It is
a dangerous and potentially buggy thing to do: even in CPython
the PyXxx() function could, in theory, cause a reference to the
object to be taken and stored somewhere, for an amount of time
exceeding tp_dealloc itself.  Afterwards, the object will be
freed, making that reference point to garbage.
>>> PyPy could contain some workaround to still work if
you are lucky, but it is not done so far; better fix the bug in
the CPython extension.
>>> This object is of type 'pandas._libs.parsers.TextReader'
Aborted

From: pypy-dev  on behalf of Matti 
Picus 
Sent: Monday, November 29, 2021 12:31 AM
To: pypy-dev@python.org 
Subject: Re: [pypy-dev] pip installation for pypy is slow

On 29/11/21 6:01 am, Hao Wang wrote:

> Dear pypy-devs,
>
> The pip installation of pypy (pypy -m pip install scipy, for example)
> is slower than python-pip clean. Is there a way to fix this problem ?
>
> Bravo!
> Hao Wang
>

Thanks for giving PyPy a try. When pre-compiled binary wheels are not
available, python must compile from source. This takes time. We have
been making an effort to convince project maintainers to provide binary
wheels for PyPy. SciPy has a complicated workflow and a skeleton support
team. That together with the fact that currently PyPy + SciPy is much
slower to run CI (small snippets of code run in tests are not PyPy's
strong point, and the c-api emulation layer makes things worse) mean
that SciPy is hesitant to add support for PyPy, see the PR where the CI
runs were removed [0] in 2019.


Our long-term proposal to solve this problem is to get pybind11 (for c++
code), cython (for c code), and f2py (for fortran code) to generate
wrappers using HPy [1] instead of the C-API, which will speed up testing
with PyPy.  A second possibility is that the scientific python community
will move away from its heavy dependency on the CPython C-API and more
towards using higher-level protocols [4]. Both of these efforts will
take many years unless heavily sponsored.


A more specific short-term solution for your installation problem is to
use conda-forge's miniforge [3]. This will solve the installation
problem, but PyPy will still be slow on scipy-heavy workflows. The
conda-forge project supplies binary packages for pypy3.7, and is
discussing pypy3.8 support [2]:


conda create -n pypy3.7 pypy

conda activate pypy3.7

conda install scipy


Matti


[0] https://github.com/scipy/scipy/pull/10085

[1] https://hpyproject.org/

[2] https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/2089

[3] https://github.com/conda-forge/miniforge

[4] https://labs.quansight.org/blog/2021/11/pydata-extensibility-vision/

___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip installation for pypy is slow

2021-11-28 Thread Matti Picus

On 29/11/21 6:01 am, Hao Wang wrote:


Dear pypy-devs,

The pip installation of pypy (pypy -m pip install scipy, for example) 
is slower than python-pip clean. Is there a way to fix this problem ?


Bravo!
Hao Wang



Thanks for giving PyPy a try. When pre-compiled binary wheels are not 
available, python must compile from source. This takes time. We have 
been making an effort to convince project maintainers to provide binary 
wheels for PyPy. SciPy has a complicated workflow and a skeleton support 
team. That together with the fact that currently PyPy + SciPy is much 
slower to run CI (small snippets of code run in tests are not PyPy's 
strong point, and the c-api emulation layer makes things worse) mean 
that SciPy is hesitant to add support for PyPy, see the PR where the CI 
runs were removed [0] in 2019.



Our long-term proposal to solve this problem is to get pybind11 (for c++ 
code), cython (for c code), and f2py (for fortran code) to generate 
wrappers using HPy [1] instead of the C-API, which will speed up testing 
with PyPy.  A second possibility is that the scientific python community 
will move away from its heavy dependency on the CPython C-API and more 
towards using higher-level protocols [4]. Both of these efforts will 
take many years unless heavily sponsored.



A more specific short-term solution for your installation problem is to 
use conda-forge's miniforge [3]. This will solve the installation 
problem, but PyPy will still be slow on scipy-heavy workflows. The 
conda-forge project supplies binary packages for pypy3.7, and is 
discussing pypy3.8 support [2]:



conda create -n pypy3.7 pypy

conda activate pypy3.7

conda install scipy


Matti


[0] https://github.com/scipy/scipy/pull/10085

[1] https://hpyproject.org/

[2] https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/2089

[3] https://github.com/conda-forge/miniforge

[4] https://labs.quansight.org/blog/2021/11/pydata-extensibility-vision/

___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] pip installation for pypy is slow

2021-11-28 Thread Hao Wang
Dear pypy-devs,

The pip installation of pypy (pypy -m pip install scipy, for example) is slower 
than python-pip clean. Is there a way to fix this problem ?

Bravo!
Hao Wang
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pip fails to work

2018-03-24 Thread Matti Picus

On 24/03/18 10:27, Grant Shepherd wrote:


PyPy needs more effort cleaning up how it relates info on its website 
providing better directions on overcoming its reliance on a specific 
versions of the OpenSSL library.


I have been working in I.T. for 30 years and I know when I see a 
something that needs better explanation.


I tried a few different tactics with pre-compiled binaries, symlink 
tricks and straight up compiling and still could not overcome the 
issue of getting PyPy 3 to work for Pip and SSL on CentOS 7.


And Googling the problem did not help either which is why I emailed 
the mailing list which I never do ever..


In the end I used Squeaky's portable Linux binaries which performed 
27% slower then CPython in my Website Stack testing.


So I had a bad experience with PyPy, I don’t see how that helps a 
project get followers and grow its reputation…





Sorry to disappoint. Please let us know which part of the website you 
find unclear so that we can improve.



If you have an easily repeatable benchmark we can replicate, it might 
help us make PyPy faster.


Matti

___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pip fails to work

2018-03-24 Thread Grant Shepherd
 

PyPy needs more effort cleaning up how it relates info on its website providing 
better directions on overcoming its reliance on a specific versions of the 
OpenSSL library.

I have been working in I.T. for 30 years and I know when I see a something that 
needs better explanation.

 

I tried a few different tactics with pre-compiled binaries, symlink tricks and 
straight up compiling and still could not overcome the issue of getting PyPy 3 
to work for Pip and SSL on CentOS 7.

And Googling the problem did not help either which is why I emailed the mailing 
list which I never do ever..

In the end I used Squeaky's portable Linux binaries which performed 27% slower 
then CPython in my Website Stack testing.

 

So I had a bad experience with PyPy, I don’t see how that helps a project get 
followers and grow its reputation…

 

 

From: Ryan Gonzalez [mailto:rym...@gmail.com] 
Sent: Tuesday, 20 March 2018 5:27 PM
To: Grant Shepherd
Cc: pypy-dev@python.org
Subject: Re: [pypy-dev] Pip fails to work

 

Did you build PyPy yourself? If so, you didn't compile the ssl module. Not 
really PyPy's fault...

 

OTOH if this is a distro package/binary, where did you get it from? You can try 
the portable PyPy binaries: https://github.com/squeaky-pl/portable-pypy

-- Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> 
everyone else https://refi64.com/


On Mon, Mar 19, 2018 at 4:33 PM, Grant Shepherd <grant.shephe...@gmail.com 
<mailto:grant.shephe...@gmail.com> > wrote:



PyPy seems like a great python version

 

Except the extremely painful effort trying to get pip to work

 

Can't connect to HTTPS URL because the SSL module is not available. - skipping

 

 

___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pip fails to work

2018-03-20 Thread Ryan Gonzalez
Did you build PyPy yourself? If so, you didn't compile the ssl module. 
Not really PyPy's fault...


OTOH if this is a distro package/binary, where did you get it from? You 
can try the portable PyPy binaries: 
https://github.com/squeaky-pl/portable-pypy

--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/

On Mon, Mar 19, 2018 at 4:33 PM, Grant Shepherd 
 wrote:

PyPy seems like a great python version

Except the extremely painful effort trying to get pip to work

Can't connect to HTTPS URL because the SSL module is not available. - 
skipping



___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] Pip fails to work

2018-03-20 Thread Grant Shepherd
PyPy seems like a great python version

Except the extremely painful effort trying to get pip to work

Can't connect to HTTPS URL because the SSL module is not available. -
skipping
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pip Install Fails Due to cppyy-backend setup.py Bug

2017-09-27 Thread wlavrijsen

Parker,

thanks! Both (encoding and tracker) are now fixed.

Best regards,
   Wim
--
wlavrij...@lbl.gov--+1 (510) 486 6411--www.lavrijsen.net
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] Pip Install Fails Due to cppyy-backend setup.py Bug

2017-09-27 Thread Parker Boyce
I recently had reason to try to install cppyy using Python 3 and pip. With
the use of the wheels for cppyy-cling the process went smoothly enough
until pip tried to build cppyy-backend
. Building this package
by itself results in the following error message;

$ python3 setup.py build
running build
running build_ext
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g -fstack-protector-strong -Wformat
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
-Ib'/usr/local/lib/python3.5/dist-packages/cppyy_backend/include'
-I/usr/include/python3.5m -c src/clingwrapper.cxx -o
build/temp.linux-x86_64-3.5/src/clingwrapper.o -std=c++11 -O2
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
C/ObjC but not for C++
In file included from src/clingwrapper.cxx:4:0:
src/callcontext.h:11:20: fatal error: Rtypes.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

A careful look at the command line argument for gcc reveals a mangled
include argument,
-Ib'/usr/local/lib/python3.5/dist-packages/cppyy_backend/include'. This is
a binary literal string introduced by the output of a system call,
"cling-config --cppflags". The functions in the subprocess module return
'bytes' objects in Python 3. In this case the return value from
'check_output' was appended wholesale into the 'include_dirs' argument of
your extension, and the representation thereof was used in turn to build
the function call to gcc. (The representation being a binary literal string)

To fix this the bytes object returned by subprocess.check_output needs to
be decoded to either 'utf-8' or 'ascii', preferably the former as Python 3
uses unicode literals. This can be accomplished by appending
'.decode("utf-8")' to line 28;

--- /home/parker/Documents/cppyy/cppyy-backend-0.2.0/setup.py Fri Sep 22
12:25:29 2017
+++ /home/parker/Documents/cppyy/cppyy-backend-0.2.0/setup.py.patched Tue
Sep 26 19:37:50 2017
@@ -25,7 +25,7 @@
 if root_install:
 return os.path.join(root_install, 'include')
 cli_arg = subprocess.check_output(['cling-config', '--cppflags'])
-return cli_arg[2:-1]
+return cli_arg[2:-1].decode("utf-8")

 class my_build_cpplib(_build_ext):
 def build_extension(self, ext):

With this patch pip will be able to build the cppyy-backend package from
source on Python 2 or 3, and pip installing cppyy will not require user
intervention.

P.S. The "Comments and Bugs" section of the cppyy docs directs the reader
to a repository with issue tracking turned off, which is why you're getting
this email instead.
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip install rbtree fail in pypy env!

2013-11-02 Thread KaShining
I found bintrees-fastrbtree is the best choice:

(some test code:
def test_dict(tree, msg):
begin = time.time()
for i in range(10):
k = random.randint(0, 1000)
tree[k] = k
end = time.time()

print msg,end - begin
)

bintrees_rbtree under cpython0.393133878708
bintrees_fast_rbtree under pypy 0.357424020767


-- Original --
From:  Armin Rigo;ar...@tunes.org;
Date:  Fri, Nov 1, 2013 05:06 PM
To:  KaShiningmail2sh...@qq.com; 
Cc:  Dan Strombergdrsali...@gmail.com; pypy-devpypy-dev@python.org; 
Subject:  Re: [pypy-dev] pip install rbtree fail in pypy env!



Hi KaShining,

Yes, the issue then is that pure Python equivalents are often slower
than their C version --- for example, this red_black_tree_mod file is
huge for the job (more than 1000 lines), written in a Java-ish style
with tons of small overridden methods, but full of properties,
recursive function invocations, and so on.  Getting 10 times slower
than the C version is not good, but I guess that the C version was
more optimized.  Often we can hope to get at most a few times slower.

PyPy is not faster at everything.  Usually there is no way it can be
faster than a program that exercices only a CPython C extension
module.  In some cases like this one, the solutions you have with PyPy
are all a lot slower --- both some pure Python version, and the cpyext
version.  The pure Python version could be rewritten with
performance-on-PyPy in mind (just like the C version was written with
performance-on-CPython in mind).

Note that the point of red_black_tree_mod is very unclear to me.  It
seems to replace plain dicts.  Why can't you use plain dicts?


A bientôt,

Armin.___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] pip install rbtree fail in pypy env!

2013-10-31 Thread KaShining
pypy 2.1

pip install rbtree

Downloading/unpacking rbtree
  Running setup.py egg_info for package rbtree

Installing collected packages: rbtree
  Running setup.py install for rbtree
building 'rbtree' extension
cc -O2 -fPIC -Wimplicit -I./src -I/pypy/include -c src/rbtree_impl.c -o 
build/temp.linux-x86_64-2.7/src/rbtree_impl.o
cc -O2 -fPIC -Wimplicit -I./src -I/pypy/include -c src/rbtree.c -o 
build/temp.linux-x86_64-2.7/src/rbtree.o
src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':
src/rbtree.c:2427:48: error: 'PyRange_Type' undeclared (first use in this 
function)
src/rbtree.c:2427:48: note: each undeclared identifier is reported only 
once for each function it appears in
src/rbtree.c: In function '__Pyx_GetException':
src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'
src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'
src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'
src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'
src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'
src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'
src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'
src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'
src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 
'exc_traceback'
src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 
'exc_traceback'
src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 
'exc_traceback'
src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 
'exc_traceback'
src/rbtree.c:4996:11: error: 'PyThreadState' has no member named 'exc_type'
src/rbtree.c:4997:11: error: 'PyThreadState' has no member named 'exc_value'
src/rbtree.c:4998:11: error: 'PyThreadState' has no member named 
'exc_traceback'
error: command 'cc' failed with exit status 1
Complete output from command /pypy/bin/pypy -c import 
setuptools;__file__='/pypy/build/rbtree/setup.py';exec(compile(open(__file__).read().replace('\r\n',
 '\n'), __file__, 'exec')) install --single-version-externally-managed 
--record /tmp/pip-s2EnAa-record/install-record.txt --install-headers 
/pypy/include/site/python2.7:
running install

running build

running build_ext

building 'rbtree' extension

cc -O2 -fPIC -Wimplicit -I./src -I/pypy/include -c src/rbtree_impl.c -o 
build/temp.linux-x86_64-2.7/src/rbtree_impl.o

cc -O2 -fPIC -Wimplicit -I./src -I/pypy/include -c src/rbtree.c -o 
build/temp.linux-x86_64-2.7/src/rbtree.o

src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':

src/rbtree.c:2427:48: error: 'PyRange_Type' undeclared (first use in this 
function)

src/rbtree.c:2427:48: note: each undeclared identifier is reported only once 
for each function it appears in

src/rbtree.c: In function '__Pyx_GetException':

src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'

src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'

src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'

src/rbtree.c:4993:5: error: 'PyThreadState' has no member named 'exc_type'

src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'

src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'

src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'

src/rbtree.c:4994:5: error: 'PyThreadState' has no member named 'exc_value'

src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 'exc_traceback'

src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 'exc_traceback'

src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 'exc_traceback'

src/rbtree.c:4995:5: error: 'PyThreadState' has no member named 'exc_traceback'

src/rbtree.c:4996:11: error: 'PyThreadState' has no member named 'exc_type'

src/rbtree.c:4997:11: error: 'PyThreadState' has no member named 'exc_value'

src/rbtree.c:4998:11: error: 'PyThreadState' has no member named 'exc_traceback'

error: command 'cc' failed with exit status 1


Command /pypy/bin/pypy -c import 
setuptools;__file__='/pypy/build/rbtree/setup.py';exec(compile(open(__file__).read().replace('\r\n',
 '\n'), __file__, 'exec')) install --single-version-externally-managed 
--record /tmp/pip-s2EnAa-record/install-record.txt --install-headers 
/pypy/include/site/python2.7 failed with error code 1 in /pypy/build/rbtree
Storing complete log in /home/chenjiaming/.pip/pip.log___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip install rbtree fail in pypy env!

2013-10-31 Thread Armin Rigo
Hi KaShining,

On Thu, Oct 31, 2013 at 9:32 AM, KaShining mail2sh...@qq.com wrote:
 src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':

This is using Cython.  Compiling Cython modules with PyPy
kind-of-works but is shaky.  You may have more luck if you upgrade
Cython to the latest version, but I don't know the details myself.

Note that according to the name rbtree, it's about a data structure
that --- I guess --- is meant to contain tons of references to Python
objects.  This is a typical example of a program that will be
incredibly slower on PyPy if used as a C extension module (via
cpyext).  You'd get much better results by running a pure Python
version of it.  Check rbtree to see if it already has a pure Python
version.


A bientôt,

Armin.
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip install rbtree fail in pypy env!

2013-10-31 Thread KaShining
Tks!

but

This is a typical example of a program that will be
incredibly slower on PyPy if used as a C extension module (via
cpyext). 


why?




-- Original --
From:  Armin Rigo;ar...@tunes.org;
Date:  Thu, Oct 31, 2013 04:53 PM
To:  KaShiningmail2sh...@qq.com; 
Cc:  pypy-devpypy-dev@python.org; 
Subject:  Re: [pypy-dev] pip install rbtree fail in pypy env!



Hi KaShining,

On Thu, Oct 31, 2013 at 9:32 AM, KaShining mail2sh...@qq.com wrote:
 src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':

This is using Cython.  Compiling Cython modules with PyPy
kind-of-works but is shaky.  You may have more luck if you upgrade
Cython to the latest version, but I don't know the details myself.

Note that according to the name rbtree, it's about a data structure
that --- I guess --- is meant to contain tons of references to Python
objects.  This is a typical example of a program that will be
incredibly slower on PyPy if used as a C extension module (via
cpyext).  You'd get much better results by running a pure Python
version of it.  Check rbtree to see if it already has a pure Python
version.


A bientôt,

Armin.___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip install rbtree fail in pypy env!

2013-10-31 Thread Amaury Forgeot d'Arc
2013/10/31 KaShining mail2sh...@qq.com

 Tks!

 but

 
 This is a typical example of a program that will be
 incredibly slower on PyPy if used as a C extension module (via
 cpyext).
 

 why?


See this blog post:
http://morepypy.blogspot.ch/2011/05/numpy-follow-up.html
specially the paragraph starting with cpyext is slow





 -- Original --
 *From: * Armin Rigo;ar...@tunes.org;
 *Date: * Thu, Oct 31, 2013 04:53 PM
 *To: * KaShiningmail2sh...@qq.com; **
 *Cc: * pypy-devpypy-dev@python.org; **
 *Subject: * Re: [pypy-dev] pip install rbtree fail in pypy env!

 Hi KaShining,

 On Thu, Oct 31, 2013 at 9:32 AM, KaShining mail2sh...@qq.com wrote:
  src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':

 This is using Cython.  Compiling Cython modules with PyPy
 kind-of-works but is shaky.  You may have more luck if you upgrade
 Cython to the latest version, but I don't know the details myself.

 Note that according to the name rbtree, it's about a data structure
 that --- I guess --- is meant to contain tons of references to Python
 objects.  This is a typical example of a program that will be
 incredibly slower on PyPy if used as a C extension module (via
 cpyext).  You'd get much better results by running a pure Python
 version of it.  Check rbtree to see if it already has a pure Python
 version.


 A bientôt,

 Armin.

 ___
 pypy-dev mailing list
 pypy-dev@python.org
 https://mail.python.org/mailman/listinfo/pypy-dev




-- 
Amaury Forgeot d'Arc
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip install rbtree fail in pypy env!

2013-10-31 Thread Dan Stromberg
On Thu, Oct 31, 2013 at 1:53 AM, Armin Rigo ar...@tunes.org wrote:

 Hi KaShining,

 On Thu, Oct 31, 2013 at 9:32 AM, KaShining mail2sh...@qq.com wrote:
  src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':

 This is using Cython.  Compiling Cython modules with PyPy
 kind-of-works but is shaky.


Here's a pure python red black tree:
https://pypi.python.org/pypi/red-black-tree-mod

Full disclosure: I put it on Pypi after getting it passing pylint and such.
___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] pip install rbtree fail in pypy env!

2013-10-31 Thread KaShining
tks,but 

test-red_black_dict_mod.py under pypy-2.1. consume :3.89574193954
import sys
import red_black_dict_mod
import time
import random


t = red_black_dict_mod.RedBlackTree()

begin = time.time()
for i in range(10):
k = random.randint(0, 1000)
t[k] = k
end = time.time()

print end - begin



while

test-rbtree.py under python2.7.3 .consume:0.35432600975
import sys
import rbtree
import time
import random


t = rbtree.rbtree()

begin = time.time()
for i in range(10):
k = random.randint(0, 1000)
t[k] = k
end = time.time()

print end - begin

-- Original --
From:  Dan Stromberg;drsali...@gmail.com;
Date:  Fri, Nov 1, 2013 06:29 AM
To:  Armin Rigoar...@tunes.org; 
Cc:  KaShiningmail2sh...@qq.com; pypy-devpypy-dev@python.org; 
Subject:  Re: [pypy-dev] pip install rbtree fail in pypy env!




On Thu, Oct 31, 2013 at 1:53 AM, Armin Rigo ar...@tunes.org wrote:
 Hi KaShining,
 
 On Thu, Oct 31, 2013 at 9:32 AM, KaShining mail2sh...@qq.com wrote:
  src/rbtree.c: In function '__pyx_f_6rbtree_6rbtree_byOffset':
 
 This is using Cython.  Compiling Cython modules with PyPy
 kind-of-works but is shaky.
 

Here's a pure python red black tree:
https://pypi.python.org/pypi/red-black-tree-mod
 



Full disclosure: I put it on Pypi after getting it passing pylint and such.___
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] pip

2012-02-29 Thread Aroldo Souza-Leite

Hi list,

I'm getting an error when trying to easy_install pip in PyPy (nightly
 build). The error doesn't occur in PyPy-1.8.

Thanks.

Aroldo.

---

(pypy)root@aroldo-laptop:/opt/pypy/bin# which python
/opt/pypy//bin/python
(pypy)root@aroldo-laptop:/opt/pypy/bin# which easy_install
/opt/pypy//bin/easy_install

(pypy)root@aroldo-laptop:/opt/pypy/bin# easy_install  pip
...
Adding pip 1.1 to easy-install.pth file
Installing pip script to /opt/pypy/bin
Installing pip-2.7 script to /opt/pypy/bin

Installed 
/opt/pypy-c-jit-53000-836fcc2fe8d8-linux/site-packages/pip-1.1-py2.7.

egg
Processing dependencies for pip
Finished processing dependencies for pip
Traceback (most recent call last):
  File app_main.py, line 51, in run_toplevel
  File /opt/pypy/lib-python/2.7/gzip.py, line 371, in flush
self._check_closed()
  File /opt/pypy/lib-python/2.7/gzip.py, line 146, in _check_closed
raise ValueError('I/O operation on closed file.')
ValueError: I/O operation on closed file.
(pypy)root@aroldo-laptop:/opt/pypy/bin#
___
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pip, Pypy, and Win7

2011-11-30 Thread Leonardo Santagada
On Tue, Nov 29, 2011 at 8:53 PM, Yaacov Finkelman
yeomanyaa...@gmail.com wrote:
 Thank You!

 pip.exe and pip-2.7.exe are indeed in a subfolder called bin. Can we
 add that to the new version of the docs?

 When should I be using pip vs. using pip-2.7?

Doesn't matter, both will use pypy-1.7. The two binaries is in the
case you have many python versions and whant to use the specific pip
of one then you use the one with the version in the end.


-- 
Leonardo Santagada
___
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev


[pypy-dev] Pip, Pypy, and Win7

2011-11-29 Thread Yaacov Finkelman
I've been a complete fanboy to Pypy for the past couple of months.
After the official Sprint started I was checking the blog every couple
of hours to see what wonderful and fascinating ideas people were
working on implementing. I just want to thank you all for helping with
this fascinating project.

I was hoping to get some help.
I have been trying to follow these
(http://doc.pypy.org/en/latest/getting-started.html#installing-pypy)
instructions to install pip on Pypy on my Win7 computer.

$ curl -O http://python-distribute.org/distribute_setup.py

So I downloaded that file and saved it to my Pypy directory C:\pypy-1.7\

$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py

So I downloaded that file and saved it to my Pypy directory C:\pypy-1.7\

$ ./pypy-1.6/bin/pypy distribute_setup.py

Run this file with Pypy. (Runs with no errors)

$ ./pypy-1.6/bin/pypy get-pip.py

Run that file with Pypy. (Runs with no errors)

$ ./pypy-1.6/bin/pip install pygments # for example

I am not sure how to translate this Instruction. There is no
executable Pip in my Pypy folder. How do I actually install something
with pip?

Jacob
___
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev


Re: [pypy-dev] Pip, Pypy, and Win7

2011-11-29 Thread Leonardo Santagada
On Tue, Nov 29, 2011 at 8:20 PM, Yaacov Finkelman
yeomanyaa...@gmail.com wrote:
 $ ./pypy-1.6/bin/pip install pygments # for example

 I am not sure how to translate this Instruction. There is no
 executable Pip in my Pypy folder. How do I actually install something
 with pip?

 Jacob


first, try pypy-1.7 that was just released for windows. Also in
windows I think pip will be in a subfolder named Scripts no bin.


-- 
Leonardo Santagada
___
pypy-dev mailing list
pypy-dev@python.org
http://mail.python.org/mailman/listinfo/pypy-dev