Error installing Flask - Python - python

I am still trying to install Flask on the 'virtual enviroments'. I had some errors trying to get the pip commands when virtualenv activated. (had something to do that my username has a space in the name)
But finally found a solutions, just type the right path to where pip is located, to avoid the username folder.
(venv) C:\Users\Daniel P-C>cd C:\Python34\Scripts
(venv) C:\Python34\Scripts>pip
Usage:
pip <command> [options]
etc...
well when trying to install flask I get the following errors
(venv) C:\Python34\Scripts>pip install flask
Downloading/unpacking flask
Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P
-C\flask\setup.py) egg_info for package flask
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
no previously-included directories found matching 'docs\_themes\.git'
Downloading/unpacking Werkzeug>=0.7 (from flask)
Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P
-C\Werkzeug\setup.py) egg_info for package Werkzeug
warning: no files found matching '*' under directory 'werkzeug\debug\templat
es'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
Downloading/unpacking Jinja2>=2.4 (from flask)
Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P
-C\Jinja2\setup.py) egg_info for package Jinja2
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'do
cs\_build'
warning: no previously-included files matching '*.pyc' found under directory
'jinja2'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'jinja2'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
Downloading/unpacking itsdangerous>=0.21 (from flask)
Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P
-C\itsdangerous\setup.py) egg_info for package itsdangerous
warning: no previously-included files matching '*' found under directory 'do
cs\_build'
Downloading/unpacking markupsafe (from Jinja2>=2.4->flask)
Downloading MarkupSafe-0.23.tar.gz
Running setup.py (path:C:\Users\DANIEL~1\AppData\Local\Temp\pip_build_Daniel P
-C\markupsafe\setup.py) egg_info for package markupsafe
Installing collected packages: flask, Werkzeug, Jinja2, itsdangerous, markupsafe
Running setup.py install for flask
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
no previously-included directories found matching 'docs\_themes\.git'
Running setup.py install for Werkzeug
warning: no files found matching '*' under directory 'werkzeug\debug\templat
es'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
Running setup.py install for Jinja2
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'do
cs\_build'
warning: no previously-included files matching '*.pyc' found under directory
'jinja2'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'jinja2'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
Running setup.py install for itsdangerous
warning: no previously-included files matching '*' found under directory 'do
cs\_build'
Running setup.py install for markupsafe
building 'markupsafe._speedups' extension
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python installation succeeded.
==========================================================================
Successfully installed flask Werkzeug Jinja2 itsdangerous markupsafe
Cleaning up...
it says that it has successfully installed flask, but when running python and trying to type import flask it is like it isn't installed? What can I do?
(venv) C:\Python34\Scripts>python
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'flask'
I am btw running on Windows 7

