SyntaxError: invalid syntax

Hello from newbie. I’ve tried to install streamlit using Anaconda/Spyder on Python3.7 on Win10 64bit
Got following after executing pip install streamlit in console

Collecting streamlit
  Downloading https://files.pythonhosted.org/packages/ba/f4/aec55c04285d3e369c11574f7b95703bb3472ab17f03a488d3f5314cce8b/streamlit-0.48.1-py2.py3-none-any.whl (5.0MB)
Collecting tornado<6.0,>=5.0 (from streamlit)
  Downloading https://files.pythonhosted.org/packages/d7/d5/99aff77c15da335e3dbf30254b304a526494dca8e51b4b47419772e35a4e/tornado-5.1.1-cp37-cp37m-win_amd64.whl (455kB)
Collecting tzlocal (from streamlit)
  Downloading https://files.pythonhosted.org/packages/ef/99/53bd1ac9349262f59c1c421d8fcc2559ae8a5eeffed9202684756b648d33/tzlocal-2.0.0-py2.py3-none-any.whl
Collecting blinker (from streamlit)
  Downloading https://files.pythonhosted.org/packages/1b/51/e2a9f3b757eb802f61dc1f2b09c8c99f6eb01cf06416c0671253536517b6/blinker-1.4.tar.gz (111kB)
Requirement already satisfied: click>=7.0 in c:\users\user\anaconda3\lib\site-packages (from streamlit) (7.0)
Collecting watchdog (from streamlit)
  Downloading https://files.pythonhosted.org/packages/bb/e3/5a55d48a29300160779f0a0d2776d17c1b762a2039b36de528b093b87d5b/watchdog-0.9.0.tar.gz (85kB)
Collecting astor (from streamlit)
  Downloading https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: future in c:\users\user\anaconda3\lib\site-packages (from streamlit) (0.17.1)
Collecting altair>=3.2.0 (from streamlit)
  Downloading https://files.pythonhosted.org/packages/34/24/3e50e226a79db1bb1427bf8c58cc4dc7c2f74c39b728af005f4b11d1760c/altair-3.2.0-py2.py3-none-any.whl (596kB)
Requirement already satisfied: pillow!=5.1.0 in c:\users\user\anaconda3\lib\site-packages (from streamlit) (6.2.0)
Requirement already satisfied: requests in c:\users\user\anaconda3\lib\site-packages (from streamlit) (2.22.0)
Collecting base58 (from streamlit)
  Downloading https://files.pythonhosted.org/packages/09/b2/21ac9591f055acc145afead895edeb73bbd69d95cf366fc5c2233f2434cb/base58-1.0.3-py3-none-any.whl
Requirement already satisfied: numpy in c:\users\user\anaconda3\lib\site-packages (from streamlit) (1.16.5)
Collecting enum-compat (from streamlit)
  Downloading https://files.pythonhosted.org/packages/55/ae/467bc4509246283bb59746e21a1a2f5a8aecbef56b1fa6eaca78cd438c8b/enum_compat-0.0.3-py3-none-any.whl
Collecting validators (from streamlit)
  Downloading https://files.pythonhosted.org/packages/b2/b7/5fc43b7dba2a35362b2f5ce39dbee835c48898e2458910c3af810240fbaa/validators-0.14.0.tar.gz
Collecting boto3 (from streamlit)
  Downloading https://files.pythonhosted.org/packages/24/d3/c815592a47c1e074d324dcdb40d2fbfe253a4294b908b10021433388b747/boto3-1.9.250-py2.py3-none-any.whl (128kB)
Collecting protobuf>=3.6.0 (from streamlit)
  Downloading https://files.pythonhosted.org/packages/a8/ae/a11b9b0c8e2410b11887881990b71f54ec39b17c4de2b5d850ef66aade8c/protobuf-3.10.0-cp37-cp37m-win_amd64.whl (1.0MB)
Collecting toml (from streamlit)
  Downloading https://files.pythonhosted.org/packages/a2/12/ced7105d2de62fa7c8fb5fce92cc4ce66b57c95fb875e9318dba7f8c5db0/toml-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: pandas in c:\users\user\anaconda3\lib\site-packages (from streamlit) (0.25.1)
Collecting botocore (from streamlit)
  Downloading https://files.pythonhosted.org/packages/cc/b6/2dd3295ec683422a0db945b1e28c7a74bc993a446dbddd5e479f0548c506/botocore-1.12.250-py2.py3-none-any.whl (5.7MB)
Requirement already satisfied: pytz in c:\users\user\anaconda3\lib\site-packages (from tzlocal->streamlit) (2019.3)
Requirement already satisfied: PyYAML>=3.10 in c:\users\user\anaconda3\lib\site-packages (from watchdog->streamlit) (5.1.2)
Collecting argh>=0.24.1 (from watchdog->streamlit)
  Downloading https://files.pythonhosted.org/packages/06/1c/e667a7126f0b84aaa1c56844337bf0ac12445d1beb9c8a6199a7314944bf/argh-0.26.2-py2.py3-none-any.whl
Collecting pathtools>=0.1.1 (from watchdog->streamlit)
  Downloading https://files.pythonhosted.org/packages/e7/7f/470d6fcdf23f9f3518f6b0b76be9df16dcc8630ad409947f8be2eb0ed13a/pathtools-0.1.2.tar.gz
