Jump to content

Recommended Posts

try to install orm peewee on opensuse 13. 1

but unfortunatly it failed

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

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

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


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
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....
                                                                                                                                                                                    
          
                                                                                                                                                                         

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

      
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>

After  the installation of peewwee i runned a script again,,,
 

Code:


    import urllib
    import urlparse
    import re
    import peewee
    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()
   

i got back the following results:



Code:        

    Traceback (most recent call last):
      File "cpan5.py", line 10, in <module>
        db = MySQLDatabase('cpan', user='root',passwd='rimbaud')
    NameError: name 'MySQLDatabase' is not defined
    linux-70ce:/home/martin/perl #


well i guess that i have some issues with the name.

note:
the database is named cpan
the user is root
the passwd is rimbaud

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.