Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #94541 > unrolled thread

Python Questions - July 25, 2015

Started by"E.D.G." <edgrsprj@ix.netcom.com>
First post2015-07-25 04:39 -0500
Last post2015-07-29 00:43 -0700
Articles 20 on this page of 42 — 13 participants

Back to article view | Back to comp.lang.python


Contents

  Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-25 04:39 -0500
    Python Questions - July 25, 2015 tandrewjohnson@outlook.com - 2015-07-25 04:36 -0700
      Python Questions - July 25, 2015 tandrewjohnson@outlook.com - 2015-07-25 04:39 -0700
      Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-25 08:16 -0500
        Re: Python Questions - July 25, 2015 Laura Creighton <lac@openend.se> - 2015-07-25 15:59 +0200
          Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-26 12:49 -0500
            Re: Python Questions - July 25, 2015 Laura Creighton <lac@openend.se> - 2015-07-26 20:38 +0200
              Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-26 13:48 -0500
      Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-26 13:49 +0100
        Re: Python Questions - July 25, 2015 Chris Angelico <rosuav@gmail.com> - 2015-07-26 23:07 +1000
          Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-26 15:30 +0100
        Re: Python Questions - July 25, 2015 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-26 14:19 +0100
        Re: Python Questions - July 25, 2015 Steven D'Aprano <steve@pearwood.info> - 2015-07-27 00:22 +1000
          Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-26 15:58 +0100
        Re: Python Questions - July 25, 2015 Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-07-27 23:14 +0000
          Re: Python Questions - July 25, 2015 Terry Reedy <tjreedy@udel.edu> - 2015-07-28 04:50 -0400
            Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-28 10:46 +0100
              Re: Python Questions - July 25, 2015 Chris Angelico <rosuav@gmail.com> - 2015-07-28 20:17 +1000
                Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-28 11:44 +0100
                  Re: Python Questions - July 25, 2015 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-28 13:47 +0100
                  Re: Python Questions - July 25, 2015 Steven D'Aprano <steve@pearwood.info> - 2015-07-29 02:02 +1000
              Re: Python Questions - July 25, 2015 Steven D'Aprano <steve@pearwood.info> - 2015-07-29 02:12 +1000
                Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-28 17:45 +0100
                  Re: Python Questions - July 25, 2015 Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-07-28 18:46 +0000
                  Re: Python Questions - July 25, 2015 Laura Creighton <lac@openend.se> - 2015-07-29 18:13 +0200
                    Re: Python Questions - July 25, 2015 BartC <bc@freeuk.com> - 2015-07-29 17:50 +0100
            Re: Python Questions - July 25, 2015 wxjmfauth@gmail.com - 2015-07-28 07:09 -0700
          Re: Python Questions - July 25, 2015 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-28 13:58 +0100
    Re: Python Questions - July 25, 2015 Laura Creighton <lac@openend.se> - 2015-07-25 15:30 +0200
      Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-25 08:45 -0500
    Re: Python Questions - July 25, 2015 tjohnson <tandrewjohnson@outlook.com> - 2015-07-25 15:16 -0700
    Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-26 14:17 -0500
      Re: Python Questions - July 25, 2015 mm0fmf <none@mailinator.com> - 2015-07-26 22:15 +0100
        Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-26 17:08 -0500
          Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-26 17:32 -0500
        Re: Python Questions - July 25, 2015 Ned Batchelder <ned@nedbatchelder.com> - 2015-07-26 16:12 -0700
          Re: Python Questions - July 25, 2015 "E.D.G." <edgrsprj@ix.netcom.com> - 2015-07-26 18:58 -0500
            Re: Python Questions - July 25, 2015 Laura Creighton <lac@openend.se> - 2015-07-27 11:15 +0200
          Re: Python Questions - July 25, 2015 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-27 01:18 +0100
            Re: Python Questions - July 25, 2015 mm0fmf <none@mailinator.com> - 2015-07-27 17:46 +0100
      Re: Python Questions - July 25, 2015 tjohnson <tandrewjohnson@outlook.com> - 2015-07-27 03:24 -0700
        Re: Python Questions - July 25, 2015 wxjmfauth@gmail.com - 2015-07-29 00:43 -0700

Page 1 of 3  [1] 2 3  Next page →


#94541 — Python Questions - July 25, 2015

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-07-25 04:39 -0500
SubjectPython Questions - July 25, 2015
Message-ID<jf6dnQiMOZ_GxC7InZ2dnUU7-S2dnZ2d@earthlink.com>
Posted by E.D.G. July 25, 2015

       This posting involves general interest matters and some specific 
questions regarding Python code usage.  Any help would be appreciated.

1. Program conversion effort
2. Specific code questions


1.  PROGRAM CONVERSION EFFORT

       An effort is underway by several people including myself to convert a 
complex Perl language program to some other language such as Python so that, 
among other things, the program's numerous calculations will run faster.

       Perl with the PDL module would probably work.  But we could not get 
the needed type of support for the PDL module.  We also looked at Julia and 
several versions of Basic.  But they also did not appear to presently have 
the type of support that is needed.

       Fortran was tried.  It is great for calculation speed and the Fortran 
users were quite helpful.  But we could not get certain important questions 
answered regarding using Fortran to create Windows "Pipes" to other running 
programs etc.

       We are presently checking to see if Python has the needed features 
and adequate support from Python newsgroups or forums.

       At the moment our Perl programs use Windows "Pipes" plus files in an 
interactive mode to send data to Gnuplot so that the data can be plotted. 
That actually produces good results.  But it is a complex and inefficient 
process.  So part of the conversion process involves learning how to have 
Python or some other program plot data in the same interactive mode.

       In this case "interactive" means that when a chart is being displayed 
on the computer screen for example, a key such as a Right Arrow Key can be 
pressed.  My main Perl program checks for key presses perhaps 10 times a 
second and if it detects one it sends the appropriate information to Gnuplot 
through a "Pipe" so that Gnuplot will open some data file and use its 
contents to draw a new chart.  That redrawing process on a moderately fast 
computer occurs so rapidly the transition cannot even be seen.

       The Perl program does not simply wait for a key to be pressed because 
it is at times processing data in the background.

       It has been my experience that sending large amounts of data from one 
program to another using a Windows pipe doesn't work very well.  So files 
are presently being used for bulk data transfers.


2.  SPECIFIC CODE QUESTIONS

       It will likely take some time to get all of these questions 
completely answered, especially the ones involving graphics.


1. The initial version of Python being used has to be a free download that 
is easy to understand.  And it has to be compatible with Windows.

       Where can the best free download version of Python be obtained?

       Is the ActiveState version the best one for people who are not Python 
experts?

       I always found it quite easy to install ActiveState versions of Perl.


2.  Graphics - This is likely a fairly complicated question.

       What are some of the graphics options available with Python?

       Does it have its own internal graphics routines?  Perl does not as 
far as I can tell.  And we never had time to explore Fortran's graphics 
capabilities.

       I am aware of the existence of Matlab.  But as stated, everything 
involved with this present effort has to be a free download so that 
programmers around the world can easily and inexpensively generate program 
subroutines etc.


3.  Fast Calculations

       It is my expectation that Python by itself does not do calculations 
very fast when compared to a language such as Fortran.

       So, what options are available for increasing the speed of Python 
calculations?

       Python could call a Fortran program to do the calculations just as 
Perl could.  But we would like to avoid having to use more than one language 
with this effort.


4. What is the code for opening a Windows "Pipe" between a running Python 
program and some other program such as another Python or Perl program that 
can work with pipes?

       Three examples are needed if possible, one for just sending, one for 
just receiving, and one that allows both sending and receiving.  I know how 
to open Windows pipes using Perl.


5. We would want Python to check for a key press now and then without 
actually waiting until a key is pressed.  What would be the command for 
that?  It is likely something like Get_Key


6. What is Python's version of the DOS level "System" command that many 
programs use as in:

system "open notepad.exe"


7. What is Python's version of the SendKey command that many programs use to 
send information to an active Windows program as in:

SendKey("Message to be printed on the Notepad screen")

or

SendKey(Right Arrow Key)


8. What commands does Python use to send to, and retrieve information from, 
the Windows clipboard?


       Regards, and thanks again for any assistance with this.

E.D.G.

[toc] | [next] | [standalone]


#94544

