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


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

Trying to import numpy

Started byryguy7272 <ryanshuell@gmail.com>
First post2015-07-06 20:17 -0700
Last post2015-07-07 19:53 +0200
Articles 7 — 7 participants

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


Contents

  Trying to import numpy ryguy7272 <ryanshuell@gmail.com> - 2015-07-06 20:17 -0700
    Re: Trying to import numpy Michael Torrie <torriem@gmail.com> - 2015-07-06 22:38 -0600
    Re: Trying to import numpy Chris Angelico <rosuav@gmail.com> - 2015-07-07 15:04 +1000
    Re: Trying to import numpy Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-07 08:00 +0100
    Re: Trying to import numpy Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-07-07 09:23 -0400
    Re: Trying to import numpy Terry Reedy <tjreedy@udel.edu> - 2015-07-07 12:32 -0400
    Re: Trying to import numpy Laurent Pointal <laurent.pointal@free.fr> - 2015-07-07 19:53 +0200

#93544 — Trying to import numpy

Fromryguy7272 <ryanshuell@gmail.com>
Date2015-07-06 20:17 -0700
SubjectTrying to import numpy
Message-ID<c55edf1c-56b7-44be-bc4d-5f74ffb3176b@googlegroups.com>
I'm trying to use numpy.  I get this error:
>>> import numpy as np

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import numpy as np
ImportError: No module named numpy



I followed the instructions here.
https://pip.pypa.io/en/latest/installing.html


In the c-prompt, I get this error.
C:\>python get-pip.py
python: can't open file 'get-pip.py': [Errno 2] No such file or directory


In python 2.7, I get this error.
>>> python get-pip.py
SyntaxError: invalid syntax


I would say 100% of my errors come from importing python modules.  If this every worked, I could do some real work.  Instead, I spend 100% of my time trying to make thing that don't work, work.  


I've already added ';C:\Python27' to the Path under Variable Name.  Of course, this makes no difference whatsoever.  Ugh.

Any thoughts?  Anyone?
Thanks.

[toc] | [next] | [standalone]


#93546

FromMichael Torrie <torriem@gmail.com>
Date2015-07-06 22:38 -0600
Message-ID<mailman.335.1436243906.3674.python-list@python.org>
In reply to#93544
On 07/06/2015 09:17 PM, ryguy7272 wrote:
> I followed the instructions here.
> https://pip.pypa.io/en/latest/installing.html
> 
> 
> In the c-prompt, I get this error.
> C:\>python get-pip.py
> python: can't open file 'get-pip.py': [Errno 2] No such file or directory

Is get-pip.py located in c:\?  You have to specify the path to the
location where you saved get-pip.py:

C:\>python \path\to\get-pip.py

Where \path\to is the path of where ever you placed the downloaded file.
 You did download get-pip.py, right?  It's not clear from your post.

I can safely say that importing modules works very well for most people.
 I assume you mean that you have errors trying to download and install
third-party modules.  Hopefully we can get you over this hurdle.

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


#93547

FromChris Angelico <rosuav@gmail.com>
Date2015-07-07 15:04 +1000
Message-ID<mailman.336.1436245490.3674.python-list@python.org>
In reply to#93544
On Tue, Jul 7, 2015 at 1:17 PM, ryguy7272 <ryanshuell@gmail.com> wrote:
> I would say 100% of my errors come from importing python modules.  If this every worked, I could do some real work.  Instead, I spend 100% of my time trying to make thing that don't work, work.
>

I could equally say that 100% of your errors come from working on
Windows, and that if you were on a different OS, you could do some
real work. Or I could probably point out that 100% of your errors come
from using the internet, and that if you had a completely stand-alone
system, you could do some real work. You're blaming importing on
circumstantial evidence here, and that's not exactly fair.

Start by making sure you have Python 2.7.9 or better (and yes, 3.4
counts as "better"). It should come with pip already installed.

ChrisA

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


#93551

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-07-07 08:00 +0100
Message-ID<mailman.339.1436252470.3674.python-list@python.org>
In reply to#93544
On 07/07/2015 04:17, ryguy7272 wrote:
> I'm trying to use numpy.  I get this error:
>>>> import numpy as np
>
> Traceback (most recent call last):
>    File "<pyshell#1>", line 1, in <module>
>      import numpy as np
> ImportError: No module named numpy
>
>
>
> I followed the instructions here.
> https://pip.pypa.io/en/latest/installing.html
>
>
> In the c-prompt, I get this error.
> C:\>python get-pip.py
> python: can't open file 'get-pip.py': [Errno 2] No such file or directory
>
>
> In python 2.7, I get this error.
>>>> python get-pip.py
> SyntaxError: invalid syntax

