here is my simple code with the faster_than_requests library :
import faster_than_requests as requests
t = requests.get("http://httpbin.org/get")
print(t)
As you can see the code is not the problem but i am getting that as an error in my console :
PS C:\Users\Admin\Desktop\Projects\Outlook> & C:/Users/Admin/AppData/Local/Programs/Python/Python312/python.exe c:/Users/Admin/Desktop/Projects/Outlook/test.py
Traceback (most recent call last):
File "c:\Users\Admin\Desktop\Projects\Outlook\test.py", line 1, in <module>
import faster_than_requests as requests
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\faster_than_requests\__init__.py", line 7, in <module>
from . faster_than_requests import *
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1322, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1262, in _find_spec
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\nimporter.py", line 1273, in find_spec
return Nimporter.import_nim_code(fullname, path, library=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\nimporter.py", line 948, in import_nim_code
NimCompiler.compile_nim_code(
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\nimporter.py", line 709, in compile_nim_code
cls.check_compile_errors(errors, library, nim_args, output, tmp_cwd, warnings)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\nimporter.py", line 496, in check_compile_errors
raise NimCompileException(errors[0])
nimporter.NimCompileException: faster_than_requests.nim(2, 18) Error: cannot open file: db_sqlite
I don't know what is wrong, i am not good with nim or whatsoever..
I tried searching online for an answer but no one was talking about that issue so i came here.
This is out of reach for you. Recent (2.0.0) Nim update removed some libraries from the
stdto their own package. In this case,db_sqlitehas been moved to db_connector, butfaster_than_requestspackage in Pypi still does the old import:faster_than_requests.nim, line 2:
When it should be
The library has to be updated by his author to be compatible with Nim > 2.0, because if this code is failing, I'm sure there are some other incompatibilities that you cannot solve just by switching an import.
But you can still do it! As this is a recent thing, you can still use Nim 1.6.18, the last version before 2.0.0. With choosenim you can have multiple Nim versions in your computer (disclaimer: I never used it on Windows, only in Linux). Once
choosenimis installed in your machine, do this:choosenim 1.6.18And then try to run your python script.
Optionally, open an issue in the github repo for the
faster_than_requestspackage.Good luck!