ip2location / ip2proxy-r

R package for IP2Proxy database lookup. It can be used to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits.
Other
2 stars 0 forks source link

ModuleNotFoundError: No module named 'IP2Proxy' #1

Open ElCep opened 1 year ago

ElCep commented 1 year ago

I can't load something in py from R

ip2proxy::open("IP2LOCATION-LITE-DB3.BIN/IP2LOCATION-LITE-DB3.BIN")
Erreur dans py_run_string_impl(code, local, convert) : 
  ModuleNotFoundError: No module named 'IP2Proxy'
Run `reticulate::py_last_error()` for details.
> reticulate::py_last_error()

── Python Exception Message ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/delaye/R/x86_64-redhat-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
    return _run_hook(name, _hook)
  File "/home/delaye/R/x86_64-redhat-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 93, in _run_hook
    module = hook()
  File "/home/delaye/R/x86_64-redhat-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 117, in _hook
    return _find_and_load(name, import_)
ModuleNotFoundError: No module named 'IP2Proxy'

── R Traceback ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    ▆
 1. └─ip2proxy::open("IP2LOCATION-LITE-DB3.BIN/IP2LOCATION-LITE-DB3.BIN")
 2.   └─reticulate::py_run_string("import IP2Proxy")
 3.     └─reticulate:::py_run_string_impl(code, local, convert)

I have installed successfully IP2Proxy from pip

ip2location commented 1 year ago

Hi ElCep,

  1. Can you please run the pip list in your terminal to make sure that IP2Proxy has been installed correctly? You should see IP2Proxy listed in the package list generated like this:
    IP2Proxy                      3.4.0
  2. Can you please provide the R & Python version that you are using on?
ElCep commented 1 year ago

Hi Voilà :-)

