free-proxy icon indicating copy to clipboard operation
free-proxy copied to clipboard

TypeError : 'NoneType' object is not callable

Open Darth-Carrotpie opened this issue 2 years ago • 3 comments

Are the deps alright in this library? When I try to import: from fp.fp import FreeProxy

An error is thrown: PythonException: TypeError : 'NoneType' object is not callable File "Assets/StreamingAssets/python-3.7.9/lib/site-packages/lxml/html/__init__.py", line 88, in <module> namespaces={'x':XHTML_NAMESPACE}) File "Assets/StreamingAssets/python-3.7.9/lib/site-packages/fp/fp.py", line 5, in <module> import lxml.html as lh File "search.py", line 2, in <module> from fp.fp import FreeProxy

Installed via PyPi. Any ideas what's going on?

Darth-Carrotpie avatar Jun 29 '22 18:06 Darth-Carrotpie

@Darth-Carrotpie - thanks for your feedback. Unfortunately, I can't reproduce this error. I made a new empty environment and install free-proxy from PyPi and it works fine. I tested it on python 3.9.7. Below I listed all installed libraries:

certifi==2022.6.15
charset-normalizer==2.1.0
free-proxy==1.0.6
idna==3.3
lxml==4.9.0
requests==2.28.1
urllib3==1.26.9

Has anyone else encountered this problem?

jundymek avatar Jun 29 '22 21:06 jundymek

@jundymek - Sorry, forgot to mention - due to compatibility I've got a python version limitation, mine is V3.7.9. Also I should probably mention that it's an embedded python version with no global environment vars, with intention to be able to pack it into an app.

Package versions of the same list, checked via "pip show": certifi = Version: 2022.6.15 charset-normalizer = Version: 2.0.12 free-proxy = Version: 1.0.6 idna = Version: 2.10 lxml = Version: 4.9.0 requests = Version: 2.25.1 urllib3 = Version: 1.26.9

My use case is to perform google search via proxies for a chatbot which uses Wizard of Internet dataset.

Darth-Carrotpie avatar Jun 30 '22 07:06 Darth-Carrotpie

Sorry for inconvenience, but I found the problem. I was trying to use __check_if_proxy_is_working function, which apparently is hidden. Perhaps because of weirdness in the loading of PythonEngine within my app or some other interaction it was importing first time after load, then on reload it was giving the error. I found that if I call the function through name mangling, i.e. obj = A() and then obj._A__fun(), it always works... 🤷 Anyways, now I'm still lost with the 'is_working' part, because none of the proxies pass the check... perhaps google is preventing that call?

Darth-Carrotpie avatar Jun 30 '22 11:06 Darth-Carrotpie