Upgrade your installation to one that comes with pip, either the later 
versions of 2.7 or 3.4 will do.

>
>
> I would say 100% of my errors come from importing python modules.  If this every worked, I could do some real work.  Instead, I spend 100% of my time trying to make thing that don't work, work.
>

Complete nonsense that I'm not wasting my time commenting on.

>
> I've already added ';C:\Python27' to the Path under Variable Name.  Of course, this makes no difference whatsoever.  Ugh.
>
> Any thoughts?  Anyone?
>

A bad workman always blames his tools, usually as a result of failing to 
RTFM.

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


#93553

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2015-07-07 09:23 -0400
Message-ID<mailman.341.1436275400.3674.python-list@python.org>
In reply to#93544
On Mon, 6 Jul 2015 20:17:34 -0700 (PDT), ryguy7272 <ryanshuell@gmail.com>
declaimed the following:

>I'm trying to use numpy.  I get this error:
>>>> import numpy as np
>
>Traceback (most recent call last):
>  File "<pyshell#1>", line 1, in <module>

	I have no experience with whatever provides "pyshell". I'd suggest
running from a Windows command line to reduce dependencies.

>
>In the c-prompt, I get this error.
>C:\>python get-pip.py
>python: can't open file 'get-pip.py': [Errno 2] No such file or directory
>
	As has been mentioned, this looks for get-pip.py to be in the current
directory. Is it?

>
>In python 2.7, I get this error.
>>>> python get-pip.py
>SyntaxError: invalid syntax
>

	And one never invokes the python interpreter from within the python
interpreter. Python has no command named "python".


>
>I would say 100% of my errors come from importing python modules.  If this every worked, I could do some real work.  Instead, I spend 100% of my time trying to make thing that don't work, work.  
>
>
>I've already added ';C:\Python27' to the Path under Variable Name.  Of course, this makes no difference whatsoever.  Ugh.

	Which "Path"? The Windows search path? That is only used to tell
Windows where to look for the executable program -- the first word on the
command line "python". Arguments provided to an executable "get-pip.py"
need to be specified fully; if it isn't in the current directory you have
to provide the path to the directory that it IS in.

>
>Any thoughts?  Anyone?

	Presuming the import failures are all for third-party modules, the
first question would have to be: where and how are you installing those
modules

	I'll confess I've not really used PIP; I'm a few Python versions behind
(ActiveState 2.7.5.6), and most of my third party packages tended to be ZIP
files that one unpacks into a directory, then navigates to in a command
prompt and executes "python setup install" -- which commonly copies the
needed files into the active Python version "site" specific library, and if
needed modifies the Python import search path (which is independent of the
Windows path).
>Thanks.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


#93560

FromTerry Reedy <tjreedy@udel.edu>
Date2015-07-07 12:32 -0400
Message-ID<mailman.346.1436286780.3674.python-list@python.org>
In reply to#93544
On 7/7/2015 9:23 AM, Dennis Lee Bieber wrote:
> On Mon, 6 Jul 2015 20:17:34 -0700 (PDT), ryguy7272 <ryanshuell@gmail.com>
> declaimed the following:
>
>> I'm trying to use numpy.  I get this error:
>>>>> import numpy as np
>>
>> Traceback (most recent call last):
>>   File "<pyshell#1>", line 1, in <module>
>
> 	I have no experience with whatever provides "pyshell". I'd suggest
> running from a Windows command line to reduce dependencies.

The command line interactive interpreter gives <stdin> as the pseudofile 
name for exceptions.  When code is run from Idle's Shell, <pyshell#n>, 
where n is the line number, is used instead.  This is irrelevant to the 
numpy import failure.

-- 
Terry Jan Reedy

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


#93563

FromLaurent Pointal <laurent.pointal@free.fr>
Date2015-07-07 19:53 +0200
Message-ID<559c1217$0$3365$426a74cc@news.free.fr>
In reply to#93544
ryguy7272 wrote:

> I'm trying to use numpy.  I get this error:
>>>> import numpy as np
> 
> Traceback (most recent call last):
>   File "<pyshell#1>", line 1, in <module>
>     import numpy as np
> ImportError: No module named numpy
> 
> 
> 
> I followed the instructions here.
> https://pip.pypa.io/en/latest/installing.html

…download numpy installer from official site

http://www.scipy.org/scipylib/download.html

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

Choose the installer version for your Python2.7:

==> http://sourceforge.net/projects/numpy/files/NumPy/1.9.2/numpy-1.9.2-win32-superpack-python2.7.exe/download

And install it with the installer.

<zip remaining speech>

A+
Laurent.

[toc] | [prev] | [standalone]


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


csiph-web