Re: [web2py] Why am I getting "unable to import requests" in web2py even though requests is accessible directly through python

2023-05-27 Thread vald...@gmail.com
I'm using pipenv to run the virtual environment. So I install pyenv first and then python 3.7 with it and set it to the default. Then I install pipenv so that it uses the python 3.7 as its default. Then I activate the virtual environment with *pipenv shell* and then run *python

Re: [web2py] Why am I getting "unable to import requests" in web2py even though requests is accessible directly through python

2023-05-27 Thread Massimiliano
Yes it's a virtualenv also mine. How do you start web2py and how do you set your virtual env for web2py? pyenv local yourenv or what? Another thing. web2py.py has #!/usr/bin/env python shebang so it knows what python to use. Have you tried to launch ./web2py.py -S instead of python web2py.py

Re: [web2py] Why am I getting "unable to import requests" in web2py even though requests is accessible directly through python

2023-05-27 Thread Tom Clerckx
With pyenv itself it goes OK, it's only when using a pyenv-virtualenv that things fail. I tried on two different machines. Newly created pyenv (3.10.6) Newly created virtualenv Newly unzipped web2py directory (2.24.1) Same result. When launching the web2py-shell in the virtualenv, the import

Re: [web2py] Why am I getting "unable to import requests" in web2py even though requests is accessible directly through python

2023-05-27 Thread Massimiliano
I'm also using pyenv and having the same paths order, ma importing requests is working with no problem, on macos and on linux. Have you already tried to get rid of all pyc files and or to uninstall and reinstall requests? Il giorno sab 27 mag 2023 alle ore 14:20 Tom Clerckx ha scritto: > See

Re: [web2py] Why am I getting "unable to import requests" in web2py even though requests is accessible directly through python

2023-05-27 Thread Tom Clerckx
See below. In both tests the requests library is in the last element of the path. TEST1, plain python shell - import OK (test) tclerckx@stark:~/temp/test$ python Python 3.10.6 (main, Jan 14 2023, 23:48:13) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more

Re: [web2py] Why am I getting "unable to import requests" in web2py even though requests is accessible directly through python

2023-05-27 Thread Massimiliano
Maybe one thing you can do is to launch web2py shell and check paths. ./web2py.py -S import sys print(sys.path) Il giorno ven 26 mag 2023 alle ore 16:02 vald...@gmail.com < valde...@gmail.com> ha scritto: > > > Asked this one on SO here >