vicenteneto / python-cartolafc

Uma interface em Python para a API Rest do Cartola FC
MIT License
67 stars 25 forks source link

Error 10061: Redis - erro de conexão no exemplo #68

Closed lpdx closed 4 years ago

lpdx commented 4 years ago

Criei um ambiente virtual no windows 10 com o conda 4.8.2 para o Python 3.7.8 e instalei a API 2.0.0 via pip install. Ao executar o exemplo, o erro abaixo é retornado:

Adicionalmente, meu endereço de login no Cartola contém um alias do gmail, isto é, contém um "+".

(cartolaapi) C:\Users\Downloads\python-cartolafc-master\python-cartolafc-master\examples>python examples.py Traceback (most recent call last): File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\connection.py", line 559, in connect sock = self._connect() File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\connection.py", line 615, in _connect raise err File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\connection.py", line 603, in _connect sock.connect(socket_address) ConnectionRefusedError: [WinError 10061] Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente

During handling of the above exception, another exception occurred:

Tr aceback (most recent call last): File "C:\Users.conda\envs\cartolaapi\lib\site-packages\cartolafc\api.py", line 128, in set_redis self._redis.ping() File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\client.py", line 1378, in ping return self.execute_command('PING') File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\client.py", line 898, in execute_command conn = self.connection or pool.get_connection(command_name, **options) File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\connection.py", line 1192, in get_connection connection.connect() File "C:\Users.conda\envs\cartolaapi\lib\site-packages\redis\connection.py", line 563, in connect raise ConnectionError(self._error_message(e)) redis.exceptions.ConnectionError: Error 10061 connecting to localhost:6379. Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "examples.py", line 3, in api = cartolafc.Api(email='a+b@gmail.com', password='*****', attempts=5, redis_url='redis://localhost:6379/0') File "C:\Users.conda\envs\cartolaapi\lib\site-packages\cartolafc\api.py", line 84, in init self.set_redis(redis_url, redis_timeout) File "C:\Users.conda\envs\cartolaapi\lib\site-packages\cartolafc\api.py", line 130, in set_redis raise CartolaFCError('Erro conectando ao servidor Redis.') cartolafc.errors.CartolaFCError: Erro conectando ao servidor Redis.

lpdx commented 4 years ago

Olhando os comentários do script vi que não é obrigatório o servidor Redis.