GithubHelp home page GithubHelp logo

tbot installation about tbot HOT 5 CLOSED

rahix avatar rahix commented on July 17, 2024
tbot installation

from tbot.

Comments (5)

Rahix avatar Rahix commented on July 17, 2024

Hello @srnae05,

I am a beginner in linux.

Not sure how much beginner, so if you know most of this already, ignore it: On Linux (or more generally, in all POSIX systems) the shell searches for commands in the directories given in the $PATH environment variable. You can take a look at this list using this command:

❯ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin

Now, in the installation instructions of tbot, you were supposed to run the install command like this:

❯ python3 setup.py install --user
[...]

Without the --user, this command would have installed tbot to /usr/local/bin, but your user does not have access rights to that directory. So instead, using the --user flag, it is installed in your home-directory, more specifically into ~/.local/bin. This directory is not in your $PATH by default so you need to add it manually.

To do this, you have to add another command to your .bashrc:

export PATH=~/.local/bin:$PATH

Once you then open a new shell session you should be able to run tbot :)

from tbot.

srnae05 avatar srnae05 commented on July 17, 2024

Hello @Rahix

Thank you for the reply.

It runs now, I did not add export PATH=~/.local/bin:$PATH to ~.bashrc

I have another point,

  • In the documentation, there is a step that say source /path/to/tbot/completions.sh to ~.bashrc.
    This is how I did it. In the terminal, I used the source /mypathToTbot/completions.sh. However when I open the ~.bashrc, this is not reflected.

I believe I am doing something wrong here since my self test is failing

-------------------------Another Issue---------------------------------------------------------
When I execute other .py files, i get the same error KeyError: 'hello_world'. I believe that tbot is not able to find the function definition of hello_world in a .py file. How do I fix this ? Thanks !

from tbot.

Rahix avatar Rahix commented on July 17, 2024

In the documentation, there is a step that say source /path/to/tbot/completions.sh to ~.bashrc.
This is how I did it. In the terminal, I used the source /mypathToTbot/completions.sh. However when I open the ~.bashrc, this is not reflected.

You have to add the source command as a line in your ~/.bashrc file:

source /mypathToTbot/completions.sh

I believe I am doing something wrong here since my self test is failing

Can you please post the entire output tbot gives you?

When I execute other .py files, i get the same error KeyError: 'hello_world'. I believe that tbot is not able to find the function definition of hello_world in a .py file. How do I fix this ?

What exact command were you running? What was the name of the python file?

from tbot.

srnae05 avatar srnae05 commented on July 17, 2024
source /mypathToTbot/completions.sh

After adding this, the self test passes. Thanks !

What exact command were you running? What was the name of the python file?

I created a file tc.py with hello_world function in my home folder. When I execute using tbot hello_world, it fails. Here is the output
`(base) root@srnae05:/home/srnae05/ACC/testCases# tbot hello_world
Warning: Failed to load /home/srnae05/ACC/testCases/tc.py:
Traceback (most recent call last):
File "/root/.local/lib/python3.7/site-packages/tbot-0.8.0-py3.7.egg/tbot/loader.py", line 160, in collect_testcases
module = load_module(f)
File "/root/.local/lib/python3.7/site-packages/tbot-0.8.0-py3.7.egg/tbot/loader.py", line 136, in load_module
module_spec.loader.exec_module(module)
File "", line 724, in exec_module
File "", line 860, in get_code
File "", line 791, in source_to_code
File "", line 219, in _call_with_frames_removed
File "/home/srnae05/ACC/testCases/tc.py", line 4
def hello_world()
^
SyntaxError: invalid syntax

tbot starting ...
├─Exception:
│ Traceback (most recent call last):
│ File "/root/.local/lib/python3.7/site-packages/tbot-0.8.0-py3.7.egg/tbot/main.py", line 295, in main
│ func = testcases[tc]
│ KeyError: 'hello_world'
├─────────────────────────────────────────
└─FAILURE (0.220s)`

from tbot.

Rahix avatar Rahix commented on July 17, 2024

The command-output already points to the issue. tbot complains that it can't load your testcase file:

Warning: Failed to load /home/srnae05/ACC/testCases/tc.py:

Below that you can see the traceback of the failure, which ends with an error message:

File "/home/srnae05/ACC/testCases/tc.py", line 4
   def hello_world()
   ^
   SyntaxError: invalid syntax

You'll have to figure out what you did wrong, but from the output I suspect you forgot the : after the function definition ;)

from tbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.