Requirement already satisfied: jsonschema in c:\users\user\anaconda3\lib\site-packages (from altair>=3.2.0->streamlit) (3.0.2)
Requirement already satisfied: six in c:\users\user\anaconda3\lib\site-packages (from altair>=3.2.0->streamlit) (1.12.0)
Requirement already satisfied: toolz in c:\users\user\anaconda3\lib\site-packages (from altair>=3.2.0->streamlit) (0.10.0)
Requirement already satisfied: entrypoints in c:\users\user\anaconda3\lib\site-packages (from altair>=3.2.0->streamlit) (0.3)
Requirement already satisfied: jinja2 in c:\users\user\anaconda3\lib\site-packages (from altair>=3.2.0->streamlit) (2.10.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user\anaconda3\lib\site-packages (from requests->streamlit) (2019.9.11)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\user\anaconda3\lib\site-packages (from requests->streamlit) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\user\anaconda3\lib\site-packages (from requests->streamlit) (1.24.2)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\user\anaconda3\lib\site-packages (from requests->streamlit) (3.0.4)
Requirement already satisfied: decorator>=3.4.0 in c:\users\user\anaconda3\lib\site-packages (from validators->streamlit) (4.4.0)
Collecting s3transfer<0.3.0,>=0.2.0 (from boto3->streamlit)
  Downloading https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl (70kB)
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->streamlit)
  Downloading https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Requirement already satisfied: setuptools in c:\users\user\anaconda3\lib\site-packages (from protobuf>=3.6.0->streamlit) (41.4.0)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\user\anaconda3\lib\site-packages (from pandas->streamlit) (2.8.0)
Requirement already satisfied: docutils<0.16,>=0.10 in c:\users\user\anaconda3\lib\site-packages (from botocore->streamlit) (0.15.2)
Requirement already satisfied: pyrsistent>=0.14.0 in c:\users\user\anaconda3\lib\site-packages (from jsonschema->altair>=3.2.0->streamlit) (0.15.4)
Requirement already satisfied: attrs>=17.4.0 in c:\users\user\anaconda3\lib\site-packages (from jsonschema->altair>=3.2.0->streamlit) (19.2.0)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\user\anaconda3\lib\site-packages (from jinja2->altair>=3.2.0->streamlit) (1.1.1)
Building wheels for collected packages: blinker, watchdog, validators, pathtools
  Building wheel for blinker (setup.py): started
  Building wheel for blinker (setup.py): finished with status 'done'
  Created wheel for blinker: filename=blinker-1.4-cp37-none-any.whl size=13452 sha256=f8e427378d82fccae2fcf8d0f7c60192fc0e99d1e6b0e80464258b6d2f8d4ab6
  Stored in directory: C:\Users\user\AppData\Local\pip\Cache\wheels\92\a0\00\8690a57883956a301d91cf4ec999cc0b258b01e3f548f86e89
  Building wheel for watchdog (setup.py): started
  Building wheel for watchdog (setup.py): finished with status 'done'
  Created wheel for watchdog: filename=watchdog-0.9.0-cp37-none-any.whl size=73657 sha256=0b7dc2b61fafa86709c1590b5290d9a2b730098629915c7c8ac13e0fa3250caa
  Stored in directory: C:\Users\user\AppData\Local\pip\Cache\wheels\61\1d\d0\04cfe495619be2095eb8d89a31c42adb4e42b76495bc8f784c
  Building wheel for validators (setup.py): started
  Building wheel for validators (setup.py): finished with status 'done'
  Created wheel for validators: filename=validators-0.14.0-cp37-none-any.whl size=17080 sha256=3c106719efb48f83625e4189bd5773781413fb633680e4139bfbd44c4249a15d
  Stored in directory: C:\Users\user\AppData\Local\pip\Cache\wheels\52\ad\d4\c5ddfd117381a9c46fdc4a1d15eb688a81e6e821f5c69d9056
  Building wheel for pathtools (setup.py): started
  Building wheel for pathtools (setup.py): finished with status 'done'
  Created wheel for pathtools: filename=pathtools-0.1.2-cp37-none-any.whl size=8793 sha256=8de1351309fe886dfc45f0bbf47f938c2a07bc7d48e33a9432c304084d799dac
  Stored in directory: C:\Users\user\AppData\Local\pip\Cache\wheels\0b\04\79\c3b0c3a0266a3cb4376da31e5bfe8bba0c489246968a68e843
Successfully built blinker watchdog validators pathtools
Installing collected packages: tornado, tzlocal, blinker, argh, pathtools, watchdog, astor, altair, base58, enum-compat, validators, jmespath, botocore, s3transfer, boto3, protobuf, toml, streamlit
  Found existing installation: tornado 6.0.3
    Uninstalling tornado-6.0.3:
      Successfully uninstalled tornado-6.0.3
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\users\\user\\anaconda3\\lib\\site-packages\\~ornado\\speedups.cp37-win_amd64.pyd'
Consider using the `--user` option or check the permissions.

When I input streamlit hello i get following

File “”, line 1
streamlit hello
^
SyntaxError: invalid syntax

Hi @Sinisa_Kizlin

From your post it looks like you’re entering streamlit hello inside a Python file. But that command is supposed to be used in a terminal instead.

Based on your install logs, above, you seem to be using Anaconda. If so, one way to get a terminal is to open Anaconda Navigator, find your environment, click the “play” button next to it, then “open terminal”.

image

2 Likes