I am, sending you full step . Pls follow this step you will get to know what step you missed before …
Login to your Ubuntu server and create a folder and you can give any name to the folder.
mkdir crypto_alert
After creating the folder we will go inside the folder by typing the below commands.
cd crypto_alert
now we shall install the pip package manager for Python-2.7. A pip command is a tool for installing and managing Python packages, such as those found in the Python Package Index, For example, boltiot, Twilio etc.
sudo apt-get -y install python-pip
and then we will install the python virtualenv and virtualenvwrapper.
virtualenv will help us to create isolated Python environments. Type the below command to install virtualenv and virtualenvwrapper.
sudo apt-get install python-virtualenv
sudo pip install virtualenvwrapper
After installing the virtualenv and virtualenvwrapper , we will add it in bashrc file.
sudo echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc
sudo echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
Now installation is done and we will create a virtual environment.
mkvirtualenv crypto_alert
The above command will create virtual environment with name crypto_alert
and we will activate the crypto_alert virtual environment by typing the below command.
workon crypto_alert
and then we shall install the boltiot packages and after installing the boltiot packages.
pip install boltiot
pip install --upgrade pip
and we will install some security packages because we will be using some external API.
pip install pyOpenSSL ndg-httpsclient pyasn1
pip install 'requests[security]'
def get_bitcoin_price():
URL = "https://min-api.cryptocompare.com/" # REPLACE WITH CORRECT URL
response = requests.request("GET", URL)
response = json.loads(response.text)
current_price = response["USD"]
return current_price
now at last use this code . hope your problem will solve now …