Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No module named numpy
#1
import numpy as np
Error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
I DL'd Python 2.7.13 a few days ago, I did "pip install -- upgrade numpy" a few minutes ago. Both are here but something is wrong with the setup. Can you tell, I'm a clueless noob.
Reply
#2
Probably the version of pip doesn't match you python version.
This is a common problem if you have more than one version of python installed.
see: https://python-forum.io/Thread-Basic-Par...nvironment if on linux
or https://python-forum.io/Thread-Basic-Par...nt-Windows if windows
Reply
#3
Okay, good to know. Sure enough Python3 has no trouble finding numpy. Is there a way to specify that I want a numpy for 2.7? BTW, Linux Slackware.
Reply
#4
You can use:
 pip2.7 install packagename
Reply
#5
No module named numpy It means you need to install Numpy.
You can install it using this command pip install numpy
make sure you have installed pip
Reply
#6
(Sep-16-2017, 01:47 AM)rdx Wrote: I DL'd Python 2.7.13 a few days ago

May I ask why you are using version 2.7.13 and not the latest 3.6.2? Also, if you are using Windows, are you're Environmental Variables correct?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#7
I am using 2.7 because I am trying to decipher a program written with it. Personally I don't know 2.7 from 3 and I am suspicious of a "language" that has concurrent dialects. I have a program that I got from pypi and I'm just trying to make it work but I'm new to python and the syntax is hard to read so I am struggling.

FYI, not Windows, Linux Slackware 14.2
Reply
#8
If you found a package in PyPi that doesn't have a python 3 version, I wouldn't use it.
That pretty much indicates that the package has been abandoned.
Quote:Personally I don't know 2.7 from 3 and I am suspicious of a "language" that has concurrent dialects
?? Python 3 has been around since December 3rd, 2008, and it is better than ever.
I doubt that I will ever use python 2.7 again, It's ancient history.

Python 2.7 will only be supported for a few more year
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 526 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,594 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  Keras. ModuleNotFoundError: No module named 'error' agatte 1 7,097 Sep-18-2019, 12:27 PM
Last Post: shivani
  ModuleNotFoundError: No module named 'stop_words' knchris2004 6 12,813 Jul-04-2019, 10:31 PM
Last Post: snippsat
  AttributeError: module 'numpy' has no attribute 'array aapurdel 7 45,496 May-29-2019, 02:48 AM
Last Post: heiner55
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 2,966 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  ModuleNotFoundError: No module named '_pywrap_tensorflow_internal' rajeev1729 1 24,403 Jul-04-2018, 06:26 PM
Last Post: stpaulchuck
  No module named pip Viesturs 4 49,724 Jun-08-2018, 06:41 AM
Last Post: volcano63
  No module named scipy kirill 2 9,415 Mar-16-2018, 04:19 PM
Last Post: kirill
  ModuleNotFoundError: No module named 'adspy_shared_utilities' POOJASWAMY 0 8,184 Feb-09-2018, 05:46 AM
Last Post: POOJASWAMY

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020