॥ स्वक्ष ॥

To content | To menu | To search

Tag - Virtualenv

Entries feed

2010 June 6 [Sunday]

funkload installation on ubuntu lucid and hardy

Crediting my earlier failed installation attempt to the owl-like-shift for most of last week, yesterday, I started afresh on Ubuntu Hardy.

Ubuntu Hardy

I tried the installation on Ubuntu Hardy, which is the environment in which funkload will be installed for use. Installing tcpwatch-httpproxy removes procmail and sendmail.

Not good. Those packages are required by other parts of the system. Strangely this does not happen on Ubuntu 10.04, for which I repeated the installation to test separately. Earlier Ben had left a comment offering his help so I've emailed him the logs and am hoping to solve this problem and post another entry about that.

$sudo aptitude install tcpwatch-httpproxy --without-recommends
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Reading extended state information     
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done            
Couldn't find any package whose name or description matched "tcpwatch-httpproxy"
Couldn't find any package whose name or description matched "tcpwatch-httpproxy"
The following packages are unused and will be REMOVED:
  procmail sendmail-base sendmail-cf sensible-mda
0 packages upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 3191kB will be freed.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
(Reading database ... 151156 files and directories currently installed.)
Removing sensible-mda ...
Removing procmail ...
Removing sendmail-base ...
Cleaning up the queues...find: /var/spool/mqueue: No such file or directory
Removing sendmail-cf ...
Reading package lists... Done            
Building dependency tree      
Reading state information... Done
Reading extended state information     
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done            

Ubuntu Lucid (10.04)

The experience of installing funkload on Lucid was a little better than Hardy, which was a small step ahead. Even if the installation failed, I tried the test-runner but the tests failed and I wanted to try it again with virtualenv. Likewise, the modules was not loading in TestRunner

(funkload)me@ubuntu10.04:~$ fl-run-test -v myFile.py
Traceback (most recent call last):
  File "/home/me/.virtualenvs/funkload/bin/fl-run-test", line 8, in <module>
    load_entry_point('funkload==1.12.0', 'console_scripts', 'fl-run-test')()
  File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/TestRunner.py", line 483, in main
  File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/TestRunner.py", line 342, in __init__
  File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/TestRunner.py", line 352, in loadTests
  File "/usr/lib/python2.6/doctest.py", line 2419, in DocFileSuite
    suite.addTest(DocFileTest(path, **kw))
  File "/usr/lib/python2.6/doctest.py", line 2338, in DocFileTest
    doc, path = _load_testfile(path, package, module_relative)
  File "/usr/lib/python2.6/doctest.py", line 219, in _load_testfile
    return open(filename).read(), filename
IOError: [Errno 2] No such file or directory: '/home/me/myFile'

Next it was 'make bench' which failed. So too with BenchRunner.

(funkload)me@ubuntu10.04:~$ fl-run-bench -u http://localhost:8080 -c 10:20 -D 30 myFile.py MyTestCase.testSomething
Traceback (most recent call last):
  File "/home/me/.virtualenvs/funkload/bin/fl-run-bench", line 8, in <module>
    load_entry_point('funkload==1.12.0', 'console_scripts', 'fl-run-bench')()
  File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/BenchRunner.py", line 606, in main
    bench = BenchRunner(args[0], klass, method, options)
  File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/BenchRunner.py", line 220, in __init__
    mmn_encode(method_name, 0, 0, 0), options)
  File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/BenchRunner.py", line 123, in load_unittest
    module = __import__(test_module)
ImportError: No module named myFile

2010 June 3 [Thursday]

funkload installation fail

I was analysing various tools for web-testing and tried out funkload - a functional, load web tester in Python.

$sudo easy_install -f http://funkload.nuxeo.org/snapshots/ -U funkload (and "sudo easy_install -U funkload" results are below:)
UserWarning: Unbuilt egg for setuptools [unknown version]
UserWarning: Unbuilt egg for setuptools [unknown version]
self.local_index = Environment(self.shadow_path+sys.path)
Searching for funkload
Reading http://pypi.python.org/simple/funkload/
Reading http://funkload.nuxeo.org/
Best match: funkload 1.12.0
Processing funkload-1.12.0-py2.6.egg
funkload 1.12.0 is already the active version in easy-install.pth
Installing fl-credential-ctl script to /usr/local/bin
Installing fl-monitor-ctl script to /usr/local/bin
Installing fl-build-report script to /usr/local/bin
Installing fl-run-test script to /usr/local/bin
Installing fl-record script to /usr/local/bin
Installing fl-install-demo script to /usr/local/bin
Installing fl-run-bench script to /usr/local/bin
Installing fl-credential-ctl script to /usr/local/bin
Installing fl-run-test script to /usr/local/bin
Installing fl-record script to /usr/local/bin
Installing fl-run-bench script to /usr/local/bin
Installing fl-monitor-ctl script to /usr/local/bin
Installing fl-install-demo script to /usr/local/bin
Installing fl-build-report script to /usr/local/bin
Using /usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg
Processing dependencies for funkload
Finished processing dependencies for funkload