Fromtandrewjohnson@outlook.com
Date2015-07-25 04:36 -0700
Message-ID<2adac4ce-976f-4a8a-849d-c76e484eba77@googlegroups.com>
In reply to#94541
1. Download the Windows installer from Python.org to get started. It's the simplest and most common way to get started with Python on Windows.
2. Your assumption that Python does not have GUI capabilities built into the language is not correct. But unlike Perl, it has the GUI library Tkinter  bundled with it. There are several more capable choices available: PyGTK, PyQt/PySide, and wxPython.

For intensive numerical calculations, I'd recommend using the NumPy module, as well as the 64-bit version of Python is possible.

I'm on my phone right now, so I apologize for my short answer with no links. I'll try to write a more detailed answer when I have access to my PC.

[toc] | [prev] | [next] | [standalone]


#94545

Fromtandrewjohnson@outlook.com
Date2015-07-25 04:39 -0700
Message-ID<058b3394-ff4c-42ff-8d1c-4d7bd6b74772@googlegroups.com>
In reply to#94544
Sorry, in #2 I meant to say that your assumption *is* correct. My bad.

[toc] | [prev] | [next] | [standalone]


#94548

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-07-25 08:16 -0500
Message-ID<Ce2dnceSrLaEES7InZ2dnUU7-b-dnZ2d@earthlink.com>
In reply to#94544
<tandrewjohnson@outlook.com> wrote in message 
news:2adac4ce-976f-4a8a-849d-c76e484eba77@googlegroups.com...
> 1. Download the Windows installer from Python.org to get started. It's the 
> simplest and most common way to get started with Python on Windows.
> 2. Your assumption that Python does not have GUI capabilities built into 
> the language is not correct. But unlike Perl, it has the GUI library 
> Tkinter  bundled with it. There are several more capable choices 
> available: PyGTK, PyQt/PySide, and wxPython.
> For intensive numerical calculations, I'd recommend using the NumPy 
> module, as well as the 64-bit version of Python is possible.


Posted by E.D.G.  July 25, 2015

       Thanks for the comments.  I saw your other response as well.  And it 
sounds like this effort is off to a good start.

       I myself have not yet started working with Python.  But a retired 
professional programmer who is part of this effort did attempt to install 
Python.  And he stated to me that he had encountered some difficulties with 
the installation.

       I am assuming that he got his download from Python.org.  I don't yet 
know why he ran into problems.  But as I have used the ActiveState version 
of Perl for quite a few years and have never had any trouble installing it I 
thought that their Python download might be a fairly easy version to 
install.

       Exactly which version should be used should be an easy matter to 
resolve.


       Most of the computers that people will be using are 64 bit machines. 
But at the same time, most people will be using 32 bit versions of Windows 
including XP.  And I believe that this means that a 32 bit version of Python 
has to be used as well.

       This is somewhat unfortunate as I was once told that with 32 bit 
Windows, the most RAM type memory that a single program can use is 2 
gigabytes.  I have found that to be the case with my Perl programs.  With 64 
bit Windows that memory limit reportedly does not apply.

       So, since many of the people involved with this type of effort will 
likely be using 32 bit Windows XP or Vista, we won't have a choice on this.

Another question:

       With my Perl programs, when I want to run the programs on a new 
computer or even from a flash drive, basically all I do is copy an entire 
existing Perl program directory to the new computer or flash drive.  And 
that works.  However, to make certain that it will work I might also 
actually install the Perl language program, delete everything in the Perl 
directory, and then copy all of the contents of an existing Perl directory 
to that new Perl directory.  That way all of the various Perl modules don't 
have to be individually downloaded and linked with the main program.

       Will that work with Python as well.  Or does each installation need 
to be created from scratch?

Regards,

E.D.G.

[toc] | [prev] | [next] | [standalone]


#94553

FromLaura Creighton <lac@openend.se>
Date2015-07-25 15:59 +0200
Message-ID<mailman.980.1437832769.3674.python-list@python.org>
In reply to#94548
>Another question:
>
>       With my Perl programs, when I want to run the programs on a new 
>computer or even from a flash drive, basically all I do is copy an entire 
>existing Perl program directory to the new computer or flash drive.  And 
>that works.  However, to make certain that it will work I might also 
>actually install the Perl language program, delete everything in the Perl 
>directory, and then copy all of the contents of an existing Perl directory 
>to that new Perl directory.  That way all of the various Perl modules don't 
>have to be individually downloaded and linked with the main program.
>
>       Will that work with Python as well.  Or does each installation need 
>to be created from scratch?
>
>Regards,
>
>E.D.G.

