serverstf / python-valve

A Python Interface to various Valve products and services
Other
236 stars 71 forks source link

always getting No module named rcon #54

Closed rkopplin closed 6 years ago

rkopplin commented 6 years ago

hello,

nothing seems to work here, tried python2 or python3 by changing environment variable. always getting

Traceback (most recent call last): File "./bla.py", line 2, in from valve.source.rcon import RCON ImportError: No module named rcon

any ideas?

Holiverh commented 6 years ago

It's just import valve.rcon. Were you following an example/documentation? If yes, which one/part?

rkopplin commented 6 years ago

yes tried the example code

from valve.source.rcon import RCON

SERVER_ADDRESS = ("...", 27015) PASSWORD = "top_secret"

with RCON(SERVER_ADDRESS, PASSWORD) as rcon: print(rcon("echo Hello, world!"))

still the error:

import valve.RCON ImportError: No module named RCON

Holiverh commented 6 years ago

The RCON example in the README has been fixed as of https://github.com/serverstf/python-valve/commit/b5a543f13417bce4015b0f6f6967b6d47cfd5fc2.