architv / soccer-cli

:soccer: Football scores for hackers. :computer: A command line interface for all the football scores.
MIT License
1.09k stars 221 forks source link

No module named main #1

Closed mehdibaha closed 5 years ago

mehdibaha commented 9 years ago

After successfully installing soccer-cli, this is the traceback error I'm getting when trying to use it

Traceback (most recent call last):
  File "C:\x\x\Anaconda\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\x\x\Anaconda\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\x\x\Anaconda\Scripts\soccer.exe\__main__.py", line 5, in <module>
ImportError: No module named main

Thanks !

architv commented 9 years ago

Seems like you are using windows. I didn't test it out on that. Let me test it out on windows I will let you know.

Heart1010 commented 9 years ago

I append this issue ticket here with another one I get on win10 powershell.

PS C:\Users\Hermann> soccer --standings --league=BL
POS     CLUB                              PLAYED        GOAL DIFF     POINTS
Traceback (most recent call last):
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\Scripts\soccer-script.py", line 9, in <module>
    load_entry_point('soccer-cli==0.0.2.4', 'console_scripts', 'soccer')()
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\lib\site-packages\click\core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\lib\site-packages\click\core.py", line 680, in main
    rv = self.invoke(ctx)
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\lib\site-packages\click\core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\Scripts\main.py", line 179, in main
    get_standings(league)
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\Scripts\main.py", line 92, in get_standings
    print_standings(req.json())
  File "C:\Users\Hermann\AppData\Local\Programs\Python\Python35\Scripts\main.py", line 108, in print_standings
    goaldiff=str(team["goalDifference"]), points=str(team["points"])
TypeError: non-empty format string passed to object.__format__

Every other command is working perfect, only --standings lead to this error message.

architv commented 9 years ago

Hi @Heart1010 ! Unfortunately, I don't have a windows machine and I am not able to reproduce this error on my linux. It would be nice if someone in the community could help me with this.

thurask commented 9 years ago

Latest git, cmd on Windows 10, Python 2.7.10 (Anaconda):

[py2] C:\Users\thurask\git\soccer-cli>soccer --standings --league=BL
POS     CLUB                              PLAYED        GOAL DIFF     POINTS
1       Borussia Dortmund                 3             10            9
2       FC Bayern M├╝nchen                3             9             9
3       VfL Wolfsburg                     3             4             7
4       1. FC K├╢ln                       3             3             7
5       1. FSV Mainz 05                   3             3             6
6       Bayer Leverkusen                  3             -1            6
7       FC Ingolstadt 04                  3             -2            6
8       Eintracht Frankfurt               3             2             4
9       FC Schalke 04                     3             0             4
10      Hertha BSC                        3             -1            4
11      Werder Bremen                     3             -2            4
12      SV Darmstadt 98                   3             0             3
13      Hamburger SV                      3             -5            3
14      TSG 1899 Hoffenheim               3             -2            1
15      FC Augsburg                       3             -2            1
16      Hannover 96                       3             -4            1
17      VfB Stuttgart                     3             -6            0
18      Bor. M├╢nchengladbach             3             -6            0

The same, but with Python 3.4.3:

C:\Users\thurask\git\soccer-cli>soccer --standings --league=BL
POS     CLUB                              PLAYED        GOAL DIFF     POINTS
Traceback (most recent call last):
  File "C:\Users\thurask\Anaconda3\Scripts\soccer-script.py", line 9, in <module>
    load_entry_point('soccer-cli==0.0.3.1', 'console_scripts', 'soccer')()
  File "C:\Users\thurask\Anaconda3\lib\site-packages\click-5.0-py3.4.egg\click\core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\thurask\Anaconda3\lib\site-packages\click-5.0-py3.4.egg\click\core.py", line 680, in main
    rv = self.invoke(ctx)
  File "C:\Users\thurask\Anaconda3\lib\site-packages\click-5.0-py3.4.egg\click\core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\thurask\Anaconda3\lib\site-packages\click-5.0-py3.4.egg\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\thurask\Anaconda3\lib\site-packages\soccer_cli-0.0.3.1-py3.4.egg\EGG-INFO\scripts\main.py", line 190, in main
  File "C:\Users\thurask\Anaconda3\lib\site-packages\soccer_cli-0.0.3.1-py3.4.egg\EGG-INFO\scripts\main.py", line 97, in get_standings
  File "C:\Users\thurask\Anaconda3\lib\site-packages\soccer_cli-0.0.3.1-py3.4.egg\EGG-INFO\scripts\main.py", line 113, in print_standings
TypeError: non-empty format string passed to object.__format__
architv commented 9 years ago

Thanks @thurask for clearing it out. @Heart1010 the package isn't python3.x compatible, you'll need to use it with python2.x. Let me know if that resolves the issue.

Heart1010 commented 9 years ago

http://stackoverflow.com/questions/29613676/python-typeerror-non-empty-format-string-passed-to-object-format

2015-09-02 21:49 GMT+02:00 Archit Verma notifications@github.com:

Thanks @thurask https://github.com/thurask for clearing it out. @Heart1010 https://github.com/Heart1010 the package isn't python3.x compatible, you'll need to use it with python2.x. Let me know if that resolves the issue.

— Reply to this email directly or view it on GitHub https://github.com/architv/soccer-cli/issues/1#issuecomment-137224991.

narensrini commented 9 years ago

@Heart1010 if you change team=u''.join(team["teamName"]).encode('utf-8') to just team["teamName"], in the print_standings function in main.py, it should work fine in python3.

freddiev4 commented 9 years ago

I'm having the same issue but in Python 2.7

Heart1010 commented 9 years ago

@nare469 Thanks!

cirrusUK commented 8 years ago

Hi, Thanks for this, i hope we get it working soon, i have similar issue, im using Archlinux and on launch i get ..

cirrus  blade  soccer-cli  soccer --standings --league=EPL Traceback (most recent call last): File "/usr/bin/soccer", line 9, in load_entry_point('soccer-cli==0.0.5.0', 'console_scripts', 'soccer')() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 568, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2720, in load_entry_point return ep.load() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2380, in load return self.resolve() File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 2386, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "build/bdist.linux-x86_64/egg/soccer/main.py", line 21, in ImportError: No module named config cirrus  blade  soccer-cli  regards (sorry my programming skills are limited to 5 line shell scripts)

cirrusUK commented 8 years ago

heh i fixed my error by simply sourcing my ~/.zshrc where i point to the API key, after sourcing it works great, i LOVE it, thanks brogrammer. heres a handy function

List Realtime Soccer Results | Usage: score

score() { watch -n10 --no-title "w3m http://www.livescore.com/ |awk '/live [0-9H]+[^ ]/,/red cards/'" ; }