The most common way to do things is to tell your users to install
whatever python distribution you pick and then optionally
install these extra packages (if you need any) and then give them a python
program to run.

But you can also package everything up into a .exe for them if they
need this.

Laura

[toc] | [prev] | [next] | [standalone]


#94641

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-07-26 12:49 -0500
Message-ID<5ZOdnRjTI6RfgCjInZ2dnUU7-RednZ2d@earthlink.com>
In reply to#94553
"Laura Creighton" <lac@openend.se> wrote in message 
news:mailman.980.1437832769.3674.python-list@python.org...
> The most common way to do things is to tell your users to install
> whatever python distribution you pick and then optionally
> install these extra packages (if you need any) and then give them a python
> program to run.
> But you can also package everything up into a .exe for them if they
> need this.


Posted by E.D.G.   July 26, 2015

       For general interest purposes, as you can see, with my posts I 
usually include E.D.G. and the date of the posting.  This is because the 
projects that I work on involve scientific research.  And this way printed 
versions of the posts can be made.  And they will include references that 
people can use.  The printed versions would not have the types of 
information that are included with the electronic newsgroup distributions.


       What I was asking about in that earlier post is something that very 
few programmers or perhaps even no programmers are familiar with.  Most 
people know what the .exe versions of programs are.  But what I was asking 
about is more basic.

       It can take a considerable amount of time and effort to get a 
programming language installed and running with all of the features that are 
needed.  It probably took me 5 to 10 years to get Perl organized on my 
computer like that.

       Once that process is done, people who are not professional 
programmers don't want to have to constantly update and change the basic 
language they have running on their computers.  So, they might do what I do 
though I have never heard of anyone else doing that.

       My entire Perl language is in a directory called "Perl" on my 
computer.  I use ActiveState 5.10 Perl which is a very old version.  But it 
does everything that needs to be done except graphics and fast calculations. 
For the graphics I use a Perl to Gnuplot "Pipe" that works quite well and 
which took a long time for me to develop.  A very old version of Gnuplot is 
also used for simplicity.  I consists of just 2 small .exe files.

       Then if I want to run a .pl program on any computer or even from a 
flash drive I simply copy the entire 5.10 Perl directory to the new computer 
or flash drive.  And any Perl program will then run on the new computer or 
from the flash drive.

       Windows let you specify that a .pl program should always be opened 
with perl.exe.  The same is probably true with Python.  So, Perl itself does 
not actually need to be installed on a computer to get .pl programs to run. 
However, it is probably a good idea to do that so that the perl.exe address 
is in the right Windows Environment variables.

       So, that is what I was asking about Python.  Once it is installed and 
running properly, can people simply copy the entire Python directory to some 
other computer or flash drive and a Python language program will then run?


       If necessary, to get Perl programs to run faster we were planning to 
use a Perl to Fortran "Pipe" plus file storage of bulk data.  Fortran would 
then process the files and tell the Perl program when it was done.  But 
before doing that we decided to see if we could find another language that 
would do everything that my version of Perl does plus graphics and fast 
calculations.  It appears that Python will do that.  But it also appears 
that it would take quite a while to select a specific version of Python and 
then learn how to get everything organized and running.

       Another of my posts will probably go into more detail regarding that 
subject.

Thanks for the comments.

Regards,

E.D.G.

[toc] | [prev] | [next] | [standalone]


#94643

FromLaura Creighton <lac@openend.se>
Date2015-07-26 20:38 +0200
Message-ID<mailman.1018.1437935917.3674.python-list@python.org>
In reply to#94641
>       It can take a considerable amount of time and effort to get a 
>programming language installed and running with all of the features that are 
>needed.  It probably took me 5 to 10 years to get Perl organized on my 
>computer like that.


>       So, that is what I was asking about Python.  Once it is installed and 
>running properly, can people simply copy the entire Python directory to some 
>other computer or flash drive and a Python language program will then run?

Yes.  That is actually the usual way to do things for quite a few years now.
What you are talking about is what we call a Python virtual environment.
see: http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
http://simononsoftware.com/virtualenv-tutorial-part-2/
for an introduction to them.

