How to install new Modules in spyder (on a mac)

6,067 views
Skip to first unread message

west h

unread,
Mar 31, 2015, 10:09:06 AM3/31/15
to spyd...@googlegroups.com
Hello All,

I'm trying to install new modules to spyder 2.3.1 on my macbook (yosemite).
The module i am trying to install is oauth2. I used the easy-install in the terminal window.
sudo python setup.py install. It installed just fine. I was getting this error when running the code.

ImportError: No module named oauth2

when on google someone was saying to copy the folder into the spyder lib
So i copy the oauth2 folder from the unzip folder and put into the lib folder in spyder

But i get a new error 

ImportError: No module named httplib2

The new error - Import httplib2 is an import that oauth2 is using.
 
Did I do this all wrong? What is the right thing to do. 
I also saw online that some people talk about using "PYTHONPATH manger". 
But how do I use this? Do i add the path from the unzip folder?
 
I am lost Please Help if you can.

Thanks 

Adrian Klaver

unread,
Mar 31, 2015, 10:21:18 AM3/31/15
to spyd...@googlegroups.com
On 03/31/2015 06:18 AM, west h wrote:
> Hello All,
>
> I'm trying to install new modules to spyder 2.3.1 on my macbook (yosemite).
> The module i am trying to install is oauth2. I used the easy-install in
> the terminal window.
> sudo python setup.py install. It installed just fine. I was getting this
> error when running the code.
>
> ImportError: No module named oauth2
>
> when on google someone was saying to copy the folder into the spyder lib
> So i copy the oauth2 folder from the unzip folder and put into the lib
> folder in spyder
>
> But i get a new error
>
> ImportError: No module named httplib2
>
> The new error - Import httplib2 is an import that oauth2 is using.
> Did I do this all wrong?

The installs where done to the system site-packages directory and Spyder
is not finding them.

What is the right thing to do.
> I also saw online that some people talk about using "PYTHONPATH manger".
> But how do I use this? Do i add the path from the unzip folder?

The PYTHONPATH manager is found under the Tools menu item. Enter the
path to the system site-packages directory. The easiest way to find it
is to open the system Python interpreter and do:

import httplib2
help(httplib2)

At the top of the help will be the site-packages directory.

As an example:

aklaver@panda:~> python
Python 2.7.6 (default, Nov 21 2013, 15:55:38) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> help(psycopg2)

Help on package psycopg2:

NAME
psycopg2 - A Python driver for PostgreSQL

FILE
/usr/lib/python2.7/site-packages/psycopg2/__init__.py


> I am lost Please Help if you can.

I would suggest reading this several times:

https://docs.python.org/2/tutorial/modules.html

>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to spyderlib+...@googlegroups.com
> <mailto:spyderlib+...@googlegroups.com>.
> To post to this group, send email to spyd...@googlegroups.com
> <mailto:spyd...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.


--
Adrian Klaver
adrian...@aklaver.com

Carlos Córdoba

unread,
Mar 31, 2015, 10:51:38 AM3/31/15
to spyd...@googlegroups.com
Hi,

If you're using the application installed through our DMG, then there is no way to install new modules inside it because it's totally self-contained.

What you need to do is installing the modules you want in a different Python installation (like you seem you've already done), and change the interpreter Spyder uses for their consoles, following these instructions:

http://stackoverflow.com/a/19813292/438386


Cheers,
Carlos

PS. Please update to Spyder 2.3.4 :-)

El 31/03/15 a las 08:18, west h escribió:
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.

west h

unread,
Mar 31, 2015, 2:33:54 PM3/31/15
to spyd...@googlegroups.com
Thanks you both so much for the Help I going to look and read and hope I will get it.

Adrian Klaver

unread,
Mar 31, 2015, 2:52:17 PM3/31/15
to spyd...@googlegroups.com
On 03/31/2015 07:51 AM, Carlos Córdoba wrote:
> Hi,
>
> If you're using the application installed through our DMG, then there is
> no way to install new modules inside it because it's totally self-contained.
>
> What you need to do is installing the modules you want in a different
> Python installation (like you seem you've already done), and change the
> interpreter Spyder uses for their consoles, following these instructions:
>
> http://stackoverflow.com/a/19813292/438386


So what is the best way to install Spyder on OS X?

It seems Python is installed on 10.8+ so is the dmg necessary or will
pip install work to install it into the system?

Or to put it another way, what purpose does the dmg serve?

>
>
> Cheers,
> Carlos
>
> PS. Please update to Spyder 2.3.4 :-)
>

--
Adrian Klaver
adrian...@aklaver.com

west h

unread,
Apr 2, 2015, 10:08:59 AM4/2/15
to spyd...@googlegroups.com
Update on the way I got the modules to work on spyder on a mac

First I unzip the modules then i used Terminal to install to the MacPython.
1 In Terminal you use easy-install to install the setup.py ---
2 locate folder in terminal then type -  python setup.py install 
3 After that in the unzip folder you will see a new folder called build 
4 Inside build you will see lib
5 inside lib you will see a folder with the modules name
6 copy that folder and paste in spyder lib 

After i did that the program now works in spyder. I did this for 3 modules all
of them work. no Errors.


On Tuesday, March 31, 2015 at 10:09:06 AM UTC-4, west h wrote:

west h

unread,
Apr 2, 2015, 10:08:59 AM4/2/15
to spyd...@googlegroups.com
I used the dmg that was the easiest for me. It's just one step


On Tuesday, March 31, 2015 at 10:09:06 AM UTC-4, west h wrote:

Adrian Klaver

unread,
Apr 2, 2015, 10:45:07 AM4/2/15
to spyd...@googlegroups.com
On 04/02/2015 06:21 AM, west h wrote:
> Update on the way I got the modules to work on spyder on a mac
>
> First I unzip the modules then i used Terminal to install to the MacPython.
> 1 In Terminal you use easy-install to install the setup.py ---
> 2 locate folder in terminal then type - python setup.py install
> 3 After that in the unzip folder you will see a new folder called build
> 4 Inside build you will see lib
> 5 inside lib you will see a folder with the modules name
> 6 copy that folder and paste in spyder lib
>
> After i did that the program now works in spyder. I did this for 3
> modules all
> of them work. no Errors.
>

You realize you will need to do this every time you want a new module
and since modules tend to have dependencies it can get complicated in a
hurry. I would go with Carlos's suggestion and just change the
interpreter to point to the system Python and then you have everything
in one location, for the most part.


--
Adrian Klaver
adrian...@aklaver.com

west h

unread,
Apr 6, 2015, 7:49:34 PM4/6/15
to spyd...@googlegroups.com
Yep, I see that. I just had 3 to do right now so that same very easy .... but in the future
I'm going to do what Carlos suggested in the long run that is the best way to go.

Thanks for all the help.



On Tuesday, March 31, 2015 at 10:09:06 AM UTC-4, west h wrote:

lxy444

unread,
Nov 21, 2015, 8:09:04 AM11/21/15
to spyder

Hi,I'm using Spyder installed through your DMG.And it works well.But when I change the interpreter using the method you mentioned above(http://stackoverflow.com/a/19813292/438386),the ipython console could not open,staying at "Connecting to kernel",I googled on the Internet but didn't solve.What should I do to solve the problem?Thanks for your reply.

在 2015年3月31日星期二 UTC+8下午10:51:38,Carlos Córdoba写道:

David de Jong

unread,
Dec 2, 2015, 11:07:14 PM12/2/15
to spyder
I'm having the exact same problem, My iPython kernel does not work anymore then. My normal console does work
Reply all
Reply to author
Forward
0 new messages