Results 1 to 9 of 9

Thread: installing wget for python on ubuntu

  1. #1
    Join Date
    Apr 2015
    Beans
    109
    Distro
    Ubuntu 18.04 Bionic Beaver

    installing wget for python on ubuntu

    Hi all,

    I want to use the wget library in python so I downloaded the .tar.gz file, extracted it and went to the file path with the setup.py file and tried ./setup.py and python setup.py but can't get it to work. I get errors.

    Code:
     brandon@brandon-NV57H:~/Downloads/wget-2.2$ ./setup.py 
    from: can't read /var/mail/distutils.core 
    ./setup.py: line 4: syntax error near unexpected token `(
    ' 
    ./setup.py: line 4: `def get_version(relpath):'
    
    
     brandon@brandon-NV57H:~/Downloads/wget-2.2$ python setup.
    py 
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd
    2_opts] ...] 
       or: setup.py --help [cmd1 cmd2 ...] 
       or: setup.py --help-commands 
       or: setup.py cmd --help 
    
    error: no commands supplied
    
    
    Can anyone help me get this up and running? I'm using python 2.7

  2. #2
    Join Date
    Aug 2014
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: installing wget for python on ubuntu

    Try installing with pip.
    Code:
    sudo apt-get install python-pip
    Code:
    sudo pip install wget

  3. #3
    Join Date
    Apr 2015
    Beans
    109
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: installing wget for python on ubuntu

    Thanks, it worked. But, what exactly did all of that do. What is pip? can you break it all down for me. Thanks

  4. #4
    Join Date
    Apr 2015
    Beans
    109
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: installing wget for python on ubuntu

    One tiny problem though. I'm still unable to import with python

    import wget

  5. #5
    Join Date
    Aug 2014
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: installing wget for python on ubuntu

    Maybe you just needed sudo to run the command in your first post.
    python-pip
    pip is a replacement for easy_install, and is intended to be an improved
    Python package installer. It integrates with virtualenv, doesn't do
    partial installs, can save package state for replaying, can install from
    non-egg sources, and can install from version control repositories.
    Sorry I don't code... just use pip to install a couple of python scripts I use.
    pip allows you to search, install and upgrade python packages from Python Package Index

    Best I can do is give you a link... Installation Tool Recommendations

    Maybe start a new thread in Programming Talk
    Last edited by CantankRus; July 22nd, 2015 at 03:07 AM.

  6. #6
    Join Date
    Apr 2015
    Beans
    109
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: installing wget for python on ubuntu

    thanks!

  7. #7
    Join Date
    Apr 2015
    Beans
    109
    Distro
    Ubuntu 18.04 Bionic Beaver

    Installing and importing wget in python

    Hi all,

    I'm trying to use wget in one of my programs. I used pip to install wget and it said that the installation was successful but the problem is that I still can't import wget. Can anyone help? I'm using python2.7.

  8. #8
    Join Date
    Feb 2008
    Location
    Land of fire and drought
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: installing wget for python on ubuntu

    Thread merged.

    Please do not post duplicates on the same issue. You are getting support here already. The advice to start a new thread in Programming Talk was not good. It dilutes your chances of support as your support request hasn't changed, just progressed a little.

    You are already in Programming Talk. Thanks.
    Last edited by Bucky Ball; July 22nd, 2015 at 03:55 AM.

  9. #9
    Join Date
    Jul 2015
    Beans
    112
    Distro
    Xubuntu

    Re: installing wget for python on ubuntu

    Try checking /usr/local/lib/python2.7/dist-packages/ to make sure that wget.py and wget.pyc are there. There should also be a wget-related directory there. If they're not there, then you'll need to redo the pip install. If they are there, what errors are you getting when you try to import it?

    Also, is there any reason you are trying to use wget rather than Python's urllib2?

Tags for this Thread

Bookmarks

Posting Permissions

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