Find the answer to your Linux question:
Results 1 to 1 of 1
try to install orm peewee on opensuse 13. 1 this was the way i tried to install it: Installing peewee — peewee 2.2.5 documentation Databases — peewee 2.2.5 documentation but ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2013
    Posts
    174

    try to install orm peewee on opensuse 13. 1 - with live-example


    try to install orm peewee on opensuse 13. 1



    this was the way i tried to install it:

    Installing peewee — peewee 2.2.5 documentation
    Databases — peewee 2.2.5 documentation


    but unfortunatly it failed

    Code:
    martin@linux-70ce:~> 
    martin@linux-70ce:~> git clone https://github.com/coleifer/peewee.git
    Klone nach 'peewee'...
    remote: Reusing existing pack: 5673, done.
    remote: Counting objects: 13, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 5686 (delta 2), reused 0 (delta 0)
    Empfange Objekte: 100% (5686/5686), 3.54 MiB | 102.00 KiB/s, done.
    Löse Unterschiede auf: 100% (3468/3468), done.
    Prüfe Konnektivität... Fertig
    martin@linux-70ce:~> cd peewee
    martin@linux-70ce:~/peewee> python setup.py install
    running install
    error: can't create or remove files in install directory
    
    The following error occurred while trying to add or remove files in the
    installation directory:
    
        [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/test-easy-install-5717.write-test'
    
    The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:
    
        /usr/lib/python2.7/site-packages/
    
    Perhaps your account does not have write access to this directory?  If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account.  If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.
    
    For information on other options, you may wish to consult the
    documentation at:
    
      https://pythonhosted.org/setuptools/easy_install.html
    
    Please make the appropriate changes for your system and try again.
    
    martin@linux-70ce:~/peewee>
    what can i do now


    see here after installation vof simplejson - it went better - see the following


    Code:
    Please make the appropriate changes for your system and try again.
    
    martin@linux-70ce:~/peewee> git clone https://github.com/coleifer/peewee.git
    Klone nach 'peewee'...                                                                                                                                                              
    remote: Reusing existing pack: 5673, done.
    remote: Counting objects: 13, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 5686 (delta 2), reused 0 (delta 0)
    Empfange Objekte: 100% (5686/5686), 3.54 MiB | 309.00 KiB/s, done.                                                                                                                  
    Löse Unterschiede auf: 100% (3468/3468), done.                                                                                                                                      
    Prüfe Konnektivität... Fertig                                                                                                                                                       
    martin@linux-70ce:~/peewee>
    guess that now all is fine - i will do some checks
    and afterwards i will come back here.




    had issues with installing peewee
    Code:
    martin@linux-70ce:~>
    martin@linux-70ce:~> git clone https://github.com/coleifer/peewee.git
    Klone nach 'peewee'...
    remote: Reusing existing pack: 5673, done.
    remote: Counting objects: 13, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 5686 (delta 2), reused 0 (delta 0)
    Empfange Objekte: 100% (5686/5686), 3.54 MiB | 102.00 KiB/s, done.
    Löse Unterschiede auf: 100% (3468/3468), done.
    Prüfe Konnektivität... Fertig
    martin@linux-70ce:~> cd peewee
    martin@linux-70ce:~/peewee> python setup.py install
    running install
    error: can't create or remove files in install directory
    
    The following error occurred while trying to add or remove files in the
    installation directory:
    
        [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/test-easy-install-5717.write-test'
    
    The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:
    
        /usr/lib/python2.7/site-packages/
    
    Perhaps your account does not have write access to this directory?  If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account.  If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.
    
    For information on other options, you may wish to consult the
    documentation at:
    
      https://pythonhosted.org/setuptools/easy_install.html
    Please make the appropriate changes for your system and try again.
    martin@linux-70ce:~/peewee>

    afer that - as written above - i installed simplejson and then i tried to install peewee again
    now i guess i had more luck....

    Code:
                                                                                                                                                                             
    
    martin@linux-70ce:~/peewee> git clone https://github.com/coleifer/peewee.git
    Klone nach 'peewee'...                                                                                                                                                             
    remote: Reusing existing pack: 5673, done.
    remote: Counting objects: 13, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 5686 (delta 2), reused 0 (delta 0)
    Empfange Objekte: 100% (5686/5686), 3.54 MiB | 309.00 KiB/s, done.                                                                                                                 
    Löse Unterschiede auf: 100% (3468/3468), done.                                                                                                                                     
    Prüfe Konnektivität... Fertig                                                                                                                                                       
    martin@linux-70ce:~/peewee>
    SEE THE FULL CODE - THAT I AM RUNNING
    Code:
    import urllib
    import urlparse
    import re
    from peewee import *
    import json
    
    db = MySQLDatabase('cpan', user='root',passwd='rimbaud')
    
    class User(Model):
        name = TextField()
        cname = TextField()
        email = TextField()
        url = TextField()
    
        class Meta:
            database = db # this model uses the cpan database
    
            
    User.create_table() #ensure table is created
    
    
    url = "http://search.cpan.org/author/?W"
    html = urllib.urlopen(url).read()
    for lk, capname, name in re.findall('<a href="(/~.*?/)"><b>(.*?)</b></a><br/><small>(.*?)</small>', html):
        alk = urlparse.urljoin(url, lk)
    
        data = { 'url':alk, 'name':name, 'cname':capname }
    
        phtml = urllib.urlopen(alk).read()
        memail = re.search('<a href="mailto:(.*?)">', phtml)
        if memail:
            data['email'] = memail.group(1)
            
    
    data = json.load() #your json data file here
    
    for entry in data: #assuming your data is an array of JSON objects
        user = User.create(name=entry["name"], cname=entry["cname"],
            email=entry["email"], url=entry["url"])
        user.save()

    and the subsequently results:

    Code:
    martin@linux-70ce:~/perl> python cpan6.py
    python: can't open file 'cpan6.py': [Errno 2] No such file or directory
    martin@linux-70ce:~/perl> python cpan5.py
    Traceback (most recent call last):
      File "cpan5.py", line 7, in <module>
        from peewee import *
    ImportError: No module named peewee
    martin@linux-70ce:~/perl>
    at the moment i have no clue...
    Last edited by sayhello; 1 Week Ago at 08:59 PM.
    Akoya P 6512 15" OpenSuse 13.1: AMD Athlon X2 P320
    Samsunng q 210, 12,1" OpenSuse 13.1: Intel® Core™ 2 Duo Proz. P8400 2,26 GHz 1066 MHz FSB 3 MB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •