juancarlospaco / faster-than-requests

Faster requests on Python 3
https://gist.github.com/juancarlospaco/37da34ed13a609663f55f4466c4dbc3e
MIT License
1.11k stars 90 forks source link

[bug] Nim documentation missing from README.md #218

Closed CalderWhite closed 1 year ago

CalderWhite commented 1 year ago

Architecture

x86_64 (Default)

Operating System

Linux

Disk

SSD (Solid)

Memory

4 Gigabytes

CPU Cores

4 CPU Cores

Internet Connection

Optical Fiber (very fast)

What is your web browser?

Others (Unkown)

Device

Server PC

Where are you from?

Canada

What happened?

My OS details are:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.10
Release:    22.10
Codename:   kinetic

Kernel:

uname -a
Linux localhost 5.19.0-42-generic #43-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 18:21:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

First:

>>> import faster_than_requests as requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/faster_than_requests/__init__.py", line 7, in <module>
    from . faster_than_requests import *
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 945, in _find_spec
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 1269, in find_spec
    return Nimporter.import_nim_code(fullname, path, library=False)
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 944, in import_nim_code
    NimCompiler.compile_nim_code(
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 703, in compile_nim_code
    output, errors, warnings, hints = cls.invoke_compiler(nim_args)
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 269, in invoke_compiler
    process = subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nim'
>>>

Then

Python 3.10.7 (main, Mar 10 2023, 10:47:39) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faster_than_requests as requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/faster_than_requests/__init__.py", line 7, in <module>
    from . faster_than_requests import *
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 945, in _find_spec
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 1269, in find_spec
    return Nimporter.import_nim_code(fullname, path, library=False)
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 944, in import_nim_code
    NimCompiler.compile_nim_code(
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 705, in compile_nim_code
    cls.check_compile_errors(errors, library, nim_args, output, tmp_cwd, warnings)
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 492, in check_compile_errors
    raise NimCompileException(errors[0])
nimporter.NimCompileException: std/asyncmacro(42, 5) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]

Until finally fixed by switching the nim verison to 1.4.0 with choosenim via:

choosenim 1.4.0

Simply installing the latest stable release of nim did NOT work.

I think the README.md should mention

  1. The required installation of nim
  2. That only specific versions of nim are supported

Perhaps just listing the correct command to install nim will suffice.

Standard Output Logs

Python 3.10.7 (main, Mar 10 2023, 10:47:39) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faster_than_requests as requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/faster_than_requests/__init__.py", line 7, in <module>
    from . faster_than_requests import *
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 945, in _find_spec
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 1269, in find_spec
    return Nimporter.import_nim_code(fullname, path, library=False)
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 944, in import_nim_code
    NimCompiler.compile_nim_code(
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 705, in compile_nim_code
    cls.check_compile_errors(errors, library, nim_args, output, tmp_cwd, warnings)
  File "/usr/local/lib/python3.10/dist-packages/nimporter.py", line 492, in check_compile_errors
    raise NimCompileException(errors[0])
nimporter.NimCompileException: std/asyncmacro(42, 5) Warning: The bare except clause is deprecated; use `except CatchableError:` instead [BareExcept]
github-actions[bot] commented 1 year ago

Welcome CalderWhite

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

BTC Bitcoin Network

1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi

Lightning Network

juancarlospaco@bitrefill.me

Ethereum ETH Dai DAI Uniswap UNI Axie Infinity AXS Smooth Love Potion SLP **BEP20 Binance Smart Chain Network BSC** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ``` **ERC20 Ethereum Network** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ```
Tether USDT **BEP20 Binance Smart Chain Network BSC** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ``` **ERC20 Ethereum Network** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ``` **TRC20 Tron Network** ``` TWGft53WgWvH2mnqR8ZUXq1GD8M4gZ4Yfu ```
Solana SOL **BEP20 Binance Smart Chain Network BSC** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ``` **SOL Solana Network** ``` FKaPSd8kTUpH7Q76d77toy1jjPGpZSxR4xbhQHyCMSGq ```
Cardano ADA **BEP20 Binance Smart Chain Network BSC** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ``` **ADA Cardano Network** ``` DdzFFzCqrht9Y1r4Yx7ouqG9yJNWeXFt69xavLdaeXdu4cQi2yXgNWagzh52o9k9YRh3ussHnBnDrg7v7W2hSXWXfBhbo2ooUKRFMieM ```
Sandbox SAND Decentraland MANA **ERC20 Ethereum Network** ``` 0xb78c4cf63274bb22f83481986157d234105ac17e ```
Algorand ALGO **ALGO Algorand Network** ``` WM54DHVZQIQDVTHMPOH6FEZ4U2AU3OBPGAFTHSCYWMFE7ETKCUUOYAW24Q ```
Binance [https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3](https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3 "Send via Binance Pay")
CalderWhite commented 1 year ago

Update:

Just ran this demo from the README.md and got a segfault:

Python 3.10.7 (main, Mar 10 2023, 10:47:39) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import faster_than_requests as requests
>>> requests.get2str2(["http://example.com/foo", "http://example.com/bar"]) # Parallel GET
Segmentation fault (core dumped)
DeviJv commented 1 year ago

i had to this issue

github-actions[bot] commented 1 year ago

This issue is Stale because it has been open for 100 days with no activity. Contribute a fix or comment on the issue, or it will be closed in a few days.

github-actions[bot] commented 1 year ago

This issue has been marked as Stale and closed due to inactivity after 100 days.