$ python -V
Python 3.6.7 :: Anaconda, Inc.
$ git clone --recursive https://github.com/web2py/web3py
$ python web3py/start.py
Traceback (most recent call last):
File "web3py/start.py", line 8, in <module>
from gluon.main import main_wsgi_app, main
File "/Users/sugizo/Downloads/learn/web3py/gluon/__init__.py", line 2, in <module>
from gluon.url import URL
File "/Users/sugizo/Downloads/learn/web3py/gluon/url.py", line 3, in <module>
from gluon.utils import web2py_uuid, simple_hash, compare
File "/Users/sugizo/Downloads/learn/web3py/gluon/utils.py", line 201
except Exception, e:
^
SyntaxError: invalid syntax
git clone --recursive https://github.com/web2py/web2py.git
git fecth modular
git checkout modular
git checkout modularpython setup.pyTraceback (most recent call last):
File "setup.py", line 4, in <module>
from gluon.fileutils import tar, untar, read_file, write_file
File "D:\TestingWeb3py\web2py\gluon\__init__.py", line 35, in <module>
from .globals import current
File "D:\TestingWeb3py\web2py\gluon\globals.py", line 16, in <module>
from gluon._compat import pickle, StringIO, copyreg, Cookie, urlparse, PY2,iteritems, to_unicode, to_native, \
ImportError: cannot import name 'Cookie'
ThanksSP--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
$ uname
Darwin
$ python -V
Python 3.7.1
$ git clone --recursive https://github.com/web2py/web2py.git
$ cd web2py
$ git checkout modular
$ python setup.py
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from gluon.fileutils import tar, untar, read_file, write_file
File "/Users/sugizo/Downloads/learn/web2py/gluon/__init__.py", line 35, in <module>
from .globals import current
File "/Users/sugizo/Downloads/learn/web2py/gluon/globals.py", line 16, in <module>
from gluon._compat import pickle, StringIO, copyreg, Cookie, urlparse, PY2, iteritems, to_unicode, to_native, \
ImportError: cannot import name 'Cookie' from 'gluon._compat' (/Users/sugizo/Downloads/learn/web2py/gluon/_compat.py)
$ python web2py.py
Traceback (most recent call last):
File "web2py.py", line 21, in <module>
import gluon.widget
File "/Users/sugizo/Downloads/learn/web2py/gluon/__init__.py", line 35, in <module>
from .globals import current
File "/Users/sugizo/Downloads/learn/web2py/gluon/globals.py", line 16, in <module>
from gluon._compat import pickle, StringIO, copyreg, Cookie, urlparse, PY2, iteritems, to_unicode, to_native, \
ImportError: cannot import name 'Cookie' from 'gluon._compat' (/Users/sugizo/Downloads/learn/web2py/gluon/_compat.py)Guys, I think you need to include the "modular" branch of pydal too:
cd gluon/packages/dal/
git checkout modular
Greetings.
I like a LOT the idea, my initial tests seems to work ok in Python 3.6.7 on Ubuntu except the test_web ones are failing.
Tell me please, that one of the new year resolution is to have web2py in pypi :) That's something I would love to help make a reality.
This are my wishes:
1- pypi
2- The ability to:
pip install web2py
cd /home/myuser
git clone http://github.com/myuser/myapp.git
cd myapp
web2py run
And start my app. Something like this will make distributing web2py apps a lot easier (even using pip)
3- An advanced welcome app template, including
.gitignores, tests, and environment configurations for
development and production.
4- A more flexible grid:
There will be awesome if we could pass to the grid the
template for rendering forms, or rendering
buttons, cells etc... and define the logic for ordering fields
(including virtual ones)
5- A CLI for applications, maybe using @cli decorators in
controllers and maybe running them like "web2py --cli
app/controller/function --param1=value1 --param2=value2"
6- A router that balances ease of use and power, maybe something in the middle of the two we have right now (I like the Yii2 framework routes style).
7- A more friendly error tickets for views (there can be difficult to find an error in a large view file), and maybe for reading them outside web2py (right now is really difficult to read errors accessing directly to the ticket files).
8- Some kind of "Modules system" that could make a lot easier the
code reutilization.
With some guidance, I can use some hours/week and
maybe include another dev for make this kind of features a
reality. Even thougt I like the "web3py" idea, and I think
that this kind of effort should be redirected to the new
framework.
Greetings.
cd web2py/gluon/packages/dal/
git checkout modular$ python -V
Python 3.7.1
$ python ../../../setup.py
Traceback (most recent call last):
File "../../../setup.py", line 85, in <module>
start()
File "../../../setup.py", line 32, in start
version=read_file("VERSION").split()[1],
File "/Users/sugizo/Downloads/learn/web2py/gluon/fileutils.py", line 112, in read_file
f = open_file(filename, mode)
File "/Users/sugizo/Downloads/learn/web2py/gluon/fileutils.py", line 104, in open_file
f = open(filename, mode, encoding="utf8")
FileNotFoundError: [Errno 2] No such file or directory: 'VERSION'
$ python ../../../web2py.py
$ open http://localhost:8000$ open http://localhost:8000/admin/default/site$ python -V
Python 2.7.15 :: Anaconda, Inc.
$ python ../../../setup.py
/Users/sugizo/miniconda3/envs/python2_prod/lib/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
""")
Traceback (most recent call last):
File "../../../setup.py", line 85, in <module>
start()
File "../../../setup.py", line 32, in start
version=read_file("VERSION").split()[1],
File "/Users/sugizo/Downloads/learn/web2py/gluon/fileutils.py", line 112, in read_file
f = open_file(filename, mode)
File "/Users/sugizo/Downloads/learn/web2py/gluon/fileutils.py", line 102, in open_file
f = open(filename, mode)
IOError: [Errno 2] No such file or directory: 'VERSION'
$ python ../../../web2py.py
$ open http://localhost:8000/admin/default/site
$ open http://localhost:8000
Traceback (most recent call last):
File "/Users/sugizo/Downloads/learn/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/Users/sugizo/Downloads/learn/web2py/applications/welcome/models/db.py", line 95, in <module>
auth.define_tables(username=False, signature=False)
File "/Users/sugizo/Downloads/learn/web2py/gluon/tools.py", line 2091, in define_tables
super(Auth, self).define_tables(username, signature, migrate, fake_migrate)._table_signature_list
File "/Users/sugizo/Downloads/learn/web2py/gluon/authapi.py", line 350, in define_tables
format='%(first_name)s %(last_name)s (%(id)s)'))
File "/Users/sugizo/Downloads/learn/web2py/gluon/packages/dal/pydal/base.py", line 590, in define_table
table = self.lazy_define_table(tablename, *fields, **kwargs)
File "/Users/sugizo/Downloads/learn/web2py/gluon/packages/dal/pydal/base.py", line 624, in lazy_define_table
polymodel=polymodel)
File "/Users/sugizo/Downloads/learn/web2py/gluon/packages/dal/pydal/adapters/base.py", line 798, in create_table
return self.migrator.create_table(*args, **kwargs)
File "/Users/sugizo/Downloads/learn/web2py/gluon/packages/dal/pydal/migrator.py", line 296, in create_table
sql_fields_old = pickle.load(tfile)
File "/Users/sugizo/miniconda3/envs/python2_prod/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/Users/sugizo/miniconda3/envs/python2_prod/lib/python2.7/pickle.py", line 864, in load
dispatch[key](self)
File "/Users/sugizo/miniconda3/envs/python2_prod/lib/python2.7/pickle.py", line 892, in load_proto
raise ValueError, "unsupported pickle protocol: %d" % proto
ValueError: unsupported pickle protocol: 3Hi, this is working for me:
git clone --recursive https://github.com/web2py/web2py.git
git checkout modular
cd web2py/gluon/packages/dal/
git checkout modular
cd ../../../
Greetings.
cd web2py
git checkout modular
cd gluon/packages/dal/
git checkout modular
cd ../../../
python setup.py
python web2py.pyRobodia@DESKTOP-E4IOU2U MINGW64 /d/TestingWeb3py/web2py/gluon/packages/dal (modular)
$ python ../../../setup.pyTraceback (most recent call last):
File "../../../setup.py", line 4, in <module>
from gluon.fileutils import tar, untar, read_file, write_file
File "D:\TestingWeb3py\web2py\gluon\__init__.py", line 35, in <module>from .globals import currentFile "D:\TestingWeb3py\web2py\gluon\globals.py", line 16, in <module>from gluon._compat import pickle, StringIO, copyreg, Cookie, urlparse, PY2,iteritems, to_unicode, to_native, \
ImportError: cannot import name 'Cookie'
--
Hi, most of the compatibility imports where moved from gluon to pydal compat module, so, if web2py does not find the 'Cookie' module, is because it either is not imported in gluon or pydal, so, I think that you are not using the modular branch of pydal. Start the steps again as @sitfan post in his last message.
Greetings.
docker pull ubuntu
docker run -it ubuntu /bin/bashdocker pull debian
docker run -it debian /bin/bashapt update
apt install -y git python-setuptools python3-setuptools
git clone --recursive https://github.com/web2py/web2py.git
cd web2py
git checkout modular
cd gluon/packages/dal/
git checkout modular
cd ../../../
python setup.py
python3 setup.py
python web2py.py
python3 web2py.py --
docker pull ubuntu
docker run -it ubuntu /bin/bashapt update
apt install -y curl bzip2 git
curl -L -O -C - https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda*.sh
source ~/.bashrc
conda create -y -n python3 python=3.6.6
source activate python3
git clone --recursive https://github.com/web2py/web2py.git
cd web2py
git checkout modular
cd gluon/packages/dal/
git checkout modular
cd ../../../
python setup.py
python web2py.pyImportError: cannot import name 'Cookie'
Either your are not installing the latest pydal or you have two versions (one in Python site-packages?).
If you can import pydal from outside the web2py folder, then the problem is the latter. Un-install it because it will create problems.
Massimo
Hi Massimo, there is already a package called template in pypi, how should we name the new template module?
Greetings.
I have created a pydal-like structure for templates, including an initial setup.py and tests (there is also a fix for python 3 when running standalone), you can take a look at https://github.com/cccaballero/web2py/tree/modular_templates/gluon/packages/template
Greetings.
Anybody wants to help
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.
I know it's not too much originality, but perhaps web2py-template?
Or perhaps something like insole or markings.
Greetings.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
--