It is common to have many of them for different purposes.  The bottom
line is that it lets you utterly ignore (at least from the python
point of view) any system packages you have on your machine.  Instead,
in a directory, you end up with exactly the tools, modules, etc
that you want for this project.

Works fine on a memory stick, too.

You don't have to worry about conflicts because you are, in effect, doing
a clean build from scratch for every project you have -- or indeed I
usually have many of them even with a single project so I can test that
my code works with different combinations of different versions of other
software.

Laura

[toc] | [prev] | [next] | [standalone]


#94644

From"E.D.G." <edgrsprj@ix.netcom.com>
Date2015-07-26 13:48 -0500
Message-ID<hJ-dnYz8BurhtijInZ2dnUU7-RudnZ2d@earthlink.com>
In reply to#94643
"Laura Creighton" <lac@openend.se> wrote in message 
news:mailman.1018.1437935917.3674.python-list@python.org...
> Yes.  That is actually the usual way to do things for quite a few years 
> now.
> What you are talking about is what we call a Python virtual environment.
> see: http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
> http://simononsoftware.com/virtualenv-tutorial-part-2/
> for an introduction to them.

Posted by E.D.G.   July 26, 2015

       Great!  That is exactly what I needed to know.  And in response to my 
original post I am going to post another note about this general programming 
effort.

Regards,

E.D.G.

[toc] | [prev] | [next] | [standalone]


#94624

FromBartC <bc@freeuk.com>
Date2015-07-26 13:49 +0100
Message-ID<WH4tx.31911$zk7.16739@fx26.am4>
In reply to#94544
On 25/07/2015 12:36, tandrewjohnson@outlook.com wrote:

> For intensive numerical calculations, I'd recommend using the NumPy module, as well as the 64-bit version of Python is possible.

How do you actually install Numpy in Windows?

I had a go a month or two ago and couldn't get anywhere.

I realise that this is something that apparently no-one else on the 
planet has no problem with except me, but nevertheless it would be 
interesting to know exactly how it's done.

I've just at numpy.org, they direct me to scipy.org, which talks about 
sources and binaries at sourceforge.

The only thing on offer there is numpy-1.9.2.zip, which I duly download 
and install onto my machine.

Now I have a directory tree with some 1200 files in it.

I look at README.txt, which tells me nothing much, except how to test it 
after installing. So I look at INSTALL.txt instead, which is now going 
on about *building* Numpy; but I thought
  this was the binary of it!

Then it goes on to suggest suitable free compilers to use. My thought at 
that point was, 'forget it'! I can't be the only one either. (I know 
from experience that building complex packages under Windows, especially 
those that originate under Unix or Linux, is a bloody nightmare, and 
hardly ever works.)

Apart from which, INSTALL.txt doesn't actually say what do next.

Is this DIY approach really the only way to get numpy, or is there a 
proper installer that takes care of all the details?

And is there anything I've done wrong above? (Apart from trying to use 
Windows.)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#94625

FromChris Angelico <rosuav@gmail.com>
Date2015-07-26 23:07 +1000
Message-ID<mailman.1011.1437916042.3674.python-list@python.org>
In reply to#94624
On Sun, Jul 26, 2015 at 10:49 PM, BartC <bc@freeuk.com> wrote:
>
> And is there anything I've done wrong above? (Apart from trying to use
> Windows.)

Not sure about done *wrong*, per se, but there's something that you
didn't mention doing: search the web for "numpy windows", which
brought me to this page:

http://www.scipy.org/install.html

The recommendation there is to grab a prepackaged Python like
Anaconda. I haven't tried it myself (never needed numpy on Windows)
but it does seem to be the easiest way to go about it.

ChrisA

[toc] | [prev] | [next] | [standalone]


#94630

FromBartC <bc@freeuk.com>
Date2015-07-26 15:30 +0100
Message-ID<V96tx.57565$AW2.45240@fx11.am4>
In reply to#94625
On 26/07/2015 14:07, Chris Angelico wrote:
> On Sun, Jul 26, 2015 at 10:49 PM, BartC <bc@freeuk.com> wrote:
>>
>> And is there anything I've done wrong above? (Apart from trying to use
>> Windows.)
>
> Not sure about done *wrong*, per se, but there's something that you
> didn't mention doing: search the web for "numpy windows", which
> brought me to this page:
>
> http://www.scipy.org/install.html