$ fl-install-demo
Extract FunkLoad examples into ./funkload-demo : ... done.

Googling showed that Debian packages were 1.6.0 but easy_install pulls 1.12.0, hmm... continued with installing the dependencies:

$sudo apt-get install python-setuptools python-xml python-dev gnuplot (if you want the graphs)

$ cd funkload-demo/xmlrpc/
~/funkload-demo/xmlrpc$ make test

fl-credential-ctl cred.conf restart
Starting file_credential server at http://localhost:44401/ as daemon.
fl-run-test test_Credential.py -v
test_credential (test_Credential.Credential) ... FAIL
FAIL: test_credential (test_Credential.Credential)
Traceback (most recent call last):
 File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/FunkLoadTestCase.py",
line 868, in __call__
File "/home/mom/funkload-demo/xmlrpc/test_Credential.py", line 21,
in test_credential
description="Check getStatus")
File "/usr/local/lib/python2.6/dist-packages/funkload-1.12.0-py2.6.egg/funkload/FunkLoadTestCase.py",
line 417, in xmlrpc
raise SocketError("Can't access %s." % url)
error: Can't access http://localhost:44401/.
Ran 1 test in 0.007s
FAILED (failures=1)
make: *** [credential_test] Error 1

Apparently the version checked out via " sudo apt-get install -f http://funkload.nuxeo.org/snapshots/ -U funkloadinstall" is messed up -- the port number is weird.

Tried the same installation as blogged here and then I repeated the whole process with virtualenvwrapper for good measure. Virtualenv was a nicer place to try testing if each *.py file worked or not. Atleast some of the .py files ran and errors reduced but the one consistent error was the high port number. Strange that the Install file (or was it the Readme file?) lists localhost on port "http://localhost:33301/".

So although both installation methods failed spectacularly i wanted to document all the stuff that i tried for my reference. After an 18-hour day, blogging is the last thing on my mind but very often when I do some stuff, am tired after these marathon days, move on as i'm tired and dont document it. The next time I want to replicate the _exact_ method i followed earlier, I waste more time digging out stuff. This is especially true with eggs which break easily and i'm a vegetarian who dislikes omelette ;)

2010 April 18 [Sunday]

virtualenvwrapper.hook_loader error

Eversince upgrading and installing virtualenvwrapper which now has support for all bash shells, I get the following error when the terminal is invoked:

virtualenvwrapper.sh: Could not find Python module virtualenvwrapper.hook_loader using VIRTUALENVWRAPPER_PYTHON=/usr/bin/python. Is the PATH set properly?

I have not seen this error in the older virtualenvwrappers, and I am wondering if it has anything to do with the way python is packaged in Ubuntu? or something else?

Doug writes about extending wrappers, BUT ...But...but, I have not defined a source hook for it and nor am I extending it. Its vanilla, invoked with "mkvirtualenv projectname", "workon" or should that change too? Yeah, Virtualenvwrapper works but I dont like seeing this error message each time the shell is invoked. Its annoying.


Doug left a comment and I had mailed him that by cloning his repo, I was "doing it wrong". And, what went wrong? This:
0. Cloning doug's repo with hg clone http://bitbucket.org/dhellmann/virtualenvwrapper --which downloaded it to the users home directory. Ex. /home/me.
1. Downloading http://www.doughellmann.com/projects/virtualenvwrapper/ -- it puts the tar.gz file in the directory that one specified in the Firefox settings.

The correct method:

$ sudo easy_install pip

$ sudo pip install virtualenvwrapper which installed a copy of the script in /usr/local/bin and the support libraries are placed in /usr/local/lib/python2.6/dist-packages.

There is a command reference too and during my search I found a wontfix bug which explains why users will have to set a path themselves.

2010 April 11 [Sunday]


Sometime last week my virtualenvwrapper installation broke the bashrc file. On irc, Theju pointed out why -- support for other shells besides bash was added in the dhellmann repo.

Here are some more useful links:

Ian's repo: http://bitbucket.org/ianb/virtualenv/








If you want to use different python installations without breaking your system, read up and try any of these tools. What environment to use is always a personal choice --some use "virtualenvwrapper" but some use " virtualenv + pip". Experiment --if it helps, i broke my system twice within this week!!

After virtualenvwrapper, I decided to try pip+virtualenv and fired up a terminal :

$ sudo aptitude install python-setuptools
$ sudo easy_install virtualenv

Searching for virtualenv
Reading http://pypi.python.org/simple/virtualenv/
Reading http://virtualenv.openplans.org
Best match: virtualenv 1.4.6
Downloading http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.4.6.tar.gz#md5=f576969d591a054132fe8c9165c2b3c3
Processing virtualenv-1.4.6.tar.gz
Running virtualenv-1.4.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-cpu9vj/virtualenv-1.4.6/egg-dist-tmp-nPmcHn
warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
Adding virtualenv 1.4.6 to easy-install.pth file
Installing virtualenv script to /usr/local/bin
Installed /usr/local/lib/python2.6/dist-packages/virtualenv-1.4.6-py2.6.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv

Its that easy!!