[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


installing swampy for portable python for windows

Posted on 2014-07-16
Medium Priority
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\Tkinter.py'>
>>> 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
  • 2
  • 2
LVL 17

Expert Comment

ID: 40199950
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

ID: 40200717
there is
but no

LVL 17

Accepted Solution

gelonida earned 2000 total points
ID: 40200833
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

ID: 40200986
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
Reading http://pypi.python.org/simple/swampy/
Best match: swampy 2.1.7
Downloading https://pypi.python.org/packages/source/s/swampy/swampy-2.1.7.zip#md
Processing swampy-2.1.7.zip
Running swampy-2.1.7\setup.py -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
Reading http://pypi.python.org/simple/pip/
Best match: pip 1.5.6
Downloading https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=0
Processing pip-1.5.6.tar.gz
Running pip-1.5.6\setup.py -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 pip-script.py 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 pip2.7-script.py 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 pip2-script.py 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.

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"The time has come," the Walrus said, "To talk of many things: Of sets--and lists--and dictionaries-- Of variable kinks-- And why you see it changing not-- And why so strange are strings." This part describes how variables and references (see …
Sequence is something that used to store data in it in very simple words. Let us just create a list first. To create a list first of all we need to give a name to our list which I have taken as “COURSE” followed by equals sign and finally enclosed …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses
Course of the Month19 days, 2 hours left to enroll

834 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