Be sure, you use pip and python from venv
For a module/package to be installed by pip into virtualenv, you must use the pip from virtualenv.
For importing modules/packages being installed into virtualenv environment you have to run python interpreter from given virtualenv.
In case, you run your pip or python from directory C:\Python 34\Scripts, it is very likely, you use system wide pip and install flask into system Python. On Linux you would get problems as installing into system wide python requires root privileges, on MS Windows default Python installation it does not complain.
Advice: Create your virtualenv out of default Python installation directory and use pip and python from this virtulaenv. This is what usually happens, when you activate the virtualenv, so there is no need to explicitly using full path to pip or python (anyway, using explicit path to venv python and pip would not harm anything.

I had exactly the same problem as you, and the answer of Jan didn't work for me.
The problem was simply that I installed virtualenv using apt-get:
$ sudo apt-get install virtualenv
Instead of installing it with pip:
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ sudo python get-pip.py
$ sudo pip install virtualenv
It solved the problem for me. You can even uninstall the apt-get package after:
$ sudo apt-get remove virtualenv
virtualenv is still installed (but the good one!).

Did you add python to your path?
Try this:
Click Start
Search Advanced Systems setting and click
Click on Environmental Variables.
Append ;C:\python27 to the Path variable
Restart the Command Prompt.

Related

Pyinstaller gives an error when I install Python

When I try to install I get the following error message. What should I do to fix this?problem? Can I get some help? I haven't been in Python for a long time, and I don't really understand what these mean.
command: 'c:\users\appdata\local\programs\python\python37-32\python.exe' 'c:\users\appdata\local\programs\python\python37-32\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\AppData\Local\Temp\tmp5hj8yy69'
cwd: C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller
Complete output (36 lines):
running dist_info
creating C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info
writing C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\PKG-INFO
writing dependency_links to C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\dependency_links.txt
writing entry points to C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\entry_points.txt
writing requirements to C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\requires.txt
writing top-level names to C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\top_level.txt
writing manifest file 'C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\SOURCES.txt'
reading manifest file 'C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb9 in position 0: invalid start byte (sitecustomize.py, line 7)
no previously-included directories found matching 'bootloader\build'
no previously-included directories found matching 'bootloader.waf-'
no previously-included directories found matching 'bootloader.waf3-'
no previously-included directories found matching 'bootloader\waf-'
no previously-included directories found matching 'bootloader\waf3-'
no previously-included directories found matching 'bootloader_sdks'
no previously-included directories found matching 'bootloader.vagrant'
warning: no previously-included files found matching 'bootloader.lock-waf'
no previously-included directories found matching 'doc\source'
no previously-included directories found matching 'doc_build'
warning: no previously-included files matching '.tmp' found under directory 'doc'
warning: no files found matching 'news_template.rst'
no previously-included directories found matching 'news'
no previously-included directories found matching 'old'
no previously-included directories found matching 'scripts'
no previously-included directories found matching 'tests\scripts'
no previously-included directories found matching '.github'
warning: no previously-included files found matching '.'
warning: no previously-included files found matching '.yml'
warning: no previously-included files found matching '*~'
warning: no previously-included files found matching '.directory'
writing manifest file 'C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\SOURCES.txt'
creating 'C:\Users\AppData\Local\Temp\pip-install-_y8nunuv\pyinstaller\pip-wheel-metadata\PyInstaller.dist-info'
error: invalid command 'bdist_wheel'
---------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\appdata\local\programs\python\python37-32\python.exe' 'c:\users\appdata\local\programs\python\python37-32\lib\site-packages\pip_vendor\pep517_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\AppData\Local\Temp\tmp5hj8yy69' Check the logs for full command output.
Preparing wheel metadata ... error
The point is this sentence, a wheel file is missing.
$pip install wheel -i https://pypi.tuna.tsinghua.edu.cn/simple
Maybe try to execute this sentence before executing your previous

Error installing cryptography on Big Sur running on Apple Silicon

I've tried to install cryptography on my brand new Air M1. But something goes wrong.
I already tried some solutions from google but it didn't help.
Environment Details:
Python 3.9.1
pip 21.0.1
macOS BigSur 11.2 Appl1 M1
cffi==1.14.5
openssl#1.1
Steps to reproduce:
pip3 install cryptography
traceback:
copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.macosx-11-arm64-3.9/cryptography/hazmat/bindings/openssl
running egg_info
writing src/cryptography.egg-info/PKG-INFO
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing requirements to src/cryptography.egg-info/requires.txt
writing top-level names to src/cryptography.egg-info/top_level.txt
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files found matching 'vectors'
warning: no previously-included files matching '*' found under directory 'vectors'
warning: no previously-included files matching '*' found under directory '.github'
warning: no previously-included files found matching 'release.py'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching 'codecov.yml'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'mypy.ini'
warning: no previously-included files matching '*' found under directory '.zuul.d'
warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
copying src/cryptography/py.typed -> build/lib.macosx-11-arm64-3.9/cryptography
running build_ext
generating cffi module 'build/temp.macosx-11-arm64-3.9/_padding.c'
creating build/temp.macosx-11-arm64-3.9
generating cffi module 'build/temp.macosx-11-arm64-3.9/_openssl.c'
running build_rust
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation.html for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq.html
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation.html#rust
5) If you are experiencing issues with Rust for *this release only* you may
set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
=============================DEBUG ASSISTANCE=============================
error: Can not find Rust compiler
----------------------------------------
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
Rust currently works on m1 via
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
However you will most likely experience another error after fixing rust.
import _cffi_backend as backend
ImportError: dlopen(/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.x/site-packages/_cffi_backend.cpython-3X-darwin.so, 2): no suitable image found. Did find:
/private/var/folders/fd/s3rl30nj6790c3p5df6x2_700000gn/T/pip-build-env-w44a7bqz/overlay/lib/python3.X/site-packages/_cffi_backend.cpython-3X-darwin.so: mach-o, but wrong architecture
The issue is discussed here where it's stated that CFFI maintainers don't support m1 macs: https://github.com/gevent/gevent/issues/1721
it works for me after fresh updates.
sudo xcode-select --install.

bug in installing pyinstaller

