Hard time setting up - Why "Streamlit is a package and cannot be directly executed"

Hi,

I have found streamlit and it seems to be really cool.

The problem is, I cannot get it running:

I installed it with via conda using the conda-forge channel which worked very well and shows up under conda list.

I tried streamlit hello but it threw an error with No module named streamlit.__main__; 'streamlit' is a package and cannot be directly executed.

So I uninstalled my complete anaconda, installed miniconda, set up new environment called minimal. I added conda-forge as strict channel and installed some “usual” packages (pandas, altair, etc). Checked that the environment it works with some other python files.

But when I try streamlit hello or something similar I get:
C:\Users\username\Miniconda3\envs\minimal\python.exe: No module named streamlit.__main__; 'streamlit' is a package and cannot be directly executed

It seems to find the executable just fine:

    (minimal) C:\Users\user>where streamlit
    C:\Users\user\Miniconda3\envs\minimal\Scripts\streamlit
    C:\Users\user\Miniconda3\envs\minimal\Scripts\streamlit.cmd

Can you help me get it running? I do not really understand what the error is telling me, I am somewhat new to python.

Hey @domsl,

First, Welcome to our Streamlit community!!! :partying_face: :partying_face: :partying_face: :partying_face: :partying_face: :partying_face: :tada:

I’m sorry your having trouble running Streamlit! Can you tell me more about your environment?
i.e. mac/windows/linux
version of python
version of conda
also if you have it a screenshot of your terminal when you try streamlit hello?

We want Streamlit to be as seamless for people as possible, so I would like to get these details on your system and hopefully we can sort this out quickly!

Marisa

Hey @Marisa_Smith,

Thank you very much for the very warm welcome. :slight_smile:

I am on a different machine now, but it seems to be the same problem (on the other machine it was the newest download of miniconda and the corresponding python). On this machine I created a new environment just now (same as mentioned above, but with my current anaconda install):
Windows 10
conda 4.8.3
Python 3.9.0
And it works fine here.

So I will try again as soon as I have access to the other PC where I had the problems to post version numbers and screenshots.

1 Like

Hi @Marisa_Smith,

edit:

Here is the screenshot of the original machine:

Interestingly the conda version is higher.

Does anyone have any idea how to get it running? :slight_smile:

I startet do wonder why there might be a difference so I create “another” conda env on the machine where it was previously not working - and it works!

I guess there is some problem with an interaction/solving because I installed some extra packgaes on the other environment.

Working:

