Michal
Michal

Reputation: 1905

Trying to Create a Shell Script Running a Python Script using wget

I am trying to call an API once a day and save the data in the json using Python and convert it into a csv file.

I am using the wget library to download the file. Even though I installed wget correctly and am able to use it in the Python Shell, I cannot run the script in bash since I get the error:

File "<stdin>", line 1, in <module>
ImportError: No module named wget

How can I install wget on bash? Perhaps there is a built-in library that I could use instead?

My code using wget is:

import wget

file_url = 'http://api-website'
file_name = wget.download(file_url)

Upvotes: 0

Views: 1758

Answers (1)

Kasravnd
Kasravnd

Reputation: 107347

download wget form this link and install with this commands :

Extract Wget

$ cd /tmp/wget
$ gzip -dc < wget-2.2.tar.gz | tar -xf -
$ cd wget-2.2

Build Wget

$ ./configure --prefix=/usr
$ make

Install Wget (must be root user)

$ sudo make install

Upvotes: 1

Related Questions