So I tried the pip install pyinstaller command and thats what happened:
So I had this bug:
Collecting pyinstaller
Using cached pyinstaller-4.1.tar.gz (3.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\aris\onedrive\υπολογιστής\python\python.exe' 'c:\users\aris\onedrive\υπολογιστής\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\aris\AppData\Local\Temp\tmp_o2ged7z'
cwd: C:\Users\aris\AppData\Local\Temp\pip-install-ipo7dr00\pyinstaller_7b00b43eae9b4a19be431faa4f4cf9f4
Complete output (38 lines):
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf5 in position 0: invalid start byte (sitecustomize.py, line 7)
running dist_info
creating C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info
writing C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\PKG-INFO
writing dependency_links to C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\dependency_links.txt
writing entry points to C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\entry_points.txt
writing requirements to C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\requires.txt
writing top-level names to C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\top_level.txt
writing manifest file 'C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\SOURCES.txt'
reading manifest file 'C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'pyinstaller-gui.py'
no previously-included directories found matching 'bootloader\build'
no previously-included directories found matching 'bootloader\.waf-*'
no previously-included directories found matching 'bootloader\.waf3-*'
no previously-included directories found matching 'bootloader\waf-*'
no previously-included directories found matching 'bootloader\waf3-*'
no previously-included directories found matching 'bootloader\_sdks'
no previously-included directories found matching 'bootloader\.vagrant'
warning: no previously-included files found matching 'bootloader\.lock-waf*'
no previously-included directories found matching 'doc\source'
no previously-included directories found matching 'doc\_build'
warning: no previously-included files matching '*.tmp' found under directory 'doc'
warning: no files found matching 'news\_template.rst'
no previously-included directories found matching 'news'
no previously-included directories found matching 'old'
no previously-included directories found matching 'scripts'
no previously-included directories found matching 'tests\scripts'
no previously-included directories found matching '.github'
warning: no previously-included files found matching '.*'
warning: no previously-included files found matching '*.yml'
warning: no previously-included files found matching '*~'
warning: no previously-included files found matching '.directory'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
writing manifest file 'C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.egg-info\SOURCES.txt'
creating 'C:\Users\aris\AppData\Local\Temp\pip-modern-metadata-tgdlk_61\pyinstaller.dist-info'
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\aris\onedrive\υπολογιστής\python\python.exe' 'c:\users\aris\onedrive\υπολογιστής\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\aris\AppData\Local\Temp\tmp_o2ged7z' Check the logs for full command output.
Does anyone know how I can solve it??
The error says:
error: invalid command 'bdist_wheel' ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\aris\onedrive\υπολογιστής\python\python.exe'
Try installing wheel first. mostly the error describes itself. try going through them carefully, it will save you lot of debugging time.
Run this command:
pip install wheel
Let me know if the error still exists.
Install the wheel package first. While you're at it, upgrade the whole pip "stack":
python -m pip install -U wheel setuptools pip

How can I set up Debian x86_64 so a Django project sees django.contrib.staticfiles?

I have a new Debian VPS, and a Django project that I am trying to deploy is not seeing django.contrib.staticfiles.*. Doing a "pip install django-staticfiles" has not observably changed things.
What is the best way to have things running well enough that such Django projects will run?
--EDIT--
I tried to uninstall Django and then install with pip and a virtualenv. This resulted in another error, failing to import execute_manager. The terminal output was:
Proceed (y/n)? y
Successfully uninstalled gunicorn
root#ps306627:/home/cjsh/pragmatometer# exit
(pragmatometerenvironment)cjsh#ps306627:~/pragmatometer$ pip uninstall django
Uninstalling Django:
/home/cjsh/pragmatometerenvironment/bin/django-admin.py
/home/cjsh/pragmatometerenvironment/lib/python2.6/site-packages/Django-1.6.3-py2.6.egg-info
/home/cjsh/pragmatometerenvironment/lib/python2.6/site-packages/django
Proceed (y/n)? y
Successfully uninstalled Django
(pragmatometerenvironment)cjsh#ps306627:~/pragmatometer$ pip install django
Downloading/unpacking django
Downloading Django-1.6.3.tar.gz (6.6Mb): 6.6Mb downloaded
Running setup.py egg_info for package django
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
Installing collected packages: django
Running setup.py install for django
changing mode of build/scripts-2.6/django-admin.py from 644 to 755
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
changing mode of /home/cjsh/pragmatometerenvironment/bin/django-admin.py to 755
Successfully installed django
Cleaning up...
(pragmatometerenvironment)cjsh#ps306627:~/pragmatometer$ pip install gunicorn
Downloading/unpacking gunicorn
Downloading gunicorn-18.0.tar.gz (366Kb): 366Kb downloaded
Running setup.py egg_info for package gunicorn
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
Installing collected packages: gunicorn
Running setup.py install for gunicorn
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
Installing gunicorn_paster script to /home/cjsh/pragmatometerenvironment/bin
Installing gunicorn script to /home/cjsh/pragmatometerenvironment/bin
Installing gunicorn_django script to /home/cjsh/pragmatometerenvironment/bin
Successfully installed gunicorn
Cleaning up...
(pragmatometerenvironment)cjsh#ps306627:~/pragmatometer$ python manage.py runserver
Traceback (most recent call last):
File "manage.py", line 2, in <module>
from django.core.management import execute_manager
ImportError: cannot import name execute_manager
Thanks,
What I saw was irritation at a manage.py that was out of sync with the newer version of python the system was running.
The new, working manage.py, with old one commented out, is:
#!/usr/bin/env python
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pragmatometer.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
##!/usr/bin/env python
#from django.core.management import execute_manager
#import imp
#try:
# imp.find_module('settings') # Assumed to be in the same directory.
#except ImportError:
# import sys
# sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
# sys.exit(1)
#
#import settings
#
#if __name__ == "__main__":
# execute_manager(settings)

Flask install/running issues

I'm getting very frustrated with trying to get Flask to run. I've tried installing a number of ways, but regardless, I run into some issues without any understanding as to how or why.
Below is an example instance of it messing up. This was my reference: http://flask.pocoo.org/docs/quickstart/
Any help is appreciated. Thanks in advance.
Shahs-MacBook-Pro:newpython ssaullah$ . venv/bin/activate
(venv)Shahs-MacBook-Pro:newpython ssaullah$ pip install Flask
Downloading/unpacking Flask
Downloading Flask-0.9.tar.gz (481kB): 481kB downloaded
Running setup.py egg_info for package Flask
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
Downloading/unpacking Werkzeug>=0.7 (from Flask)
Downloading Werkzeug-0.8.3.tar.gz (1.1MB): 1.1MB downloaded
Running setup.py egg_info for package Werkzeug
warning: no files found matching '*' under directory 'werkzeug/debug/templates'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
Downloading/unpacking Jinja2>=2.4 (from Flask)
Downloading Jinja2-2.7.tar.gz (377kB): 377kB downloaded
Running setup.py egg_info for package Jinja2
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
Downloading/unpacking markupsafe (from Jinja2>=2.4->Flask)
Downloading MarkupSafe-0.18.tar.gz
Running setup.py egg_info for package markupsafe
Installing collected packages: Flask, Werkzeug, Jinja2, markupsafe
Running setup.py install for Flask
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_themes/.git'
Running setup.py install for Werkzeug
warning: no files found matching '*' under directory 'werkzeug/debug/templates'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.pyo' found under directory 'examples'
no previously-included directories found matching 'docs/_build'
Running setup.py install for Jinja2
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
Running setup.py install for markupsafe
building 'markupsafe._speedups' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c markupsafe/_speedups.c -o build/temp.macosx-10.3-fat-2.7/markupsafe/_speedups.o
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -g build/temp.macosx-10.3-fat- 2.7/markupsafe/_speedups.o -o build/lib.macosx-10.3-fat-2.7/markupsafe/_speedups.so
Successfully installed Flask Werkzeug Jinja2 markupsafe
Cleaning up...
--
(venv)Shahs-MacBook-Pro:newpython ssaullah$ touch hello.py
(venv)Shahs-MacBook-Pro:newpython ssaullah$ open hello.py
(venv)Shahs-MacBook-Pro:newpython ssaullah$ python hello.py
File "hello.py", line 4
SyntaxError: Non-ASCII character '\xe2' in file hello.py on line 4, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
(venv)Shahs-MacBook-Pro:newpython ssaullah$
Shahs-MacBook-Pro:helloflask ssaullah$ git push heroku master
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 731 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
As the error said - you have a non-ASCII character in your hello.py code but you haven't declared an encoding. You can fix this by adding a comment to your source code in the first or second line declaring the encoding. For example, if your file is saved in UTF-8:
# coding: utf-8
See PEP 0263 for more details.
try using python's easy_install
$python easy_install Flask

Categories