meeshkan / hmt

HTTP Mocking Toolkit
MIT License
52 stars 7 forks source link

hmt not working on Windows with Python 3.8 #214

Open shortbloke opened 4 years ago

shortbloke commented 4 years ago

Description

Trying to run the tutorial and it fails when attempting to make the web requests. Also fails if attempting to start record hmt record

Might be related to this issue: https://github.com/tornadoweb/tornado/issues/2608

Steps to Reproduce

Environment:

Repro steps:

  1. Install hmt: pip install hmt
  2. run tutorial: hmt tutorial
  3. Press Enter at start of tutorial
  4. Press Enter to continue after checking __hmt__ exists
  5. Press Enter after checking contents of api_calls.py to launch the script

Expected Result

Tutorial to make API calls and continue to the next step

Actual Result

Traceback:

After you've checked out `__hmt__/api_calls.py`, press ENTER
to launch the proxy and execute the script!
Starting proxy◒proxy
←[?25hTraceback (most recent call last):
  File "C:\Users\mrowan\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\mrowan\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\mrowan\hmt-test\Scripts\hmt.exe\__main__.py", line 7, in <module>
  File "c:\users\mrowan\hmt-test\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\mrowan\hmt-test\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\mrowan\hmt-test\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\mrowan\hmt-test\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\mrowan\hmt-test\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\__main__.py", line 163, in tutorial
    run_tutorial()
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\tutorial\__init__.py", line 479, in run_tutorial
    loop.run_until_complete(CLI(loop).run())
  File "C:\Users\mrowan\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\tutorial\__init__.py", line 209, in run
    await self._server_starting("Starting proxy", p)
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\tutorial\__init__.py", line 468, in _server_starting
    raise Exception(
Exception: Unable to start Meeshkan. Please, check logs at ~/.hmt/logs for details.

Additional Context

Error logged:

2020-08-20 14:46:55,222 - hmt.serve.record.proxy - INFO - Starting Meeshkan record on http://localhost:8000
2020-08-20 14:46:55,222 - hmt.serve.record.proxy - INFO - Spec generation mode is disabled
2020-08-20 14:46:55,236 - hmt.serve.commands - ERROR - 
Traceback (most recent call last):
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\serve\commands.py", line 29, in wrapper
    return func(*args, **kwargs)
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\serve\commands.py", line 195, in start_record
    proxy_runner.run()
  File "c:\users\mrowan\hmt-test\lib\site-packages\hmt\serve\record\proxy.py", line 76, in run
    server.listen(self._port)
  File "c:\users\mrowan\hmt-test\lib\site-packages\tornado\tcpserver.py", line 144, in listen
    self.add_sockets(sockets)
  File "c:\users\mrowan\hmt-test\lib\site-packages\tornado\tcpserver.py", line 157, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "c:\users\mrowan\hmt-test\lib\site-packages\tornado\netutil.py", line 268, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "c:\users\mrowan\hmt-test\lib\site-packages\tornado\platform\asyncio.py", line 79, in add_handler
    self.asyncio_loop.add_reader(
  File "C:\Users\mrowan\AppData\Local\Programs\Python\Python38\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

Modules installed:

(hmt-test) C:\Users\mrowan>pip list
Package             Version
------------------- ---------
aiohttp             3.6.2
aiohttp-cors        0.7.0
args                0.1.0
async-timeout       3.0.1
attrs               19.3.0
certifi             2020.6.20
chardet             3.0.4
Click               7.0
clint               0.5.1
colorama            0.4.3
colorclass          2.2.0
colorlog            4.2.1
croniter            0.3.34
decorator           4.4.2
Faker               4.1.2
faust               1.10.4
genson              1.2.2
hmt                 0.3.2
http-types          0.0.17
idna                2.10
jsonpath-rw         1.4.0
jsonschema          3.2.0
kafka-python        1.4.7
lenses              1.0.0
meeshkan-daemonocle 1.0.3
mode                4.3.2
multidict           4.7.6
mypy-extensions     0.4.3
natsort             7.0.1
openapi-typed-2     0.0.5
opentracing         1.3.0
pip                 20.1.1
ply                 3.11
progress            1.5
psutil              5.7.2
pyfiglet            0.8.post1
pyrsistent          0.16.0
python-dateutil     2.8.1
PyYAML              5.3.1
requests            2.24.0
robinhood-aiokafka  1.1.6
setuptools          47.1.0
singledispatch      3.4.0.3
six                 1.15.0
terminaltables      3.1.0
text-unidecode      1.3
tornado             5.1.1
typeguard           2.9.1
typing              3.7.4.3
typing-extensions   3.7.4.2
urllib3             1.25.6
venusian            1.2.0
yarl                1.5.1
guptakmanish29 commented 4 years ago

i am also irretate, some modules just dont work like pyinputplus, pyautogui, ERROR is modules not found, i installed them using pip command in win 10, pandas & numpy work perfectly. i am new to python, any help out there?