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

x
?
Solved

installing swampy for portable python for windows

Posted on 2014-07-16
4
Medium Priority
?
1,381 Views
Last Modified: 2014-07-16
I can not complete large exercises in this python book
http://www.greenteapress.com/thinkpython/index.html

attempting to install swampy on portable python for windows
(
errors installing non portable python for windows is another question
http://www.experts-exchange.com/Programming/Languages/Scripting/Python/Q_28468674.html
)
http://www.greenteapress.com/thinkpython/swampy/
http://www.greenteapress.com/thinkpython/swampy/install.html

python.exe
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
32
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
2.7.2.1\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

0
Comment
Question by:rgb192
  • 2
  • 2
4 Comments
 
LVL 17

Expert Comment

by:gelonida
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
0
 

Author Comment

by:rgb192
ID: 40200717
there is
/app/scripts/
but no
/scripts/

app-scripts
0
 
LVL 17

Accepted Solution

by:
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)
e.g

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
easy_install
without having to specify the full path
0
 

Author Closing Comment

by:rgb192
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 2.7.2.1"

C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>cd app/scripts

C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\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
5=690d64aabce9280dc0370c1103eb184e
Processing swampy-2.1.7.zip
Running swampy-2.1.7\setup.py -q bdist_egg --dist-dir c:\users\acer\appdata\loca
l\temp\easy_install-qsprfx\swampy-2.1.7\egg-dist-tmp-2zvwct
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 2.7.2.1\app\li
b\site-packages\swampy-2.1.7-py2.7.egg
Processing dependencies for swampy
Finished processing dependencies for swampy

C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\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
1026f87978932060cc86c1dc527903e
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
emp\easy_install-iozmqz\pip-1.5.6\egg-dist-tmp-yvretq
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
cs\_build'
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 2.7.2.1\App\Scripts
Installing pip.exe script to C:\Users\Acer\Documents\portable-python\Portable Py
thon 2.7.2.1\App\Scripts
Installing pip.exe.manifest script to C:\Users\Acer\Documents\portable-python\Po
rtable Python 2.7.2.1\App\Scripts
Installing pip2.7-script.py script to C:\Users\Acer\Documents\portable-python\Po
rtable Python 2.7.2.1\App\Scripts
Installing pip2.7.exe script to C:\Users\Acer\Documents\portable-python\Portable
 Python 2.7.2.1\App\Scripts
Installing pip2.7.exe.manifest script to C:\Users\Acer\Documents\portable-python
\Portable Python 2.7.2.1\App\Scripts
Installing pip2-script.py script to C:\Users\Acer\Documents\portable-python\Port
able Python 2.7.2.1\App\Scripts
Installing pip2.exe script to C:\Users\Acer\Documents\portable-python\Portable P
ython 2.7.2.1\App\Scripts
Installing pip2.exe.manifest script to C:\Users\Acer\Documents\portable-python\P
ortable Python 2.7.2.1\App\Scripts

Installed c:\users\acer\documents\portable-python\portable python 2.7.2.1\app\li
b\site-packages\pip-1.5.6-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>

Open in new window



Now it is installed thanks.
0

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