Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: running into issues while installing beautiful soup version 4 via terninal

  1. #1

    Default running into issues while installing beautiful soup version 4 via terninal

    hello dear Community

    running into issues while installing beautiful soup version 4 via terninal on a leap 42.3
    Code:
    
    
    martin@linux-3645:~> pip install beautifulsoup4
    Collecting beautifulsoup4
      Downloading beautifulsoup4-4.6.0-py3-none-any.whl (86kB)
        100% |████████████████████████████████| 90kB 405kB/s 
    Installing collected packages: beautifulsoup4
    Exception:
    Traceback (most recent call last):
      File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 211, in main
        status = self.run(options, args)
      File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line 311, in run
        root=options.root_path,
      File "/usr/lib/python3.4/site-packages/pip/req/req_set.py", line 646, in install
        **kwargs
      File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line 803, in install
        self.move_wheel_files(self.source_dir, root=root)
      File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line 998, in move_wheel_files
        isolated=self.isolated,
      File "/usr/lib/python3.4/site-packages/pip/wheel.py", line 339, in move_wheel_files
        clobber(source, lib_dir, True)
      File "/usr/lib/python3.4/site-packages/pip/wheel.py", line 310, in clobber
        ensure_dir(destdir)
      File "/usr/lib/python3.4/site-packages/pip/utils/__init__.py", line 71, in ensure_dir
        os.makedirs(path)
      File "/usr/lib64/python3.4/os.py", line 237, in makedirs
        mkdir(name, mode)
    PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.4/site-packages/bs4'
    You are using pip version 7.1.2, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    martin@linux-3645:~>
    what would you do ?

    by the way - see the arrangement of the notebook - especially the hard drive

    Code:
    martin@linux-3645:~> zypper lr -uP
    #  | Alias                     | Name                                    | Aktiviert | GPG-Überprüfung | Aktualisierung | Priorität | URI                                                                       
    ---+---------------------------+-----------------------------------------+-----------+-----------------+----------------+-----------+---------------------------------------------------------------------------
     1 | ecsos                     | ecsos                                   | Ja        | (r ) Ja         | Ja             |   99      | https://download.opensuse.org/reposi...USE_Leap_42.3/
     2 | openSUSE-Leap-42.3-0      | openSUSE-Leap-42.3-0                    | Ja        | (r ) Ja         | Nein           |   99      | cd:///?devices=/dev/disk/by-id/ata-hp_DVDRAM_GU90N_KMNZ8C81556            
     3 | repo-debug                | openSUSE-Leap-42.3-Debug                | Nein      | ----            | ----           |   99      | http://download.opensuse.org/debug/d...42.3/repo/oss/       
     4 | repo-debug-non-oss        | openSUSE-Leap-42.3-Debug-Non-Oss        | Nein      | ----            | ----           |   99      | http://download.opensuse.org/debug/d.../repo/non-oss/   
     5 | repo-debug-update         | openSUSE-Leap-42.3-Update-Debug         | Nein      | ----            | ----           |   99      | http://download.opensuse.org/debug/u...leap/42.3/oss/                  
     6 | repo-debug-update-non-oss | openSUSE-Leap-42.3-Update-Debug-Non-Oss | Nein      | ----            | ----           |   99      | http://download.opensuse.org/debug/u.../42.3/non-oss/              
     7 | repo-non-oss              | openSUSE-Leap-42.3-Non-Oss              | Ja        | (r ) Ja         | Ja             |   99      | http://download.opensuse.org/distrib.../repo/non-oss/         
     8 | repo-oss                  | openSUSE-Leap-42.3-Oss                  | Ja        | (r ) Ja         | Ja             |   99      | http://download.opensuse.org/distrib...42.3/repo/oss/             
     9 | repo-source               | openSUSE-Leap-42.3-Source               | Nein      | ----            | ----           |   99      | http://download.opensuse.org/source/...42.3/repo/oss/      
    10 | repo-source-non-oss       | openSUSE-Leap-42.3-Source-Non-Oss       | Nein      | ----            | ----           |   99      | http://download.opensuse.org/source/.../repo/non-oss/  
    11 | repo-update               | openSUSE-Leap-42.3-Update               | Ja        | (r ) Ja         | Ja             |   99      | http://download.opensuse.org/update/leap/42.3/oss/                        
    12 | repo-update-non-oss       | openSUSE-Leap-42.3-Update-Non-Oss       | Ja        | (r ) Ja         | Ja             |   99      | http://download.opensuse.org/update/leap/42.3/non-oss/                    
    martin@linux-3645:~> sudo fdisk -l 
    
    Wir gehen davon aus, dass der lokale Systemadministrator Ihnen die
    Regeln erklärt hat.  Normalerweise läuft es auf drei Regeln hinaus:
    
        #1) Respektieren Sie die Privatsphäre anderer.
        #2) Denken Sie nach, bevor Sie tippen.
        #3) Mit großer Macht kommt große Verantwortung.
    
    [sudo] Passwort für root: 
    Festplatte /dev/sda: 465,8 GiB, 500107862016 Bytes, 976773168 Sektoren
    Einheiten: Sektoren von 1 * 512 = 512 Bytes
    Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
    E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes
    Festplattenbezeichnungstyp: gpt
    Festplattenbezeichner: 6229C7C4-758C-450E-9D59-F59E2AE3CB11
    
    Gerät        Anfang      Ende  Sektoren  Größe Typ
    /dev/sda1      2048    321535    319488   156M EFI-System
    /dev/sda2    321536   4530175   4208640     2G Microsoft Basisdaten
    /dev/sda3   4530176  46475263  41945088    20G Microsoft Basisdaten
    /dev/sda4  46475264 976773119 930297856 443,6G Microsoft Basisdaten
    
    
    martin@linux-3645:~> sudo sfdisk -l -uM
    sfdisk: nicht unterstützte Einheit „M“
    martin@linux-3645:~> sudo parted -l
    Model: ATA TOSHIBA MQ01ABF0 (scsi)
    Disk /dev/sda: 500GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags: 
    
    Number  Start   End     Size    File system     Name     Flags
     1      1049kB  165MB   164MB   fat16           primary  boot
     2      165MB   2319MB  2155MB  linux-swap(v1)  primary
     3      2319MB  23,8GB  21,5GB  btrfs           primary
     4      23,8GB  500GB   476GB   xfs             primary
    dilbert ;-)
    Akoya P 6512 15" OpenSuse Leap 42.3: Athlon X2 P320 ( 2,1 GHz); 4 GB Hyundai DDR3;
    HP Notebook hp 14 r 103ng - OpenSuse Leap 42.3

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,244
    Blog Entries
    15

    Default Re: running into issues while installing beautiful soup version 4via terninal

    On Tue 05 Dec 2017 11:16:01 PM CST, dilbertone wrote:

    hello dear Community

    running into issues while installing beautiful soup version 4 via
    terninal on a leap 42.3

    Code:
    --------------------




    martin@linux-3645:~> pip install beautifulsoup4
    Collecting beautifulsoup4
    Downloading beautifulsoup4-4.6.0-py3-none-any.whl (86kB)
    100% |████████████████████████████████| 90kB 405kB/s
    Installing collected packages: beautifulsoup4
    Exception:
    Traceback (most recent call last):
    File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 211,
    in main status = self.run(options, args)
    File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line
    311, in run root=options.root_path,
    File "/usr/lib/python3.4/site-packages/pip/req/req_set.py", line 646,
    in install **kwargs
    File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line
    803, in install self.move_wheel_files(self.source_dir, root=root)
    File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line
    998, in move_wheel_files isolated=self.isolated,
    File "/usr/lib/python3.4/site-packages/pip/wheel.py", line 339, in
    move_wheel_files clobber(source, lib_dir, True)
    File "/usr/lib/python3.4/site-packages/pip/wheel.py", line 310, in
    clobber ensure_dir(destdir)
    File "/usr/lib/python3.4/site-packages/pip/utils/__init__.py", line
    71, in ensure_dir os.makedirs(path)
    File "/usr/lib64/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
    PermissionError: [Errno 13] Permission denied:
    '/usr/lib/python3.4/site-packages/bs4' You are using pip version 7.1.2,
    however version 9.0.1 is available. You should consider upgrading via
    the 'pip install --upgrade pip' command. martin@linux-3645:~>

    --------------------


    what would you do ?


    Hi
    You need to be root user to install....

    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2|GNOME 3.20.2|4.4.92-18.36-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  3. #3

    Default Re: running into issues while installing beautiful soup version 4 via terninal

    hello dear all - l still run into troubles....



    Code:
    Collecting pip                                                                                                                                                                                  
      Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)                                                                                                                                            
        100% |████████████████████████████████| 1.3MB 176kB/s 
    Installing collected packages: pip                                                                                                                                                              
      Found existing installation: pip 7.1.2                                                                                                                                                        
        Uninstalling pip-7.1.2:                                                                                                                                                                     
    Exception:                                                                                                                                                                                      
    Traceback (most recent call last):                                                                                                                                                              
      File "/usr/lib64/python3.4/shutil.py", line 527, in move                                                                                                                                      
        os.rename(src, real_dst)                                                                                                                                                                    
    OSError: [Errno 18] Invalid cross-device link: '/usr/bin/pip' -> '/tmp/pip-8hoh9fts-uninstall/usr/bin/pip'                                                                                      
                                                                                                                                                                                                    
    During handling of the above exception, another exception occurred:                                                                                                                             
                                                                                                                                                                                                    
    Traceback (most recent call last):                                                                                                                                                              
      File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 211, in main                                                                                                                 
        status = self.run(options, args)                                                                                                                                                            
      File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line 311, in run                                                                                                             
        root=options.root_path,                                                                                                                                                                     
      File "/usr/lib/python3.4/site-packages/pip/req/req_set.py", line 640, in install
        requirement.uninstall(auto_confirm=True)
      File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line 716, in uninstall
        paths_to_remove.remove(auto_confirm)
      File "/usr/lib/python3.4/site-packages/pip/req/req_uninstall.py", line 125, in remove
        renames(path, new_path)
      File "/usr/lib/python3.4/site-packages/pip/utils/__init__.py", line 315, in renames
        shutil.move(old, new)
      File "/usr/lib64/python3.4/shutil.py", line 532, in move
        os.unlink(src)
    PermissionError: [Errno 13] Permission denied: '/usr/bin/pip'
    You are using pip version 7.1.2, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    dilbert ;-)
    Akoya P 6512 15" OpenSuse Leap 42.3: Athlon X2 P320 ( 2,1 GHz); 4 GB Hyundai DDR3;
    HP Notebook hp 14 r 103ng - OpenSuse Leap 42.3

  4. #4

    Default Re: running into issues while installing beautiful soup version 4via terninal

    On 2017-12-05, malcolmlewis <malcolmlewis@no-mx.forums.microfocus.com> wrote:
    > On Tue 05 Dec 2017 11:16:01 PM CST, dilbertone wrote:
    > what would you do ?
    >
    > Hi
    > You need to be root user to install....


    I don't wish to challenge Malcolm's assertion, but from personal experience I think it's a really bad idea to pip2 or
    pip3 install as root as it doesn't play nicely with package managers (e.g. zypper). For this reason I would only over
    pip install this way:

    Code:
    sh-4.3$ pip3 install --user <package>
    .... to install to ~/.local/

    If you _really_ need to pip install a package as root, then I suspect that's a symptom of a developer environment that
    has not been properly thought through.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,244
    Blog Entries
    15

    Default Re: running into issues while installing beautiful soup version 4 via terninal

    Hi
    @flymail never use pip.... always build rpms

    @dilbertone, use the rpm?

    https://software.opensuse.org/search...aseproject=ALL

    Since it looks like you want python3, then it would be;
    https://software.opensuse.org/packag...beautifulsoup4
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6

    Default Re: running into issues while installing beautiful soup version 4via terninal

    On 2017-12-05, dilbertone <dilbertone@no-mx.forums.microfocus.com> wrote:
    > hello dear all - l still run into troubles....


    Try: https://build.opensuse.org/package/s...beautifulsoup4

  7. #7

    Default Re: running into issues while installing beautiful soup version 4via terninal

    On 2017-12-05, malcolmlewis <malcolmlewis@no-mx.forums.microfocus.com> wrote:
    > @flymail never use pip.... always build rpms


    Haha! Good answer. For some libraries, however, this isn't the most practical option (e.g. Google TensorFlow).


  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,244
    Blog Entries
    15

    Default Re: running into issues while installing beautiful soup version 4via terninal

    Quote Originally Posted by flymail View Post
    On 2017-12-05, malcolmlewis <malcolmlewis@no-mx.forums.microfocus.com> wrote:
    > @flymail never use pip.... always build rpms


    Haha! Good answer. For some libraries, however, this isn't the most practical option (e.g. Google TensorFlow).
    Hi
    Doesn't look too bad to build... if I had a Nvidia card to use.... install the docker image

    About 10 years ago now was building some nuclear molecular software as an rpm.... compile time was around 15 hours.... esp frustrating when would get hours in and then hit an error to fix....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    8,222

    Default Re: running into issues while installing beautiful soup version 4 via terninal

    First, if an RPM is available and sufficient, then it's probably the easiest way to install.

    As for your attempts at installing from PyPi,
    - You should have followed the instructions in your error and upgraded pip. That can be done safely installing to your system defaults, you shouldn't have to worry about conflicts of any type.
    You are using pip version 7.1.2, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    You may wish to isolate your installs, and perhaps even run different versions of Python side by side on your system. To do that, the traditional way is to install and use virtualenv. Otherwise, of course you can use virtualization to run different machines which can be customized however you wish. Installing your python app to a user directory as flymail describes is not always an option, the application may still require elevated permissions to run or code may assume a different install location.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10

    Default Re: running into issues while installing beautiful soup version 4 via terninal

    hello dear malcolm, flymail and Tsu

    many many thanks for the replies and the tipps.


    i did the following :
    Code:
    linux-3645:/home/martin # pip install --upgrade pip                                                                                                                                             
    Collecting pip                                                                                                                                                                                  
      Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)                                                                                                                                            
        100% |████████████████████████████████| 1.3MB 155kB/s 
    Installing collected packages: pip                                                                                                                                                              
      Found existing installation: pip 7.1.2                                                                                                                                                        
        Uninstalling pip-7.1.2:                                                                                                                                                                     
          Successfully uninstalled pip-7.1.2                                                                                                                                                        
    Successfully installed pip-9.0.1                                                                                                                                                                
    linux-3645:/home/martin # pip install beautifulsoup4
    Collecting beautifulsoup4                                                                                                                                                                       
      Downloading beautifulsoup4-4.6.0-py3-none-any.whl (86kB)
        100% |████████████████████████████████| 92kB 394kB/s 
    Installing collected packages: beautifulsoup4
    Successfully installed beautifulsoup4-4.6.0
    linux-3645:/home/martin #

    to test all - and to do some first steps i tried to run the following code;
    Code:
    import urllib
    from bs4 import BeautifulSoup
    import urlparse
    import mechanize
    
    
    # Set the startingpoint for the spider and initialize 
    # the a mechanize browser object
    url = "http://sparkbrowser.com"
    br = mechanize.Browser()
    
    # create lists for the urls in que and visited urls
    urls = [url]
    visited = [url]
    
    
    # Since the amount of urls in the list is dynamic
    #   we just let the spider go until some last url didn't
    #   have new ones on the webpage
    while len(urls)>0:
        try:
            br.open(urls[0])
            urls.pop(0)
            for link in br.links():
                newurl =  urlparse.urljoin(link.base_url,link.url)
                #print newurl
                if newurl not in visited and url in newurl:
                    visited.append(newurl)
                    urls.append(newurl)
                    print newurl
        except:
            print "error"
            urls.pop(0)


    i get the following lines back

    Code:
    martin@linux-3645:~/dev/python> python p1.py
    Traceback (most recent call last):
    File "p1.py", line 3, in <module>
    from bs4 import BeautifulSoup
    ImportError: No module named bs4
    martin@linux-3645:~/dev/python>

    well i am not very sure what happened - probably i have installed the bs4 on the wrong path -

    note - i am running python 3.
    surely - i have to rewrite the above mentioned code to python 3 -

    but the main thing i wonder - is why i get the errormessages....


    how to check if i have installed bs4 corrrectly?
    dilbert ;-)
    Akoya P 6512 15" OpenSuse Leap 42.3: Athlon X2 P320 ( 2,1 GHz); 4 GB Hyundai DDR3;
    HP Notebook hp 14 r 103ng - OpenSuse Leap 42.3

Page 1 of 2 12 LastLast

Posting Permissions

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