Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError : 'NoneType' object is not callable #27

Open
Darth-Carrotpie opened this issue Jun 29, 2022 · 3 comments
Open

TypeError : 'NoneType' object is not callable #27

Darth-Carrotpie opened this issue Jun 29, 2022 · 3 comments

Comments

@Darth-Carrotpie
Copy link

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?

@jundymek
Copy link
Owner

@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?

@Darth-Carrotpie
Copy link
Author

@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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants