I tried to launch a Flask app, which you can find on GitHub . Surprised it starts with Python2.7 now, while it launched with Python3 before. It did not work very badly. I do not know what the reason is.
(MyFlaskAppEnv) mike@mike-thinks:~/Programming/Rasa/myflaskapp$ flask run
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
Traceback (most recent call last):
File "/home/mike/.local/bin/flask", line 11, in <module>
sys.exit(main())
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 894, in main
cli.main(args=args, prog_name=name)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 557, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 767, in run_command
app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 293, in __init__
self._load_unlocked()
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 317, in _load_unlocked
self._app = rv = self.loader()
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 377, in load_app
raise_if_not_found=False)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 235, in locate_app
__import__(module_name)
File "/home/mike/Programming/Rasa/myflaskapp/app/__init__.py", line 42
SyntaxError: Non-ASCII character '\xc2' in file /home/mike/Programming/Rasa/myflaskapp/app/__init__.py on line 42, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
In fact:
(MyFlaskAppEnv) mike@mike-thinks:~/Programming/Rasa/myflaskapp$ python -V
Python 2.7.12
mike@mike-thinks:~/Programming/Rasa/myflaskapp$ python3 -V
Python 3.5.2
Update
I tried to specify the version of Python I wanted in the environment, but it looks like it was already Python3.
mike@mike-thinks:~/Programming/Rasa/myflaskapp$ virtualenv MyFlaskAppEnv/ --python="/usr/bin/python3"
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/mike/Programming/Rasa/myflaskapp/MyFlaskAppEnv/bin/python3
Traceback (most recent call last):
File "/home/mike/.local/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/home/mike/.local/lib/python3.5/site-packages/virtualenv.py", line 712, in main
symlink=options.symlink)
File "/home/mike/.local/lib/python3.5/site-packages/virtualenv.py", line 927, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/home/mike/.local/lib/python3.5/site-packages/virtualenv.py", line 1233, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/lib/python3.5/shutil.py", line 98, in copyfile
raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/usr/bin/python3' and '/home/mike/Programming/Rasa/myflaskapp/MyFlaskAppEnv/bin/python3' are the same file
mike@mike-thinks:~/Programming/Rasa/myflaskapp$ source MyFlaskAppEnv/bin/activate
So when I run, it gives me the same error.
(MyFlaskAppEnv) mike@mike-thinks:~/Programming/Rasa/myflaskapp$ flask run
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
Traceback (most recent call last):
File "/home/mike/.local/bin/flask", line 11, in <module>
sys.exit(main())
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 894, in main
cli.main(args=args, prog_name=name)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 557, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 767, in run_command
app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 293, in __init__
self._load_unlocked()
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 317, in _load_unlocked
self._app = rv = self.loader()
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 377, in load_app
raise_if_not_found=False)
File "/home/mike/.local/lib/python2.7/site-packages/flask/cli.py", line 235, in locate_app
__import__(module_name)
File "/home/mike/Programming/Rasa/myflaskapp/app/__init__.py", line 42
SyntaxError: Non-ASCII character '\xc2' in file /home/mike/Programming/Rasa/myflaskapp/app/__init__.py on line 42, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details