Created
April 17, 2017 06:31
-
-
Save nikhilkumarsingh/5afed5a8c2371626620ea376ce795994 to your computer and use it in GitHub Desktop.
Demo python script to interact with Wit.ai app using a Python Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wit import Wit | |
access_token = "server_access_token_here" | |
client = Wit(access_token = access_token) | |
message_text = "i live in Australia" | |
resp = client.message(message_text) | |
print(resp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I installed wit using pip install wit. then again redeploy on heroku.
here is the terminal
(myvenv) D:\MamaBot>pip install wit
Requirement already satisfied: wit in d:\mamabot\myvenv\lib\site-packages (6.0.0)
Requirement already satisfied: requests>=0.8.8 in d:\mamabot\myvenv\lib\site-packages (from wit) (2.25.0)
Requirement already satisfied: prompt-toolkit in d:\mamabot\myvenv\lib\site-packages (from wit) (3.0.8)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\mamabot\myvenv\lib\site-packages (from requests>=0.8.8->wit) (1.26.2)
Requirement already satisfied: chardet<4,>=3.0.2 in d:\mamabot\myvenv\lib\site-packages (from requests>=0.8.8->wit) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in d:\mamabot\myvenv\lib\site-packages (from requests>=0.8.8->wit) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in d:\mamabot\myvenv\lib\site-packages (from requests>=0.8.8->wit) (2020.11.8)
Requirement already satisfied: wcwidth in d:\mamabot\myvenv\lib\site-packages (from prompt-toolkit->wit) (0.2.5)
(myvenv) D:\MamaBot>pip freeze > requirements.txt
(myvenv) D:\MamaBot>git init
Reinitialized existing Git repository in D:/MamaBot/.git/
(myvenv) D:\MamaBot>git status
On branch master
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: utils.py
no changes added to commit (use "git add" and/or "git commit -a")
(myvenv) D:\MamaBot>git add .
(myvenv) D:\MamaBot>git status
On branch master
Changes to be committed:
(use "git restore --staged ..." to unstage)
modified: utils.py
(myvenv) D:\MamaBot>git commit -m "initial commit"
[master 4c91ccd] initial commit
1 file changed, 1 insertion(+), 1 deletion(-)
(myvenv) D:\MamaBot>heroku git:remote -a frozen-gorge-43617
set git remote heroku to https://git.heroku.com/frozen-gorge-43617.git
(myvenv) D:\MamaBot>git push heroku master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 293 bytes | 48.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> No change in requirements detected, installing from cache
remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 47M
remote: -----> Launching...
remote: Released v11
remote: https://frozen-gorge-43617.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/frozen-gorge-43617.git
0c00b45..4c91ccd master -> master
(myvenv) D:\MamaBot>python app.py
Traceback (most recent call last):
File "app.py", line 3, in
from utils import wit_response
File "D:\MamaBot\utils.py", line 1, in
from wit import Wit
ModuleNotFoundError: No module named 'wit'
am I doing any wrong??

please help me