Another import error! This time a bit more obscure!
In my virtual env I have python 3.7, streamlit 0.57.3 and awesom-streamlit 20191018.1 versions installed. When I import awesome_streamlit I get an error about no awesome_streamlit.database found?
My versions of things:
$/> python --version
Python 3.7.7
$/> pip freeze | grep stream
awesome-streamlit==20191018.1
streamlit==0.57.3
My import error looks like this:
$/> python
Python 3.7.7 (default, Mar 10 2020, 15:16:38)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import streamlit
>>> import awesome_streamlit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nherriot/virtualenv/scraping-competitors-3.7/lib/python3.7/site-packages/awesome_streamlit/__init__.py", line 2, in <module>
import awesome_streamlit.database as database
ModuleNotFoundError: No module named 'awesome_streamlit.database'
>>> import awesome_streamlit as ast
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nherriot/virtualenv/scraping-competitors-3.7/lib/python3.7/site-packages/awesome_streamlit/__init__.py", line 2, in <module>
import awesome_streamlit.database as database
ModuleNotFoundError: No module named 'awesome_streamlit.database'
It seems that the site-packages directory has no python files for the package awesome_streamlit ?? I’ve tried uninstalling and reinstalling even with no-cache like this:
$/> pip --no-cache-dir install awesome-streamlit
Collecting awesome-streamlit
Downloading awesome-streamlit-20191018.1.tar.gz (2.0 kB)
Requirement already satisfied: streamlit>=0.47.4 in /home/nherriot/virtualenv/scraping-competitors/lib/python3.7/site-packages (from awesome-streamlit) (0.59.0)
Requirement already satisfied: click>=7.0 in /home/nherriot/virtualenv/scraping-competitors/lib/python3.7/site-packages (from streamlit>=0.47.4->awesome-streamlit) (7.1.2)
Requirement already satisfied: tzlocal in /home/nherriot/virtualenv/scraping-competitors/lib/python3.7/site-packages (from streamlit>=0.47.4->awesome-streamlit) (2.0.0)
Requirement already satisfied: pandas>=0.21.0 in /home/nherriot/virtualenv/scraping-competitors/lib/python3.7/site-packages (from streamlit>=0.47.4->awesome-streamlit) (1.0.3)
...
...
Requirement already satisfied: webencodings in /home/nherriot/virtualenv/scraping-competitors/lib/python3.7/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.0.0->pydeck>=0.1.dev5->streamlit>=0.47.4->awesome-streamlit) (0.5.1)
Building wheels for collected packages: awesome-streamlit
Building wheel for awesome-streamlit (setup.py) ... done
Created wheel for awesome-streamlit: filename=awesome_streamlit-20191018.1-py3-none-any.whl size=2159 sha256=57719f4320b4d87095e72d25d24bc30aaafd83239a9ae008a0b9af3f4cc4afae
Stored in directory: /tmp/pip-ephem-wheel-cache-ceihgph2/wheels/5b/0a/2c/1f0c6b1eec4e57436d480ce91b1e225174720f3ede552767a8
Successfully built awesome-streamlit
Installing collected packages: awesome-streamlit
Successfully installed awesome-streamlit-20191018.1
However, when i go to my site-packages it’s empty of python files???
Any help would be great on this - I’m pulling my hair out!!!
~/virtualenv/scraping-competitors/lib/python3.7/site-packages$ cd awesome_streamlit
~/virtualenv/scraping-competitors/lib/python3.7/site-packages/awesome_streamlit$ ls -la
total 24
drwxrwxr-x 3 nherriot nherriot 4096 May 7 17:12 .
drwxrwxr-x 156 nherriot nherriot 12288 May 7 17:12 ..
-rw-rw-r-- 1 nherriot nherriot 309 May 7 17:12 __init__.py
drwxrwxr-x 2 nherriot nherriot 4096 May 7 17:12 __pycache__
I guess this explains why there is no database module!? But not why pip does not install it correctly?
Kind regards, Nicholas.