# packages in environment at C:\Users\user\Miniconda3\envs\minimal_2:
#
# Name                    Version                   Build  Channel
abseil-cpp                20200225.2           ha925a31_2    conda-forge
altair                    4.1.0                      py_1    conda-forge
argh                      0.26.2          pyh9f0ad1d_1002    conda-forge
argon2-cffi               20.1.0           py39hb82d6ee_2    conda-forge
arrow-cpp                 2.0.0           py39h96725ad_6_cpu    conda-forge
astor                     0.8.1              pyh9f0ad1d_0    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
aws-c-common              0.4.59               h8ffe710_1    conda-forge
aws-c-event-stream        0.1.6                hb4e73fc_6    conda-forge
aws-checksums             0.1.10               h6f0a1a5_0    conda-forge
aws-sdk-cpp               1.8.70               he2782d2_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.1                      py_0    conda-forge
base58                    2.0.1                      py_0    conda-forge
bleach                    3.2.1              pyh9f0ad1d_0    conda-forge
blinker                   1.4                        py_1    conda-forge
boto3                     1.16.32            pyhd8ed1ab_0    conda-forge
botocore                  1.19.32            pyhd8ed1ab_0    conda-forge
brotli                    1.0.9                ha925a31_3    conda-forge
brotlipy                  0.7.0           py39ha3862ff_1001    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
c-ares                    1.17.1               h8ffe710_0    conda-forge
ca-certificates           2020.12.5            h5b45459_0    conda-forge
cachetools                4.1.1                      py_0    conda-forge
certifi                   2020.12.5        py39hcbf5309_0    conda-forge
cffi                      1.14.4           py39h0878f49_1    conda-forge
chardet                   3.0.4           py39h467e6f4_1008    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              3.2.1            py39h0878f49_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
freetype                  2.10.4               h546665d_0    conda-forge
gflags                    2.2.2             ha925a31_1004    conda-forge
gitdb                     4.0.5                      py_0    conda-forge
gitpython                 3.1.11                     py_0    conda-forge
glog                      0.4.0                h0174b99_3    conda-forge
grpc-cpp                  1.33.2               h59b151f_1    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
importlib-metadata        3.1.1              pyhd8ed1ab_0    conda-forge
importlib_metadata        3.1.1                hd8ed1ab_0    conda-forge
intel-openmp              2020.3             h57928b3_311    conda-forge
ipykernel                 5.3.4            py39he1a07ef_1    conda-forge
ipython                   7.19.0           py39h832f523_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1              pyh9f0ad1d_1    conda-forge
jedi                      0.17.2           py39hcbf5309_1    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jmespath                  0.10.0             pyh9f0ad1d_0    conda-forge
jpeg                      9d                   h8ffe710_0    conda-forge
jsonschema                3.2.0                      py_2    conda-forge
jupyter_client            6.1.7                      py_0    conda-forge
jupyter_core              4.7.0            py39hcbf5309_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
krb5                      1.17.2               hbae68bd_0    conda-forge
libblas                   3.8.0                    21_mkl    conda-forge
libcblas                  3.8.0                    21_mkl    conda-forge
libcurl                   7.71.1               h4b64cdc_8    conda-forge
liblapack                 3.8.0                    21_mkl    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libprotobuf               3.13.0.1             h200bbdf_0    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libssh2                   1.9.0                hb06d900_5    conda-forge
libthrift                 0.13.0               hdfef310_6    conda-forge
libtiff                   4.1.0                hc10be44_6    conda-forge
libutf8proc               2.6.0                hcb41399_0    conda-forge
lz4-c                     1.9.2                h62dcd97_2    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.1.1            py39ha3862ff_2    conda-forge
mistune                   0.8.4           py39hb82d6ee_1002    conda-forge
mkl                       2020.4             hb70f87d_311    conda-forge
msys2-conda-epoch         20160418                      1
nbclient                  0.5.1                      py_0    conda-forge
nbconvert                 6.0.7            py39hcbf5309_3    conda-forge
nbformat                  5.0.8                      py_0    conda-forge
nest-asyncio              1.4.3              pyhd8ed1ab_0    conda-forge
notebook                  6.1.5            py39hcbf5309_0    conda-forge
numpy                     1.19.4           py39h6635163_1    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openssl                   1.1.1h               he774522_0    conda-forge
packaging                 20.7               pyhd3deb0d_0    conda-forge
pandas                    1.1.5            py39h2e25243_0    conda-forge
pandoc                    2.11.2               h8ffe710_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.7.1              pyh9f0ad1d_0    conda-forge
pathtools                 0.1.2                      py_1    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.0.1            py39hbc3ea3a_0    conda-forge
pip                       20.3.1             pyhd8ed1ab_0    conda-forge
prometheus_client         0.9.0              pyhd3deb0d_0    conda-forge
prompt-toolkit            3.0.8              pyha770c72_0    conda-forge
protobuf                  3.13.0.1         py39h415ef7b_1    conda-forge
pyarrow                   2.0.0           py39hf9247be_6_cpu    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydeck                    0.5.0              pyh9f0ad1d_0    conda-forge
pygments                  2.7.3              pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.17.3           py39hb82d6ee_1    conda-forge
pysocks                   1.7.1            py39h467e6f4_2    conda-forge
python                    3.9.1           h7840368_1_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.9                      1_cp39    conda-forge
pytz                      2020.4             pyhd8ed1ab_0    conda-forge
pywin32                   228              py39h4cdbadb_0    conda-forge
pywinpty                  0.5.7            py39hde42818_1    conda-forge
pyyaml                    5.3.1            py39ha3862ff_1    conda-forge
pyzmq                     20.0.0           py39h6e08c89_1    conda-forge
re2                       2020.11.01           h0e60522_0    conda-forge
requests                  2.25.0             pyhd3deb0d_0    conda-forge
s3transfer                0.3.3                      py_3    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                49.6.0           py39h467e6f4_2    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
smmap                     3.0.4              pyh9f0ad1d_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
sqlite                    3.34.0               h8ffe710_0    conda-forge
streamlit                 0.72.0             pyhd8ed1ab_1    conda-forge
terminado                 0.9.1            py39hcbf5309_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
tk                        8.6.10               he774522_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
toolz                     0.11.1                     py_0    conda-forge
tornado                   6.1              py39hb82d6ee_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
tzdata                    2020d                h516909a_0    conda-forge
tzlocal                   2.1                pyh9f0ad1d_0    conda-forge
urllib3                   1.25.11                    py_0    conda-forge
validators                0.18.1             pyh9f0ad1d_0    conda-forge
vc                        14.1                 h869be7e_1    conda-forge
vs2015_runtime            14.16.27012          h30e32a0_2    conda-forge
watchdog                  0.10.4           py39hcbf5309_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.36.1             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1            py39hcbf5309_4    conda-forge
win_inet_pton             1.1.0            py39hde42818_1    conda-forge
wincertstore              0.2             py39hde42818_1005    conda-forge
winpty                    0.4.3                         4    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                he774522_0    conda-forge
zeromq                    4.3.3                h0e60522_3    conda-forge
zipp                      3.4.0                      py_0    conda-forge
zlib                      1.2.11            h62dcd97_1010    conda-forge
zstd                      1.4.5                h1f3a1b7_2    conda-forge