I saw that but it was about installing the SciPy Stack, whatever that 
is. The only mention of numpy there is to do with linux systems, except 
for a link near the end which takes me to that same Sourceforge site.

> The recommendation there is to grab a prepackaged Python like
> Anaconda. I haven't tried it myself (never needed numpy on Windows)
> but it does seem to be the easiest way to go about it.

OK, I've done that now, and it works, thanks. Now 'import numpy' doesn't 
report an error.

(But Christ, it's massive! A 0.3GB download that took ages to install, 
and occupied 1.3GB on disk (32000 files), about 20-40 times as big as a 
normal Python install. It was also Python 2.7, which I didn't notice 
until it was too late. Presumably I must have clicked the wrong button 
at some point. I dread think how big a Python 3.x version might be!)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#94628

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-07-26 14:19 +0100
Message-ID<mailman.1013.1437916769.3674.python-list@python.org>
In reply to#94624
On 26/07/2015 13:49, BartC wrote:
> On 25/07/2015 12:36, tandrewjohnson@outlook.com wrote:
>
>> For intensive numerical calculations, I'd recommend using the NumPy
>> module, as well as the 64-bit version of Python is possible.
>
> How do you actually install Numpy in Windows?
>

http://www.lfd.uci.edu/~gohlke/pythonlibs/

You should be able to point pip there to get numpy.  If you can't then 
download the whl file for your Python version and install from the local 
file name.  Completely ignore the big title at the top of the site 
"Unofficial Windows Binaries for Python Extension Packages", I've been 
using stuff from there for years and never once had a problem.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#94629

FromSteven D'Aprano <steve@pearwood.info>
Date2015-07-27 00:22 +1000
Message-ID<55b4ed21$0$1645$c3e8da3$5496439d@news.astraweb.com>
In reply to#94624
On Sun, 26 Jul 2015 10:49 pm, BartC wrote:

> How do you actually install Numpy in Windows?

Are you installing from source, or a pre-built binary?

To install from source, you need a C or Fortran compiler, and a bunch of
extra libraries (I think BLAS is one of them?).


> I had a go a month or two ago and couldn't get anywhere.
> 
> I realise that this is something that apparently no-one else on the
> planet has no problem with except me, but nevertheless it would be
> interesting to know exactly how it's done.

No, it's not just you.

> I've just at numpy.org, they direct me to scipy.org, which talks about
> sources and binaries at sourceforge.

Well, did you read what they said?

Paragraph two:

"For most users, especially on Windows and Mac, the easiest way to install
the packages of the SciPy stack is to download one of these Python
distributions, which includes all the key packages: ..."


> The only thing on offer there is numpy-1.9.2.zip, which I duly download
> and install onto my machine.

The sourceforge UI is rubbish.

Ignore the link to the zip file at the top of the page, and click into the
version number you want. Presumably you want the latest version. Click
through to here:

http://sourceforge.net/projects/numpy/files/NumPy/1.9.2/

Look ma, pre-built installers for Windows!




-- 
Steven

[toc] | [prev] | [next] | [standalone]


#94633

FromBartC <bc@freeuk.com>
Date2015-07-26 15:58 +0100
Message-ID<nA6tx.75761$LU5.49854@fx12.am4>
In reply to#94629
On 26/07/2015 15:22, Steven D'Aprano wrote:
> On Sun, 26 Jul 2015 10:49 pm, BartC wrote:
>
>> How do you actually install Numpy in Windows?
>
> Are you installing from source, or a pre-built binary?
>
> To install from source, you need a C or Fortran compiler, and a bunch of
> extra libraries (I think BLAS is one of them?).
>
>
>> I had a go a month or two ago and couldn't get anywhere.
>>
>> I realise that this is something that apparently no-one else on the
>> planet has no problem with except me, but nevertheless it would be
>> interesting to know exactly how it's done.
>
> No, it's not just you.
>
>> I've just at numpy.org, they direct me to scipy.org, which talks about
>> sources and binaries at sourceforge.
>
> Well, did you read what they said?

On which site, numpy, scipy or sourceforge? I tried this:

