installing swampy for portable python for windows

Posted on 2014-07-16
Last Modified: 2014-07-16
I can not complete large exercises in this python book

attempting to install swampy on portable python for windows
errors installing non portable python for windows is another question

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tkinter
>>> import Tkinter
>>> Tkinter -v
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'v' is not defined
>>> Tkinter
<module 'Tkinter' from 'C:\Users\Acer\Documents\portable-python\Portable Python\App\lib\lib-tk\'>
>>> import swampy.TurtleWorld
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named swampy.TurtleWorld
>>> pip install swampy
  File "<stdin>", line 1
    pip install swampy
SyntaxError: invalid syntax
>>> import install
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named install
>>> import pip
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pip

Open in new window

Question by:rgb192
    LVL 16

    Expert Comment

    You have to type pip install from the command line  (a cmd window) and not from within a python shell.

    Pip is a tool which you must have installed for your python release.

    Check whether you have pip installed:
       If your python executable is for example C:\Python27\python.exe
    then pip will probably be in C:\Python27\Scripts\pip.exe

    Either add C:\Python27\Scripts to you rsearch path or type
    C:\Python27\Scripts\pip.exe install swampy

    Open in new window

    Alternatively you can use easy_install, but I also don't know whether you installed already easy_install on your amchine

    However I do not know swampy

    Author Comment

    there is
    but no

    LVL 16

    Accepted Solution

    Ah yes,
    I forgot you're using portable python.

    Well it seems you don't have pip.exe installed but you have easy_install.exe
    so try following from a cmd.exe window.

    Open a cmd window:
    go to your portable python directory (wherever it is installed on your PC)

    cd /d C:\portable-python\Portable Python2.7\

    Open in new window

    Now try to install swampy with easy_install.
    App\Scripts\easy_Install swampy

    Open in new window

    You can also install pip with easy_install.
    App\Scripts\easy_Install pip

    Open in new window

    I would add the path to of the App\Scripts directory to your search path, so that you can just type
    without having to specify the full path

    Author Closing Comment

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Windows\system32>cd ../../users/acer/documents/portable-python
    C:\Users\Acer\Documents\portable-python>cd "portable python"
    C:\Users\Acer\Documents\portable-python\Portable Python>cd app/scripts
    C:\Users\Acer\Documents\portable-python\Portable Python\App\Scripts>easy
    _install swampy
    Searching for swampy
    Best match: swampy 2.1.7
    Running swampy-2.1.7\ -q bdist_egg --dist-dir c:\users\acer\appdata\loca
    zip_safe flag not set; analyzing archive contents...
    swampy.Lumpy: module MAY be using inspect.stack
    Adding swampy 2.1.7 to easy-install.pth file
    Installed c:\users\acer\documents\portable-python\portable python\app\li
    Processing dependencies for swampy
    Finished processing dependencies for swampy
    C:\Users\Acer\Documents\portable-python\Portable Python\App\Scripts>easy
    _install pip
    Searching for pip
    Best match: pip 1.5.6
    Processing pip-1.5.6.tar.gz
    Running pip-1.5.6\ -q bdist_egg --dist-dir c:\users\acer\appdata\local\t
    warning: no files found matching 'pip\cacert.pem'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.rst' found under directory 'do
    no previously-included directories found matching 'docs\_build\_sources'
    Adding pip 1.5.6 to easy-install.pth file
    Installing script to C:\Users\Acer\Documents\portable-python\Porta
    ble Python\App\Scripts
    Installing pip.exe script to C:\Users\Acer\Documents\portable-python\Portable Py
    Installing pip.exe.manifest script to C:\Users\Acer\Documents\portable-python\Po
    rtable Python\App\Scripts
    Installing script to C:\Users\Acer\Documents\portable-python\Po
    rtable Python\App\Scripts
    Installing pip2.7.exe script to C:\Users\Acer\Documents\portable-python\Portable
    Installing pip2.7.exe.manifest script to C:\Users\Acer\Documents\portable-python
    \Portable Python\App\Scripts
    Installing script to C:\Users\Acer\Documents\portable-python\Port
    able Python\App\Scripts
    Installing pip2.exe script to C:\Users\Acer\Documents\portable-python\Portable P
    Installing pip2.exe.manifest script to C:\Users\Acer\Documents\portable-python\P
    ortable Python\App\Scripts
    Installed c:\users\acer\documents\portable-python\portable python\app\li
    Processing dependencies for pip
    Finished processing dependencies for pip
    C:\Users\Acer\Documents\portable-python\Portable Python\App\Scripts>

    Open in new window

    Now it is installed thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Plenty of writing has gone on the web trying to compare Python with other competitive programming languages and vice versa. However, not much has been put into a wholistic perspective. This article should help you decide whether to adopt Python as a…
    When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now