Package                  Version
------------------------ ----------
appdirs                  1.4.4
argcomplete              2.0.0
Authlib                  1.2.1
Babel                    2.11.0
bcrypt                   3.2.2
Beaker                   1.12.1
beautifulsoup4           4.12.2
blivet                   3.7.1
blivet-gui               2.4.1
bodhi-client             7.2.0
boto3                    1.26.111
botocore                 1.29.111
breezy                   3.2.2
Brlapi                   0.8.4
Brotli                   1.0.9
cachetools               5.3.0
CCColUtils               1.5
certifi                  2022.9.24
cffi                     1.15.1
chardet                  5.1.0
charset-normalizer       3.1.0
click                    8.1.3
configobj                5.0.8
construct                2.10.68
contourpy                1.0.7
cryptography             37.0.2
cssselect                1.1.0
cupshelpers              1.0
cycler                   0.11.0
dasbus                   1.7
dbus-python              1.3.2
decorator                5.1.1
deprecation              2.1.0
devscripts               2.23.0
distro                   1.8.0
dropbox                  11.36.2
dulwich                  0.21.2
duplicity                1.2.3
fastbencode              0.0.9
fasteners                0.18
fedora-third-party       0.10
fedpkg                   1.44
file-magic               0.4.0
fonttools                4.39.3
fros                     1.1
fs                       2.4.16
future                   0.18.3
GDAL                     3.6.4
gitdb                    4.0.9
GitPython                3.1.30
google-api-core          2.11.0
google-api-python-client 2.93.0
google-auth              2.21.0
google-auth-httplib2     0.1.0
googleapis-common-protos 1.59.0
gpg                      1.17.1
grpcio                   1.48.4
grpcio-status            1.48.4
gssapi                   1.7.3
httplib2                 0.20.4
humanize                 3.13.1
idna                     3.4
img2pdf                  0.4.4
importlib-metadata       6.0.0
IP2Location              8.10.0
IP2Proxy                 3.4.0
jaraco.classes           3.2.3
jeepney                  0.8.0
Jinja2                   3.0.3
jmespath                 1.0.1
kerberos                 1.3.0
keyring                  23.11.0
kitchen                  1.2.6
kiwisolver               1.4.4
koji                     1.33.0
langtable                0.0.62
launchpadlib             1.10.18
lazr.restfulclient       0.14.5
lazr.uri                 1.0.6
libcomps                 0.1.18
lockfile                 0.12.2
lxml                     4.9.2
Mako                     1.2.3
Markdown                 3.4.1
MarkupSafe               2.1.2
matplotlib               3.7.2
more-itertools           8.13.0
munch                    2.5.0
munkres                  1.1.2
nftables                 0.1
numpy                    1.24.3
oauth2client             4.1.3
oauthlib                 3.2.1
olefile                  0.46
openidc-client           0.7.0
OWSLib                   0.28.1
packaging                23.0
paramiko                 3.1.0
Paste                    3.5.2
patiencediff             0.2.12
pdfarranger              1.10.0
pexpect                  4.8.0
pid                      2.2.3
pikepdf                  7.2.0
Pillow                   9.4.0
pip                      22.3.1
ply                      3.11
productmd                1.35
progressbar2             3.53.2
protobuf                 3.19.6
psycopg2                 2.9.6
ptyprocess               0.7.0
pwquality                1.4.5
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pybeam                   0.7
pycairo                  1.23.0
pycparser                2.20
pycrypto                 2.6.1
pycups                   2.0.1
pycurl                   7.45.2
PyDrive2                 1.16.0
pyenchant                3.2.2
pygit2                   1.12.2
Pygments                 2.14.0
PyGObject                3.44.1
pykickstart              3.47
PyNaCl                   1.5.0
pyOpenSSL                21.0.0
pyparsing                3.0.9
pyparted                 3.12.0
PyQt5                    5.15.9
PyQt5-sip                12.11.1
pyroute2                 0.7.3
PySocks                  1.7.1
python-augeas            1.1.0
python-bugzilla          3.2.0
python-dateutil          2.8.2
python-fedora            1.1.1
python-meh               0.51
python-utils             3.3.3
python-yubico            1.3.3
pytz                     2023.3
pyudev                   0.24.0
pyusb                    1.2.1
pyxdg                    0.27
PyYAML                   6.0
QScintilla               2.13.4
regex                    2022.10.31
requests                 2.28.2
requests-file            1.5.1
requests-ftp             0.3.1
requests-gssapi          1.2.3
requests-kerberos        0.12.0
rpkg                     1.66
rpm                      4.18.1
rpmautospec              0.3.5
rpmlint                  2.4.0
rsa                      4.8
s3transfer               0.6.1
SciPy                    1.10.1
scour                    0.38.2
SecretStorage            3.3.3
selinux                  3.5
sepolicy                 3.5
setools                  4.4.2
setuptools               65.5.1
simpleaudio              1.0.4
simpleline               1.9.0
six                      1.16.0
smmap                    5.0.0
sos                      4.5.1
soupsieve                2.4.1
stone                    3.2.1
systemd-python           235
Tempita                  0.5.2
templated-dictionary     1.2
tomli_w                  1.0.0
uritemplate              4.1.1
urllib3                  1.26.16
wadllib                  1.3.6
wxPython                 4.2.0
zipp                     3.12.0
zstandard                0.21.0

with R version 4.3.1 (2023-06-16) and python --version Python 3.11.4

ip2location commented 1 year ago

Hi ElCep,

Can you try these steps before using our library? We have applied these steps and didn't encounter this error.

  1. Called the reticulate library by library(reticulate).
  2. Run this command use_python("path_to_your_python3.11.4") to manual select the Python 3.11.4. Note that the command must be re-run in each new R session as appropriate.

You can also use this reticulate function py_discover_config() to identify which Python version that your R is using on. Use this function to make sure that your R is using the correct Python version.

micha3056 commented 5 months ago

i got the same issue here, too. Got Python version 3.11.2 and tried it on windows and on Linux... Do i need to downgrade my python version?

ip2location commented 5 months ago

Hi @micha3056,

Can we check have you followed the steps above?