juancarlospaco / faster-than-requests

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

Import error #72

Closed lordcreations closed 4 years ago

lordcreations commented 4 years ago

When im tryin to import the module i get this error "ImportError: DLL load failed while importing faster_than_requests: %1 is not a valid Win32 application"

image

juancarlospaco commented 4 years ago

Try the new version 0.9.9 I just uploaded a minutes ago.

lordcreations commented 4 years ago

Try the new version 0.9.9 I just uploaded a minutes ago.

im using it

juancarlospaco commented 4 years ago
lordcreations commented 4 years ago

I realized i was using python3.8 32 bits, i installed the 64version and intalled module from pypi.org, now i get "ModuleNotFoundError: No module named 'faster_than_requests'" i compiled the source and put as the same folder as my project, now im getting "ImportError: DLL load failed while importing faster_than_requests: The specified module could not be found"

juancarlospaco commented 4 years ago
lordcreations commented 4 years ago

Yes, pip install nimporter works. installed module with pip install faster-than-requests image and when i try to import the module i get ModuleNotFoundError, Then i compiled with nimble install nimpy and nim c -d:ssl -d:danger --app:lib --out:faster_than_requests.pyd faster_than_requests.nim image

juancarlospaco commented 4 years ago

To test make a .py file with only:

import nimporter
import faster_than_requests

Put it on an empty folder, with no other file in the same folder, then try to run it from terminal using python file.py and that should work.

Update your pip it says is too old.

lordcreations commented 4 years ago

image

juancarlospaco commented 4 years ago

Please paste the output of the following commands from the terminal:

pip --version
python --version
nim --version
lordcreations commented 4 years ago

image

juancarlospaco commented 4 years ago

Thats super weird, it should work, I cant think for a reason for it to not work ...maybe you can try with Docker for Windows ?.

lordcreations commented 4 years ago

i will try

juancarlospaco commented 4 years ago

Example here https://github.com/juancarlospaco/faster-than-requests/blob/master/docker/Dockerfile

Akshat-mehrotra commented 4 years ago

Same issue here, using pip 20.1.1 python 3.8 nim 1.2 on windows 64 bit

juancarlospaco commented 4 years ago

From Arch Linux I can build the file for Windows 64 Bit without any problems, I uploaded to the repo, you can download it, put it on the same folder of the .py file, then just run it or import it, just import faster_than_requests. The file can not be renamed. Windows 64Bit only. Just for you, to see if it works.

https://github.com/juancarlospaco/faster-than-requests/blob/master/dist/faster_than_requests.pyd

lordcreations commented 4 years ago

From Arch Linux I can build the file for Windows 64 Bit without any problems, I uploaded to the repo, you can download it, put it on the same folder of the .py file, then just run it or import it, just import faster_than_requests. The file can not be renamed. Windows 64Bit only. Just for you, to see if it works.

https://github.com/juancarlospaco/faster-than-requests/blob/master/dist/faster_than_requests.pyd

works perfectly, thanks

juancarlospaco commented 4 years ago

So then it was the Python packaging/install/distribution failing somehow.

Keep the file, you can just copy it anywhere or put it on the /python-packages/ folder.

Greg-Tarr commented 4 years ago

From Arch Linux I can build the file for Windows 64 Bit without any problems, I uploaded to the repo, you can download it, put it on the same folder of the .py file, then just run it or import it, just import faster_than_requests. The file can not be renamed. Windows 64Bit only. Just for you, to see if it works.

https://github.com/juancarlospaco/faster-than-requests/blob/master/dist/faster_than_requests.pyd

Can you please make this available again, I am experiencing the exact same problem.

juancarlospaco commented 4 years ago

https://github.com/juancarlospaco/faster-than-requests/releases/tag/1.0.0

CAPI-48 commented 2 years ago

From Arch Linux I can build the file for Windows 64 Bit without any problems, I uploaded to the repo, you can download it, put it on the same folder of the .py file, then just run it or import it, just import faster_than_requests. The file can not be renamed. Windows 64Bit only. Just for you, to see if it works.

https://github.com/juancarlospaco/faster-than-requests/blob/master/dist/faster_than_requests.pyd

I got same problem as described in this topic, tried to use your solution and this doesn't work for me....

Code libraries image

DLL libraries in folder image

image

Windows 10 latest updates (64 bit)

P.S Tried also only with .pyd file in folder ( without faster_than_requests.so ) doesn't helps.