Where as this is not working:

# packages in environment at C:\Users\user\Miniconda3\envs\minimal:
#
# Name                    Version                   Build  Channel
abseil-cpp                20200225.2           ha925a31_2    conda-forge
altair                    4.1.0                      py_1    conda-forge
argh                      0.26.2          pyh9f0ad1d_1002    conda-forge
argon2-cffi               20.1.0           py39hb82d6ee_2    conda-forge
arrow-cpp                 2.0.0           py39h96725ad_6_cpu    conda-forge
astor                     0.8.1              pyh9f0ad1d_0    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
aws-c-common              0.4.59               h8ffe710_1    conda-forge
aws-c-event-stream        0.1.6                hb4e73fc_6    conda-forge
aws-checksums             0.1.10               h6f0a1a5_0    conda-forge
aws-sdk-cpp               1.8.70               he2782d2_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.1                      py_0    conda-forge
base58                    2.0.1                      py_0    conda-forge
bleach                    3.2.1              pyh9f0ad1d_0    conda-forge
blinker                   1.4                        py_1    conda-forge
boto3                     1.16.28            pyhd8ed1ab_0    conda-forge
botocore                  1.19.28            pyhd8ed1ab_0    conda-forge
brotli                    1.0.9                ha925a31_3    conda-forge
brotlipy                  0.7.0           py39ha3862ff_1001    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
c-ares                    1.17.1               h8ffe710_0    conda-forge
ca-certificates           2020.11.8            h5b45459_0    conda-forge
cachetools                4.1.1                      py_0    conda-forge
certifi                   2020.11.8        py39hcbf5309_0    conda-forge
cffi                      1.14.4           py39h0878f49_1    conda-forge
chardet                   3.0.4           py39h467e6f4_1008    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cryptography              3.2.1            py39h0878f49_0    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
enum-compat               0.0.3            py39hde42818_2    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
freetype                  2.10.4               h546665d_0    conda-forge
gflags                    2.2.2             ha925a31_1004    conda-forge
gitdb                     4.0.5                      py_0    conda-forge
gitpython                 3.1.11                     py_0    conda-forge
glog                      0.4.0                h0174b99_3    conda-forge
grpc-cpp                  1.33.2               h59b151f_1    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
importlib-metadata        3.1.1              pyhd8ed1ab_0    conda-forge
importlib_metadata        3.1.1                hd8ed1ab_0    conda-forge
intel-openmp              2020.3             h57928b3_311    conda-forge
ipykernel                 5.3.4            py39he1a07ef_1    conda-forge
ipython                   7.19.0           py39h832f523_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.5.1              pyh9f0ad1d_1    conda-forge
jdcal                     1.4.1                      py_0    conda-forge
jedi                      0.17.2           py39hcbf5309_1    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jmespath                  0.10.0             pyh9f0ad1d_0    conda-forge
jpeg                      9d                   h8ffe710_0    conda-forge
jsonschema                3.2.0                      py_2    conda-forge
jupyter_client            6.1.7                      py_0    conda-forge
jupyter_core              4.7.0            py39hcbf5309_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
krb5                      1.17.2               hbae68bd_0    conda-forge
libblas                   3.8.0                    21_mkl    conda-forge
libcblas                  3.8.0                    21_mkl    conda-forge
libcurl                   7.71.1               h4b64cdc_8    conda-forge
liblapack                 3.8.0                    21_mkl    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libprotobuf               3.13.0.1             h200bbdf_0    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libssh2                   1.9.0                hb06d900_5    conda-forge
libthrift                 0.13.0               hdfef310_6    conda-forge
libtiff                   4.1.0                hc10be44_6    conda-forge
libutf8proc               2.6.0                hcb41399_0    conda-forge
lz4-c                     1.9.2                h62dcd97_2    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markupsafe                1.1.1            py39ha3862ff_2    conda-forge
mistune                   0.8.4           py39hb82d6ee_1002    conda-forge
mkl                       2020.4             hb70f87d_311    conda-forge
msys2-conda-epoch         20160418                      1
nbclient                  0.5.1                      py_0    conda-forge
nbconvert                 6.0.7            py39hcbf5309_3    conda-forge
nbformat                  5.0.8                      py_0    conda-forge
nest-asyncio              1.4.3              pyhd8ed1ab_0    conda-forge
notebook                  6.1.5            py39hcbf5309_0    conda-forge
numpy                     1.19.4           py39h6635163_1    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openpyxl                  3.0.5                      py_0    conda-forge
openssl                   1.1.1h               he774522_0    conda-forge
packaging                 20.4               pyh9f0ad1d_0    conda-forge
pandas                    1.1.4            py39h2e25243_0    conda-forge
pandoc                    2.11.2               h8ffe710_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.7.1              pyh9f0ad1d_0    conda-forge
pathtools                 0.1.2                      py_1    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.0.1            py39hbc3ea3a_0    conda-forge
pip                       20.3.1             pyhd8ed1ab_0    conda-forge
prometheus_client         0.9.0              pyhd3deb0d_0    conda-forge
prompt-toolkit            3.0.8              pyha770c72_0    conda-forge
protobuf                  3.13.0.1         py39h415ef7b_1    conda-forge
pyarrow                   2.0.0           py39hf9247be_6_cpu    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydeck                    0.5.0              pyh9f0ad1d_0    conda-forge
pygments                  2.7.2                      py_0    conda-forge
pyopenssl                 20.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.17.3           py39hb82d6ee_1    conda-forge
pysocks                   1.7.1            py39h467e6f4_2    conda-forge
python                    3.9.0           h7840368_5_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.9                      1_cp39    conda-forge
pytz                      2020.4             pyhd8ed1ab_0    conda-forge
pywin32                   228              py39h4cdbadb_0    conda-forge
pywinpty                  0.5.7            py39hde42818_1    conda-forge
pyyaml                    5.3.1            py39ha3862ff_1    conda-forge
pyzmq                     20.0.0           py39h6e08c89_1    conda-forge
re2                       2020.11.01           h0e60522_0    conda-forge
requests                  2.25.0             pyhd3deb0d_0    conda-forge
s3transfer                0.3.3                      py_3    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                49.6.0           py39h467e6f4_2    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
smmap                     3.0.4              pyh9f0ad1d_0    conda-forge
snappy                    1.1.8                ha925a31_3    conda-forge
sqlite                    3.34.0               h8ffe710_0    conda-forge
streamlit                 0.71.0             pyhd8ed1ab_0    conda-forge
terminado                 0.9.1            py39hcbf5309_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
tk                        8.6.10               he774522_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
toolz                     0.11.1                     py_0    conda-forge
tornado                   6.1              py39hb82d6ee_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
tzdata                    2020d                h516909a_0    conda-forge
tzlocal                   2.1                pyh9f0ad1d_0    conda-forge
urllib3                   1.25.11                    py_0    conda-forge
validators                0.18.1             pyh9f0ad1d_0    conda-forge
vc                        14.1                 h869be7e_1    conda-forge
vs2015_runtime            14.16.27012          h30e32a0_2    conda-forge
watchdog                  0.10.4           py39hcbf5309_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.36.0             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1            py39hcbf5309_4    conda-forge
win_inet_pton             1.1.0            py39hde42818_1    conda-forge
wincertstore              0.2             py39hde42818_1005    conda-forge
winpty                    0.4.3                         4    conda-forge
xlrd                      1.2.0              pyh9f0ad1d_1    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                he774522_0    conda-forge
zeromq                    4.3.3                h0e60522_3    conda-forge
zipp                      3.4.0                      py_0    conda-forge
zlib                      1.2.11            h62dcd97_1010    conda-forge
zstd                      1.4.5                h1f3a1b7_2    conda-forge

Maybe just the different streamlit version?

edit: yes, conda update streamlit solves. There seems to have been a recent update

1 Like

Hey @domsl,

I’m glad you got it working. For future users who come to this page, let me know if this is correct:

  • you updated Streamlit to the newest version
  • you updated conda to its newest version

And then Streamlit started working as expected?

Thanks!
Marisa

Hi,

I only updated the streamlit package conda update streamlit, it seems to have resolved it.

1 Like