Greeting err 22

79 views
Skip to first unread message

Ljubisa Gavrilovic

unread,
Oct 7, 2012, 8:49:02 AM10/7/12
to couch...@googlegroups.com
I am trying to make initial code working but have hit a following problem:

code:

import datetime

from couchdbkit import *

class Greeting(Document):
    author = StringProperty()
    content = StringProperty()
    date = DateTimeProperty()



# server object
server = Server()

# create database
db = server.get_or_create_db("greeting")

# associate Greeting to the db
Greeting.set_db(db)

# create a new greet
greet = Greeting(
    author="Benoit",
    content="Welcome to couchdbkit world",
    date=datetime.datetime.utcnow()
)

# save it
greet.save()

result:

Traceback (most recent call last):
  File "save2db.py", line 16, in <module>
    db = server.get_or_create_db("greeting")
  File "/Library/Python/2.6/site-packages/couchdbkit/client.py", line 146, in create_db
    return self.get_db(dbname, create=True, **params)
  File "/Library/Python/2.6/site-packages/couchdbkit/client.py", line 131, in get_db
    return Database(self._db_uri(dbname), server=self, **params)
  File "/Library/Python/2.6/site-packages/couchdbkit/client.py", line 265, in __init__
    self.server.res.head('/%s/' % self.dbname)
  File "/Library/Python/2.6/site-packages/restkit/resource.py", line 122, in head
    params_dict=params_dict, **params)
  File "/Library/Python/2.6/site-packages/couchdbkit/resource.py", line 111, in request
    payload=payload, headers=headers, **params)
  File "/Library/Python/2.6/site-packages/restkit/resource.py", line 190, in request
    headers=self.make_headers(headers))
  File "/Library/Python/2.6/site-packages/restkit/client.py", line 432, in request
    return self.perform(request)
  File "/Library/Python/2.6/site-packages/restkit/client.py", line 305, in perform
    conn = self.get_connection(request)
  File "/Library/Python/2.6/site-packages/restkit/client.py", line 194, in get_connection
    extra_headers=extra_headers, **self.ssl_args)
  File "/Library/Python/2.6/site-packages/socketpool/pool.py", line 173, in get
    if new_item.is_connected():
  File "/Library/Python/2.6/site-packages/restkit/conn.py", line 51, in is_connected
    return is_connected(self._s)
  File "/Library/Python/2.6/site-packages/socketpool/util.py", line 108, in is_connected
    kq.control(events, 0)
OSError: [Errno 22] Invalid argument

osx 10.6.8. py (standard) Python 2.6.1 couchdbkit-0.6.3
{"couchdb":"Welcome","version":"1.2.0"} (administrator user created) server port 5984



Benoit Chesneau

unread,
Oct 8, 2012, 3:32:56 AM10/8/12
to couch...@googlegroups.com
looks like something not supported on this version of python with the
kqueue module. What is the version of the socketpool module installed
on your system?

- benoît
> --
> You received this message because you are subscribed to the Google Groups
> "couchdbkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/couchdbkit/-/xFGACfWyVOgJ.
> To post to this group, send email to couch...@googlegroups.com.
> To unsubscribe from this group, send email to
> couchdbkit+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/couchdbkit?hl=en.

Ljubisa Gavrilovic

unread,
Oct 8, 2012, 10:32:55 AM10/8/12
to couch...@googlegroups.com
I tend to believe that this is the one... it could be that it was installed using pip...

socketpool-0.5.2-py2.6.egg

took me a while to figure out where is what...

this is a log (fortunately saved....) I have notice a problem with restkit (would this make a problem?)

attached at the bottom...


On Monday, October 8, 2012 9:32:56 AM UTC+2, Benoit Chesneau wrote:
looks like something not supported on this version of python with the
kqueue module.  What is the version of the socketpool module installed
on your system?

- benoît
On Sun, Oct 7, 2012 at 2:49 PM, Ljubisa Gavrilovic <lj01...@gmail.com> wrote:
> I am trying to make initial code working but have hit a following problem:
>



$pip install couchdbkit
Downloading/unpacking couchdbkit
  Downloading couchdbkit-0.6.3.tar.gz (79kB): 79kB downloaded
  Running setup.py egg_info for package couchdbkit
    warning: no files found matching '*' under directory 'docs'
Downloading/unpacking restkit>=4.1.3 (from couchdbkit)
  Downloading restkit-4.2.0.tar.gz (1.3MB): 1.3MB downloaded
  Running setup.py egg_info for package restkit
Requirement already satisfied (use --upgrade to upgrade): nose in /Library/Python/2.6/site-packages/nose-1.0.0-py2.6.egg (from couchdbkit)
Downloading/unpacking http-parser>=0.7.7 (from restkit>=4.1.3->couchdbkit)
  Downloading http-parser-0.7.12.tar.gz (139kB): 139kB downloaded
  Running setup.py egg_info for package http-parser
Downloading/unpacking socketpool>=0.5.0 (from restkit>=4.1.3->couchdbkit)
  Downloading socketpool-0.5.2.tar.gz
  Running setup.py egg_info for package socketpool
Requirement already satisfied (use --upgrade to upgrade): webob in /Library/Python/2.6/site-packages/WebOb-1.0.8-py2.6.egg (from restkit>=4.1.3->couchdbkit)
Installing collected packages: couchdbkit, restkit, http-parser, socketpool
  Running setup.py install for couchdbkit
    warning: no files found matching '*' under directory 'docs'
  Running setup.py install for restkit
    changing mode of build/scripts-2.6/restcli from 644 to 755
    error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.6/restkit': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/var/folders/iI/iIWrtZ2JE6mFvLglDiAovE+++TI/-Tmp-/pip-build/restkit/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/iI/iIWrtZ2JE6mFvLglDiAovE+++TI/-Tmp-/pip-O3AJBR-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

