Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 10 Online
OpenStudy (anonymous):

My python version doesn't have pylab module so how to get it as well as other modules too so that I am able to add various features in my script to make it more interactive?

OpenStudy (anonymous):

Configure for PyLab We are not in the Unit-2 and there are example which are dependent on a module of python called PyLab. Now there is no clear documentation to install it. So I am trying to provide that. Windows Installation There are lot of documentation available for installing it, but none of it worked for me. So to Install this is the route I took. My pip installation is in this path:- C:\Python27\Scripts So opened command line window in this folder by pressing Shift + Ctrl + right Click. It gives a option in the context menu Open Command Window here There are two modules which we need to install. NumPy matplotlib Both of these have to be installed, But before this for NumPy, we need a prerequisite Microsoft Visual C++ Compiler for Python 2.7. So once Microsoft Visual C++ Compiler for Python 2.7 is installed we need to use pip to install NumPy and matplotlib by this instruction. pip install numpy pip install matplotlib Once done, try this code, is it working:- import pylab pylab.plot([1,2,3,4], [1,2,3,4]) pylab.plot([1,4,2,3], [5,6,7,8]) pylab.show() Few Error which I got Traceback (most recent call last): File "example02.py", line 1, in <module> import pylab File "C:\Python27\lib\site-packages\pylab.py", line 1, in <module> from matplotlib.pylab import * File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 180, in <module> from matplotlib.cbook import is_string_like File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 33, in <module> import numpy as np ImportError: No module named numpy

OpenStudy (anonymous):

the same problem I am facing does your method can resolve my query..

OpenStudy (anonymous):

pylab is a part of matplotlib. An easy way to get anything you need installed is to use Anaconda: https://store.continuum.io/cshop/anaconda/ It has many libraries including the ones you need and you wouldn't have to take care of all the dependencies. If it is not good for you and you have to install it manually then I need to know more details like the version of python and your operating system

OpenStudy (anonymous):

first I shall tell you the errors and problems I am receiving..in Python25 when I tried to install both matplotlib and numpy I got errors saying "Warning:with statement will be a reserved word in python 2.6" and same for "as" keyword then I surfed to find the solution but nothing worked then I decided to install Python27 in this I was able to install both matplotlib and numpy but when I tried to import the modules it gave me error of module not found then I tried pyqtgraph and when I ran it I don't know it referred to some new supporting modules "pyside and pyqt4" both were missing...now it's getting very frustrating because other packages like the one prescribed in HOW TO THINK LIKE A COMPUTER SCIENTIST , the swampy module was successfully installed and imported in both the versions of python but not the one I needed for pylab if you can patiently read my query that would be really appreciable..thanq

OpenStudy (anonymous):

My operating system is windows 8 and if you can please describe the step by step procedure to install the modules that are required for pylab because it is severely affecting my studies as I want to complete my MIT course before my end sem exams..

OpenStudy (anonymous):

Well, so why don't you try Anaconda? it should make it all very easy to install and spare you the frustration of setting up all the dependencies. Is there a reason you'd rather avoid it?

OpenStudy (anonymous):

okay can you send me the link for installing ananconda..and it's just because I wanted to get familiar with command prompt stuff as I am also pursuing CS50 in that it was said that most of the times we come across command prompt to handle the system..

OpenStudy (anonymous):

I posted the link for Anaconda above. If your goal is to get familiar with the standard command line tools than that's a different story. I will try to see why numpy is not recognized for you

OpenStudy (anonymous):

okay thanq

OpenStudy (anonymous):

Well, for windows all I can find are solutions similar to mine.. Here look: http://blog.datanitro.com/2013/4/11/Python_on_windows/ States: "First, if you want to use numpy or scipy, you should download and install them directly. You can do so on the SciPy site. Make sure to download the right files (they should be .exe's) for your version of Python." and adds: "Some packages won't install properly with pip, in which case you should use its predecessor, easy_install. This was installed alongside pip." The official installation instructions for SciPy also recommend using such solutions, especially for windows: http://www.scipy.org/install.html

OpenStudy (anonymous):

What should I do for Mac OSX? We were told to use Python <2.6 so I am using 2.5.4. It seems like both Anaconda and Enthought Canopy support Python >2.7 only. I have tried whatever suggestion I can find on line.....just want to use pylab (matplotlib) and this is driving crazy >_<

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!