numpy.org; nothing on that page.

Click 'Getting Numpy' => Obtaining Numpy & SciFi libraries. The only 
references to Windows takes me to the sourceforge site (ignoring the 
link to do with building).

The sourceforge site (http://sourceforge.net/projects/numpy/files/) has 
nothing like that either. It just has 'Looking for the latest version? 
Download numpy-1.9.2.zip'. That's the obvious link.

Or I can ignore that and click on the 'NumPy' link.  That takes me to a 
long list of versions (1.9.2 to 1.0.4).

Nothing that looks like your paragraph 2, or the proper installers.

It's only after examining your link that I realise that each version 
number such as 1.9.2 actually opens up a new directory of files. And 
*now* I can see that some files are proper installers (which I've 
installed and it was a lot smaller and quicker than the Anacondo one).

>  Paragraph two:
>
> "For most users, especially on Windows and Mac, the easiest way to install
> the packages of the SciPy stack is to download one of these Python
> distributions, which includes all the key packages: ..."

But I've still found of the above quote.

You see the problem however? Loads of confusing links that all look very 
similar, and sometimes just go around in circles?

Why can't they just have that direct link on the numpy home page? Just 
for Windows users as presumably everyone else has any problem. And no 
one wants to mess around building things from scratch.

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#94680

FromRob Gaddi <rgaddi@technologyhighland.invalid>
Date2015-07-27 23:14 +0000
Message-ID<mp6e1a$knj$1@dont-email.me>
In reply to#94624
On Sun, 26 Jul 2015 13:49:57 +0100, BartC wrote:

> How do you actually install Numpy in Windows?
> 
> I had a go a month or two ago and couldn't get anywhere.
> 

As I recall you noodle around with it for a few hours making things that 
look like progress but turn out to be rabbit holes.  Then you break down 
sobbing, go off, get drunk, come back the next day with your head 
pounding, delete your existing installation in a fit of pique, install 
Anaconda's distribution with the whole SciPy stack already built in, and 
have it just magically work.

I suppose you could try skipping the earlier steps, but at that point I 
wouldn't be able to vouch for the process.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.

[toc] | [prev] | [next] | [standalone]


#94685

FromTerry Reedy <tjreedy@udel.edu>
Date2015-07-28 04:50 -0400
Message-ID<mailman.1044.1438073468.3674.python-list@python.org>
In reply to#94680
On 7/27/2015 7:14 PM, Rob Gaddi wrote:
> On Sun, 26 Jul 2015 13:49:57 +0100, BartC wrote:
>> How do you actually install Numpy in Windows?

I believe 'pip install numpy' works

> As I recall you noodle around with it for a few hours making things that
> look like progress but turn out to be rabbit holes.

To me, this is nonsense.  If the above does not work, go to
http://www.lfd.uci.edu/~gohlke/pythonlibs/

One of the above worked for me a year ago.  10 minutes max.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#94687

FromBartC <bc@freeuk.com>
Date2015-07-28 10:46 +0100
Message-ID<ybItx.48040$vg2.2941@fx34.am4>
In reply to#94685
On 28/07/2015 09:50, Terry Reedy wrote:
> On 7/27/2015 7:14 PM, Rob Gaddi wrote:
>> On Sun, 26 Jul 2015 13:49:57 +0100, BartC wrote:
>>> How do you actually install Numpy in Windows?
>
> I believe 'pip install numpy' works

C:>pip install numpy

  'pip' is not recognized as an internal or external command,
  operable program or batch file.

So you try and install pip, and it's a .whl file:

  'Windows can't open this file'.

It seems that you might need pip to install pip. But you investigate, 
and find .whl is just a .zip file. So you try renaming it to .zip, unzip 
it, and now get 200 files, none of which is called pip!

A half-hearted attempt to run wheel.py gives an error, not unexpected. 
But what were we trying to do? It was to install numpy, not pip! It is 
fun however seeing how many layers of complexity people like adding, in 
order to make things 'simpler'. A couple more of layers, and things will 
become completely impossible I think.

Either that or the machine will grind to a halt first.

(I'm still reeling from the size of that Anaconda download. Apparently 
it contains a whole bunch of stuff, nothing to do with numpy, that I 
don't need. But one of the listed packages was 'libffi', which is 
puzzling. This library lets a C-like language call functions with 
runtime-determined argument types. How would that be used in Python?)

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#94688

FromChris Angelico <rosuav@gmail.com>
Date2015-07-28 20:17 +1000
Message-ID<mailman.1045.1438078675.3674.python-list@python.org>
In reply to#94687
On Tue, Jul 28, 2015 at 7:46 PM, BartC <bc@freeuk.com> wrote:
> On 28/07/2015 09:50, Terry Reedy wrote:
>> I believe 'pip install numpy' works
>
>
> C:>pip install numpy
>
>  'pip' is not recognized as an internal or external command,
>  operable program or batch file.

Then go and update your Python, because the newer versions
automatically install pip. Or if you already have a recent Python and
pip is installed, you may need to sort out your PATH, information on
which is readily available on the internet.

> So you try and install pip, and it's a .whl file:
>
>  'Windows can't open this file'.
>
> It seems that you might need pip to install pip. But you investigate, and
> find .whl is just a .zip file. So you try renaming it to .zip, unzip it, and
> now get 200 files, none of which is called pip!

An Open Document Format file is also a zip. Do you rename those to
.zip, unzip them, and then wonder why you can't read the document? The
"is just a zip file" bit is purely an implementation detail, and while
it may be of curiosity interest to explore the internals, it won't
help you get something basic going. This is why you were previously
advised to get one of the ready-made distributions.

> (I'm still reeling from the size of that Anaconda download. Apparently it
> contains a whole bunch of stuff, nothing to do with numpy, that I don't
> need. But one of the listed packages was 'libffi', which is puzzling. This
> library lets a C-like language call functions with runtime-determined
> argument types. How would that be used in Python?)

That's what you asked for. You sought a ready-to-use distribution with
heaps of stuff in it. Want one with less stuff? Look for something
else. Want carte blanche? Pick up the pieces individually instead.
This is how the internet works.

ChrisA

[toc] | [prev] | [next] | [standalone]


#94689

FromBartC <bc@freeuk.com>
Date2015-07-28 11:44 +0100
Message-ID<22Jtx.96974$ad5.25622@fx06.am4>
In reply to#94688
On 28/07/2015 11:17, Chris Angelico wrote:
> On Tue, Jul 28, 2015 at 7:46 PM, BartC <bc@freeuk.com> wrote:
>> On 28/07/2015 09:50, Terry Reedy wrote:
>>> I believe 'pip install numpy' works
>>
>>
>> C:>pip install numpy
>>
>>   'pip' is not recognized as an internal or external command,
>>   operable program or batch file.
>
> Then go and update your Python, because the newer versions
> automatically install pip. Or if you already have a recent Python and
> pip is installed, you may need to sort out your PATH, information on
> which is readily available on the internet.

Right you are. There is a pip.exe in the ./Scripts directory of Python 3.4.

I don't agree with the PATH set-up however; I try and avoid those and 
generally don't need them; my simple IDE knows where to look for 
binaries, and PATHs for different versions would clash. (The actual pip 
command was tried in the same place as python.exe, not from the root 
path as my example suggests. A search for pip.exe failed because that 
was 3.1.)

>> (I'm still reeling from the size of that Anaconda download. Apparently it
>> contains a whole bunch of stuff, nothing to do with numpy, that I don't
>> need.

> That's what you asked for. You sought a ready-to-use distribution with
> heaps of stuff in it. Want one with less stuff? Look for something
> else. Want carte blanche? Pick up the pieces individually instead.
> This is how the internet works.

No, I asked for how to install numpy, and was told to install Anaconda. 
I didn't know it was so big. It's like asking where to buy a pint of 
milk, and inadvertently buying the whole store! Which does, after all, 
come with the milk I wanted...

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#94690

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-07-28 13:47 +0100
Message-ID<mailman.1046.1438087700.3674.python-list@python.org>
In reply to#94689
On 28/07/2015 11:44, BartC wrote:
>
> Right you are. There is a pip.exe in the ./Scripts directory of Python 3.4.
>

A handy tip for windows users is that there is a versioned number of 
pip, e.g. pip3.4.exe.  Very useful indeed when you've multiple Python 
versions installed as I have, as it prevents you spending time and 
effort updating an unintended installation.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.lang.python


csiph-web