creating build

creating build/lib

creating build/lib/restkit

copying restkit/__init__.py -> build/lib/restkit

copying restkit/client.py -> build/lib/restkit

copying restkit/conn.py -> build/lib/restkit

copying restkit/datastructures.py -> build/lib/restkit

copying restkit/errors.py -> build/lib/restkit

copying restkit/filters.py -> build/lib/restkit

copying restkit/forms.py -> build/lib/restkit

copying restkit/oauth2.py -> build/lib/restkit

copying restkit/resource.py -> build/lib/restkit

copying restkit/session.py -> build/lib/restkit

copying restkit/tee.py -> build/lib/restkit

copying restkit/util.py -> build/lib/restkit

copying restkit/version.py -> build/lib/restkit

copying restkit/wrappers.py -> build/lib/restkit

creating build/lib/tests

copying tests/004-test-client.py -> build/lib/tests

copying tests/005-test-resource.py -> build/lib/tests

copying tests/006-test-webob.py -> build/lib/tests

copying tests/007-test-util.py -> build/lib/tests

copying tests/008-test-request.py -> build/lib/tests

copying tests/009-test-oauth_filter.py -> build/lib/tests

copying tests/010-test-proxies.py -> build/lib/tests

copying tests/__init__.py -> build/lib/tests

copying tests/_server_test.py -> build/lib/tests

copying tests/t.py -> build/lib/tests

copying tests/treq.py -> build/lib/tests

creating build/lib/restkit/contrib

copying restkit/contrib/__init__.py -> build/lib/restkit/contrib

copying restkit/contrib/console.py -> build/lib/restkit/contrib

copying restkit/contrib/ipython_shell.py -> build/lib/restkit/contrib

copying restkit/contrib/webob_api.py -> build/lib/restkit/contrib

copying restkit/contrib/webob_helper.py -> build/lib/restkit/contrib

copying restkit/contrib/wsgi_proxy.py -> build/lib/restkit/contrib

running build_scripts

creating build/scripts-2.6

copying and adjusting scripts/restcli -> build/scripts-2.6

changing mode of build/scripts-2.6/restcli from 644 to 755

running install_lib

creating /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/__init__.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/client.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/conn.py -> /Library/Python/2.6/site-packages/restkit

creating /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/contrib/__init__.py -> /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/contrib/console.py -> /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/contrib/ipython_shell.py -> /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/contrib/webob_api.py -> /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/contrib/webob_helper.py -> /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/contrib/wsgi_proxy.py -> /Library/Python/2.6/site-packages/restkit/contrib

copying build/lib/restkit/datastructures.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/errors.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/filters.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/forms.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/oauth2.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/resource.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/session.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/tee.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/util.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/version.py -> /Library/Python/2.6/site-packages/restkit

copying build/lib/restkit/wrappers.py -> /Library/Python/2.6/site-packages/restkit

creating /Library/Python/2.6/site-packages/tests

copying build/lib/tests/004-test-client.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/005-test-resource.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/006-test-webob.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/007-test-util.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/008-test-request.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/009-test-oauth_filter.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/010-test-proxies.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/__init__.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/_server_test.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/t.py -> /Library/Python/2.6/site-packages/tests

copying build/lib/tests/treq.py -> /Library/Python/2.6/site-packages/tests

byte-compiling /Library/Python/2.6/site-packages/restkit/__init__.py to __init__.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/client.py to client.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/conn.py to conn.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/contrib/__init__.py to __init__.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/contrib/console.py to console.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/contrib/ipython_shell.py to ipython_shell.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/contrib/webob_api.py to webob_api.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/contrib/webob_helper.py to webob_helper.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/contrib/wsgi_proxy.py to wsgi_proxy.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/datastructures.py to datastructures.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/errors.py to errors.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/filters.py to filters.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/forms.py to forms.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/oauth2.py to oauth2.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/resource.py to resource.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/session.py to session.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/tee.py to tee.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/util.py to util.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/version.py to version.pyc

byte-compiling /Library/Python/2.6/site-packages/restkit/wrappers.py to wrappers.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/004-test-client.py to 004-test-client.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/005-test-resource.py to 005-test-resource.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/006-test-webob.py to 006-test-webob.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/007-test-util.py to 007-test-util.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/008-test-request.py to 008-test-request.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/009-test-oauth_filter.py to 009-test-oauth_filter.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/010-test-proxies.py to 010-test-proxies.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/__init__.py to __init__.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/_server_test.py to _server_test.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/t.py to t.pyc

byte-compiling /Library/Python/2.6/site-packages/tests/treq.py to treq.pyc

running install_data

creating /System/Library/Frameworks/Python.framework/Versions/2.6/restkit

error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.6/restkit': Permission denied

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/var/folders/iI/iIWrtZ2JE6mFvLglDiAovE+++TI/-Tmp-/pip-build/restkit/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/iI/iIWrtZ2JE6mFvLglDiAovE+++TI/-Tmp-/pip-O3AJBR-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/iI/iIWrtZ2JE6mFvLglDiAovE+++TI/-Tmp-/pip-build/restkit
Storing complete log in /Users/lj/Library/Logs/pip.log

 
Reply all
Reply to author
Forward
0 new messages