Python3 flask ModuleNotFoundError: No module named 'blurhash' error - python-3.x

I am new to Python. Recently, I am using Python 3.9.12 and Flask 2.1.2 to work on a project. When I run flask run, it throw me an error: ModuleNotFoundError: No module named 'blurhash'.However I have installed blurhash by pip3 install blurhash. When I do pip3 list, it shows:
Package Version
------------------ ---------
blurhash 1.1.4
certifi 2021.10.8
cffi 1.15.0
click 8.1.3
distlib 0.3.4
filelock 3.6.0
Flask 2.1.2
importlib-metadata 4.11.3
itsdangerous 2.1.2
Jinja2 3.1.2
MarkupSafe 2.1.1
Pillow 9.1.0
pip 22.0.4
pipenv 2022.5.2
platformdirs 2.5.2
pycparser 2.21
setuptools 60.10.0
six 1.16.0
virtualenv 20.14.1
virtualenv-clone 0.5.7
Werkzeug 2.1.2
wheel 0.37.1
zipp 3.8.0
Any ideas about this? Many Thanks!

Related

How to delete all packages from my ubuntu terminal in windows 10?

I have all these packages and I would like to remove them (removing pip and apache-airflow is my priority)
alembic 1.8.1
anyio 3.6.2
apache-airflow 2.4.2
apache-airflow-providers-common-sql 1.2.0
apache-airflow-providers-ftp 3.1.0
apache-airflow-providers-http 4.0.0
apache-airflow-providers-imap 3.0.0
apache-airflow-providers-sqlite 3.2.1
apispec 3.3.2
argcomplete 2.0.0
attrs 22.1.0
Babel 2.11.0
blinker 1.4
cachelib 0.9.0
cattrs 22.2.0
certifi 2022.9.24
charset-normalizer 2.1.1
pendulum 2.1.2
pip 22.0.2
pluggy 1.0.0
prison 0.2.1
psutil 5.9.4
Pygments 2.13.0
PyGObject 3.42.1
PyJWT 2.3.0
pyparsing 2.4.7
pyrsistent 0.19.2
python-apt 2.3.0+ubuntu2.1
python-daemon 2.3.2
python-dateutil 2.8.2
python-nvd3 0.15.0
python-slugify 6.1.2
pytz 2022.6
pytzdata 2020.1
PyYAML 5.4.1
requests 2.28.1
requests-toolbelt 0.10.1
rfc3986 1.5.0
uc-micro-py 1.0.1
ufw 0.36.1
Download ubuntu console for windows 10 and install pip and apache airflow without creating an environment (my mistake)
I run pip freeze --user | xargs pip uninstall -y to remove all and I get this error:
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.10/shutil.py", line 815, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/usr/local/bin/alembic' -> '/tmp/pip-uninstall- lj7qg0bv/alembic'
If you're sure you really need to uninstall packages installed under /usr/local/ use superuser privileges:
pip freeze --user | xargs sudo pip uninstall -y

Docker-compose and extended Dokerfile: External Providers not found

I've deployed apache airflow using docker-compose using an extended image to include requirements. I can see in the airflow UI that the snowflake providers package was installed (apache-airflow-providers-snowflake), but for some reason, I'm getting a DAG import error:
from airflow.providers.snowflake.hooks.snowflake import SnowflakeHook
ModuleNotFoundError: No module named 'airflow.providers.snowflake'
I've logged into the docker webserver, used the airflow user, and successfully imported this package.
Dockerfile:
FROM apache/airflow:2.3.0-python3.9
USER root
COPY requirements.txt .
RUN apt-get update && \
apt-get install -y apt-utils
USER airflow
RUN pip3 install --no-cache-dir -r requirements.txt
see below:
[philip#ip-10-5-51-10 airflow_2]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0516db2653a0 airflow_2_airflow-webserver "/usr/bin/dumb-init …" About an hour ago Up 52 minutes (healthy) 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp airflow_2_airflow-webserver_1
36142cc09a6b airflow_2_airflow-scheduler "/usr/bin/dumb-init …" About an hour ago Up 52 minutes (healthy) 8080/tcp airflow_2_airflow-scheduler_1
c090e86e9279 airflow_2_airflow-triggerer "/usr/bin/dumb-init …" About an hour ago Up 52 minutes (healthy) 8080/tcp airflow_2_airflow-triggerer_1
ade8996d759f airflow_2_airflow-worker "/usr/bin/dumb-init …" About an hour ago Up 52 minutes (healthy) 8080/tcp airflow_2_airflow-worker_1
8915e4fb4ffe airflow_2_flower "/usr/bin/dumb-init …" About an hour ago Up 52 minutes (healthy) 0.0.0.0:5555->5555/tcp, :::5555->5555/tcp, 8080/tcp airflow_2_flower_1
353f2fa5552f postgres:13 "docker-entrypoint.s…" 4 hours ago Up 52 minutes (healthy) 5432/tcp airflow_2_postgres_1
1bafa42ece77 redis:latest "docker-entrypoint.s…" 4 hours ago Up 52 minutes (healthy) 6379/tcp airflow_2_redis_1
408ad15538ce denny/monitor-docker-slack:latest "/monitor-docker-sla…" 12 months ago Up 3 days monitor-docker-slack
[philip#ip-10-5-51-10 airflow_2]$ docker exec -u 0 -it airflow_2_airflow-webserver_1 bash
root#0516db2653a0:/opt/airflow# su - airflow
airflow#0516db2653a0:~$ pip list
Package Version
---------------------------------------- ------------
adal 1.2.7
alembic 1.7.7
amqp 5.1.1
anyio 3.5.0
apache-airflow 2.3.0
apache-airflow-providers-amazon 3.3.0
apache-airflow-providers-celery 2.1.4
apache-airflow-providers-cncf-kubernetes 4.0.1
apache-airflow-providers-docker 2.6.0
apache-airflow-providers-elasticsearch 3.0.3
apache-airflow-providers-ftp 2.1.2
apache-airflow-providers-google 6.8.0
apache-airflow-providers-grpc 2.0.4
apache-airflow-providers-hashicorp 2.2.0
apache-airflow-providers-http 2.1.2
apache-airflow-providers-imap 2.2.3
apache-airflow-providers-microsoft-azure 3.8.0
apache-airflow-providers-mysql 2.2.3
apache-airflow-providers-odbc 2.0.4
apache-airflow-providers-postgres 4.1.0
apache-airflow-providers-redis 2.0.4
apache-airflow-providers-sendgrid 2.0.4
apache-airflow-providers-sftp 2.6.0
apache-airflow-providers-slack 4.2.3
apache-airflow-providers-snowflake 2.6.0
apache-airflow-providers-sqlite 2.1.3
apache-airflow-providers-ssh 2.4.3
apispec 3.3.2
argcomplete 1.12.2
asn1crypto 1.4.0
attrs 20.3.0
Authlib 1.0.1
azure-batch 12.0.0
azure-common 1.1.28
azure-core 1.23.1
azure-cosmos 4.2.0
azure-datalake-store 0.0.52
azure-identity 1.9.0
azure-keyvault-secrets 4.4.0
azure-kusto-data 0.0.45
azure-mgmt-containerinstance 1.5.0
azure-mgmt-core 1.3.0
azure-mgmt-datafactory 1.1.0
azure-mgmt-datalake-nspkg 3.0.1
azure-mgmt-datalake-store 0.5.0
azure-mgmt-nspkg 3.0.2
azure-mgmt-resource 21.0.0
azure-nspkg 3.0.2
azure-storage-blob 12.8.1
azure-storage-common 2.1.0
azure-storage-file 2.1.0
Babel 2.9.0
bcrypt 3.2.0
beautifulsoup4 4.11.1
billiard 3.6.4.0
blinker 1.4
boto3 1.16.59
botocore 1.19.59
cached-property 1.5.2
cachelib 0.6.0
cachetools 4.2.2
catboost 0.25.1
cattrs 1.10.0
celery 5.2.6
certifi 2020.12.5
cffi 1.14.4
chardet 3.0.4
charset-normalizer 2.0.12
click 8.1.2
click-didyoumean 0.3.0
click-plugins 1.1.1
click-repl 0.2.0
clickclick 20.10.2
cloudpickle 2.0.0
colorama 0.4.4
colorlog 4.0.2
commonmark 0.9.1
configparser 3.5.3
connexion 2.13.0
cron-descriptor 1.2.24
croniter 0.3.37
cryptography 3.3.1
cycler 0.11.0
dask 2022.2.0
db-dtypes 1.0.0
decorator 5.1.1
defusedxml 0.6.0
Deprecated 1.2.13
dill 0.3.3
distlib 0.3.4
distributed 2022.2.0
dnspython 2.1.0
docker 5.0.3
docutils 0.16
elasticsearch 7.13.4
elasticsearch-dbapi 0.2.9
elasticsearch-dsl 7.4.0
email-validator 1.1.2
eventlet 0.33.0
filelock 3.6.0
Flask 1.1.2
Flask-Admin 1.5.4
Flask-AppBuilder 3.4.5
Flask-Babel 1.0.0
Flask-Caching 1.10.1
Flask-JWT-Extended 3.25.0
Flask-Login 0.4.1
Flask-OpenID 1.2.5
Flask-Session 0.4.0
Flask-SQLAlchemy 2.4.4
flask-swagger 0.2.13
Flask-WTF 0.14.3
flower 1.0.0
fonttools 4.33.3
fsspec 2022.3.0
funcsigs 1.0.2
future 0.16.0
gevent 21.12.0
google-ads 14.0.0
google-api-core 2.7.2
google-api-python-client 1.12.11
google-auth 2.6.6
google-auth-httplib2 0.1.0
google-auth-oauthlib 0.5.1
google-cloud-aiplatform 1.12.1
google-cloud-appengine-logging 1.1.1
google-cloud-audit-log 0.2.0
google-cloud-automl 2.7.2
google-cloud-bigquery 2.34.3
google-cloud-bigquery-datatransfer 3.6.1
google-cloud-bigquery-storage 2.13.1
google-cloud-bigtable 1.7.1
google-cloud-build 3.8.1
google-cloud-container 1.0.2
google-cloud-core 2.3.0
google-cloud-datacatalog 3.7.1
google-cloud-dataplex 0.2.1
google-cloud-dataproc 4.0.2
google-cloud-dataproc-metastore 1.5.0
google-cloud-dlp 1.0.1
google-cloud-kms 2.11.1
google-cloud-language 1.3.1
google-cloud-logging 3.0.0
google-cloud-memcache 1.3.1
google-cloud-monitoring 2.9.1
google-cloud-orchestration-airflow 1.3.1
google-cloud-os-login 2.6.1
google-cloud-pubsub 2.12.0
google-cloud-redis 2.8.0
google-cloud-resource-manager 1.4.1
google-cloud-secret-manager 1.0.1
google-cloud-spanner 1.19.2
google-cloud-speech 1.3.3
google-cloud-storage 1.44.0
google-cloud-tasks 2.8.1
google-cloud-texttospeech 1.0.2
google-cloud-translate 1.7.1
google-cloud-videointelligence 1.16.2
google-cloud-vision 1.0.1
google-cloud-workflows 1.6.1
google-crc32c 1.3.0
google-resumable-media 2.3.2
googleapis-common-protos 1.56.0
graphviz 0.16
greenlet 1.1.2
grpc-google-iam-v1 0.12.4
grpcio 1.44.0
grpcio-gcp 0.2.2
grpcio-status 1.44.0
gunicorn 20.1.0
h11 0.12.0
HeapDict 1.0.1
httpcore 0.14.7
httplib2 0.19.1
httpx 0.22.0
humanize 4.0.0
hvac 0.11.2
idna 2.10
importlib-metadata 3.10.1
importlib-resources 5.7.1
inflection 0.5.1
iso8601 0.1.13
isodate 0.6.0
itsdangerous 1.1.0
Jinja2 2.10.3
jmespath 0.10.0
joblib 1.0.0
json-merge-patch 0.2
jsonpath-ng 1.5.3
jsonschema 3.2.0
kiwisolver 1.4.2
kombu 5.2.4
kubernetes 23.3.0
lazy-object-proxy 1.4.3
ldap3 2.9.1
locket 1.0.0
lockfile 0.12.2
looker-sdk 22.4.0
lxml 4.8.0
Mako 1.1.4
Markdown 3.3.4
MarkupSafe 1.1.1
marshmallow 3.15.0
marshmallow-enum 1.5.1
marshmallow-oneofschema 3.0.1
marshmallow-sqlalchemy 0.26.1
matplotlib 3.5.2
msal 1.17.0
msal-extensions 0.3.1
msgpack 1.0.3
msrest 0.6.21
msrestazure 0.6.4
mypy-boto3-rds 1.22.0.post1
mypy-boto3-redshift-data 1.22.0.post1
mysql-connector-python 8.0.29
mysqlclient 2.1.0
natsort 7.1.0
nox 2020.12.31
numpy 1.19.5
oauthlib 3.1.0
openapi-spec-validator 0.2.9
oscrypto 1.2.1
packaging 21.3
pandas 0.25.3
pandas-gbq 0.17.4
paramiko 2.10.4
partd 1.2.0
pathspec 0.9.0
pendulum 2.1.2
Pillow 9.1.0
pip 22.0.4
platformdirs 2.5.2
plotly 5.7.0
pluggy 1.0.0
ply 3.11
portalocker 2.4.0
prison 0.2.1
prometheus-client 0.14.1
prompt-toolkit 3.0.29
proto-plus 1.18.1
protobuf 3.20.1
psutil 5.8.0
psycopg2-binary 2.9.3
py 1.11.0
pyarrow 6.0.1
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.20
pycryptodomex 3.9.9
pydata-google-auth 1.4.0
Pygments 2.7.4
PyJWT 1.7.1
PyNaCl 1.5.0
pyodbc 4.0.32
pyOpenSSL 19.1.0
pyparsing 2.4.7
pyrsistent 0.17.3
pysftp 0.2.9
python-daemon 2.3.0
python-dateutil 2.8.1
python-editor 1.0.4
python-http-client 3.3.7
python-ldap 3.4.0
python-nvd3 0.15.0
python-slugify 6.1.1
python3-openid 3.2.0
pytz 2020.5
pytzdata 2020.1
PyYAML 5.4.1
redis 3.5.3
redshift-connector 2.0.906
requests 2.27.1
requests-oauthlib 1.3.1
rfc3986 1.5.0
rich 12.3.0
rsa 4.8
s3transfer 0.3.4
scikit-learn 0.24.1
scipy 1.7.3
scramp 1.4.1
sendgrid 6.9.7
setproctitle 1.2.1
setuptools 57.5.0
six 1.15.0
sklearn 0.0
slack-sdk 3.15.2
slackclient 1.0.7
sniffio 1.2.0
snowflake-connector-python 2.7.7
snowflake-sqlalchemy 1.3.4
sortedcontainers 2.4.0
soupsieve 2.3.2.post1
SQLAlchemy 1.4.9
sqlalchemy-bigquery 1.4.3
SQLAlchemy-JSONField 1.0.0
sqlalchemy-redshift 0.8.9
SQLAlchemy-Utils 0.38.2
sqlparse 0.4.1
sshtunnel 0.4.0
starkbank-ecdsa 2.0.3
statsd 3.3.0
swagger-ui-bundle 0.0.8
tabulate 0.8.7
tblib 1.7.0
tenacity 8.0.1
termcolor 1.1.0
text-unidecode 1.3
threadpoolctl 3.1.0
thrift 0.13.0
toolz 0.11.2
tornado 6.1
typing_extensions 4.2.0
tzlocal 1.5.1
unicodecsv 0.14.1
uritemplate 3.0.1
urllib3 1.25.11
vine 5.0.0
virtualenv 20.14.1
watchtower 2.0.1
wcwidth 0.2.5
websocket-client 0.59.0
Werkzeug 1.0.1
wheel 0.37.1
wrapt 1.14.0
WTForms 2.3.3
zict 2.1.0
zipp 3.4.0
zope.deprecation 4.4.0
zope.event 4.5.0
zope.interface 5.4.0
HI I think this provider is not installed can you follow some steps to confirm if this is installed
first open cmd and write docker ps
Then copy the cluster id of the webserver which will be like in this picture cluster id will be like starting from 39d11(this will change your cluster id will be different )
after copying the cluster id can you go write this in cmd type
docker exec -it cluster-id /bin/bash
now when you are in the airflow cluster go to the airflow /dag folder and now type pip list and you can see there is no provider install and you have to install it here again thanks

Importing the numpy c-extensions failed in MacOS

Importing the numpy c-extensions failed
I am trying to use numpy in terminal, when i imported it it returned an error.But whe I import numpy in pytharm Python Console,it worked well.I have python 2.7.10 and 3.7.5,python 3.7.5 was used in pytharm. I uninstalled numpy on all versions of python and reinstalled it on python 3.7.5 only, but it returned the same error. I reinstall packages via the command line by entering:
python3 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
but it returned the same error too.I guess it's a multi-environment problem.
Tried uninstall and install numpy and setuptools like this:
pip uninstall -y numpy
pip uninstall -y setuptools
pip install setuptools
pip install numpy
but it returned the same error too.
My python3 pip list:
absl-py 0.9.0
aiodns 2.0.0
aiohttp 3.5.4
appnope 0.1.0
astor 0.8.1
async-timeout 3.0.1
attrs 19.1.0
backcall 0.1.0
beautifulsoup4 4.5.3
bleach 3.1.0
browsermob-proxy 0.8.0
bs4 0.0.1
cchardet 2.1.4
certifi 2019.3.9
cffi 1.12.3
chardet 3.0.4
cssselect 1.0.3
cycler 0.10.0
decorator 4.4.1
defusedxml 0.6.0
entrypoints 0.3
fake-useragent 0.1.11
gast 0.3.2
google-pasta 0.1.8
grpcio 1.26.0
h5py 2.10.0
idna 2.6
importlib-metadata 1.3.0
ipykernel 5.1.3
ipython 5.4.1
ipython-genutils 0.2.0
ipywidgets 7.5.1
jedi 0.15.2
Jinja2 2.10.3
joblib 0.14.1
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 5.3.4
jupyter-console 5.2.0
jupyter-core 4.6.1
Keras 2.2.4
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
kiwisolver 1.1.0
lxml 4.3.3
Markdown 3.1.1
MarkupSafe 1.1.1
matplotlib 3.1.2
mistune 0.8.4
more-itertools 8.0.2
mpmath 1.1.0
multidict 4.5.2
nbconvert 5.6.1
nbformat 4.4.0
nose 1.3.7
notebook 6.0.2
ntplib 0.3.3
numpy 1.17.4
opencv-python 4.1.2.30
pandas 0.25.3
pandocfilters 1.4.2
parso 0.5.2
pexpect 4.7.0
pickleshare 0.7.5
Pillow 6.2.1
pip 19.3.1
prometheus-client 0.7.1
prompt-toolkit 1.0.18
protobuf 3.11.2
ptyprocess 0.6.0
pycares 3.0.0
pycparser 2.19
pycrypto 2.6.1
Pygments 2.5.2
PyMySQL 0.9.3
pyparsing 2.4.5
pyquery 1.4.0
pyrsistent 0.15.6
python-dateutil 2.8.1
pytz 2019.3
PyYAML 5.2
pyzmq 18.1.1
qtconsole 4.6.0
redis 3.3.11
requests 2.18.4
scikit-learn 0.22
scipy 1.4.1
selenium 3.11.0
Send2Trash 1.5.0
setuptools 42.0.2
simplegeneric 0.8.1
six 1.13.0
sklearn 0.0
soupsieve 1.9.1
splinter 0.13.0
sympy 1.5
tensorboard 1.14.0
tensorflow 1.14.0
tensorflow-estimator 1.14.0
termcolor 1.1.0
terminado 0.8.3
testpath 0.4.4
tornado 6.0.3
traitlets 4.3.3
urllib3 1.22
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.16.0
wheel 0.33.6
widgetsnbextension 3.5.1
wrapcache 1.0.8
wrapt 1.11.1
xvfbwrapper 0.2.9
yarl 1.3.0
zipp 0.6.0
How can I solve this problem?
Reproducing code example:
import numpy
Error message:
Blockquote
Python 3.7.5 (default, Nov 1 2019, 02:16:32) [Clang 11.0.0
(clang-1100.0.33.8)] on darwin Type "help", "copyright", "credits" or
"license" for more information.
import numpy Traceback (most recent call last): File "/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/init.py",
line 17, in
from . import multiarray File "/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/multiarray.py",
line 14, in
from . import overrides File "/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/overrides.py",
line 7, in
from numpy.core._multiarray_umath import ( ImportError: dlopen(/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so,
2): Symbol not found: ___addtf3 Referenced from:
/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib Expected in: /usr/lib/libSystem.B.dylib in
/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File
"/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/init.py",
line 142, in
from . import core File "/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/init.py",
line 47, in
raise ImportError(msg) ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "/usr/local/opt/python/bin/python3.7",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.17.4" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
If you're working with a numpy git repository, try git clean -xdf (removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was:
dlopen(/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so,
2): Symbol not found: ___addtf3 Referenced from:
/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib Expected in: /usr/lib/libSystem.B.dylib in
/Users/chuck/Library/Python/3.7/lib/python/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
I solved this issue like this:
bogon:bin chuck$ brew unlink python3
Unlinking /usr/local/Cellar/python/3.7.5... 0 symlinks removed
bogon:bin chuck$ brew link python3
Linking /usr/local/Cellar/python/3.7.5...
Error: Could not symlink bin/easy_install-3.7
Target /usr/local/bin/easy_install-3.7
already exists. You may want to remove it:
rm '/usr/local/bin/easy_install-3.7'
To force the link and overwrite all conflicting files:
brew link --overwrite python
To list all files that would be deleted:
brew link --overwrite --dry-run python
bogon:bin chuck$ brew link --overwrite python3
Linking /usr/local/Cellar/python/3.7.5... 24 symlinks created

Anaconda: Pandas Datareader - Module not found

Solution: was using jupyter notebook on windows, so never able to connect to the env/kernel. Loaded up the anaconda environment in pycharm and everything works now
I'm using Anaconda and the jupyter notebook but I'm constantly getting an error trying to import pandas datareader and keep getting the ModuleNotFoundError for some reason.
I tried to reinstall pandas-datareader several times with several install methods (regular, via site link, pip install) while being in the active environment.
I tried downgrading my Python version down to 3.6.0 but getting the same error for all of them.
I also checked the folder in the environment at /Lib/site-packages and both folders (pandas_datareader and pandas_datareader-0.5.0.dist-info) are located there.
Don't really know where to go from here. Any help is appreciated
import datetime as dt
import matplotlib.pyplot as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-1fbb66132a8a> in <module>()
3 from matplotlib import style
4 import pandas as pd
----> 5 import pandas_datareader.data as web
ModuleNotFoundError: No module named 'pandas_datareader'
# packages in environment at C:\Users\....\Anaconda3\envs\finance:
#
asn1crypto 0.24.0 py36_0
beautifulsoup4 4.6.0 py36hd4cc5e8_1
ca-certificates 2017.08.26 h94faf87_0 anaconda
certifi 2017.11.5 py36hb8ac631_0 anaconda
cffi 1.11.4 py36hfa6e2cd_0
chardet 3.0.4 py36h420ce6e_1
cryptography 2.1.4 py36he1d7878_0
cycler 0.10.0 py36h009560c_0
freetype 2.8 vc14h17c9bdf_0 [vc14] anaconda
icc_rt 2017.0.4 h97af966_0
icu 58.2 vc14hc45fdbb_0 [vc14] anaconda
idna 2.6 py36h148d497_1
intel-openmp 2018.0.0 hd92c6cd_8
jpeg 9b vc14h4d7706e_1 [vc14] anaconda
libpng 1.6.32 vc14h5163883_3 [vc14] anaconda
matplotlib 2.1.1 py36h2062329_0
mkl 2018.0.1 h2108138_4
numpy 1.14.0 py36h4a99626_0
openssl 1.0.2n h74b6da3_0 anaconda
pandas 0.22.0 py36h6538335_0
pandas-datareader 0.5.0 py36_0 anaconda
pip 9.0.1 py36h226ae91_4
pycparser 2.18 py36hd053e01_1
pyopenssl 17.5.0 py36h5b7d817_0
pyparsing 2.2.0 py36h785a196_1
pyqt 5.6.0 py36hb5ed885_5
pysocks 1.6.7 py36h698d350_1
python 3.6.4 h6538335_1
python-dateutil 2.6.1 py36h509ddcb_1
pytz 2017.3 py36h1d3fa6b_0
qt 5.6.2 vc14h6f8c307_12 [vc14] anaconda
requests 2.18.4 py36h4371aae_1
requests-file 1.4.1 py36_0
requests-ftp 0.3.1 py36_0
scikit-learn 0.19.1 py36h53aea1b_0
scipy 1.0.0 py36h1260518_0
setuptools 38.4.0 py36_0
sip 4.18.1 py36h9c25514_2
six 1.11.0 py36h4db2310_1
sqlite 3.20.1 vc14h7ce8c62_1 [vc14] anaconda
tornado 4.5.3 py36_0
urllib3 1.22 py36h276f60a_0
vc 14 h0510ff6_3
vs2015_runtime 14.0.25123 3
wheel 0.30.0 py36h6c3ec14_1
win_inet_pton 1.0.1 py36he67d7fd_1
wincertstore 0.2 py36h7fe50ca_0
zlib 1.2.11 vc14h1cdd9ab_1 [vc14] anaconda
I am guessing that /Lib/site-packages is not in your PYTHONPATH. See:
https://leemendelowitz.github.io/blog/how-does-python-find-packages.html
"sys.path is populated using the current working directory, followed by directories listed in your PYTHONPATH environment variable, followed by installation-dependent default paths, which are controlled by the site module."
TLDR: Make sure that /Lib/site-packages/ is in your PYTHONPATH.

Pandas Datareader - Module not found after installation

I am trying to install & use Pandas-Datareader, but when after I have installed it, I receive a ModuleNotFoundError when I try and import it.
I am using Jupyter Notebook installed using Anaconda - so use the conda installer to install new packages.
After typing source activate ipykernel_py3 to activate the Python3 kernel environment, I have used conda install -c anaconda pandas-datareader=0.4.0 to install Pandas-Datareader.
If I try conda list, then I get the output below - which shows Pandas_Datareader installed.
But if I try the command ```import pandas_datareader as pdr`` (as found in documentation here), then I get an error message
ModuleNotFoundError: No module named 'pandas_datareader'
(This happens in both the Jupyter notebook and in the Python3 interpreter running in this environment.
Can anybody help?
Many thanks
** Conda List output:**
# packages in environment at /Users/Chris/anaconda3/envs/ipykernel_py3:
#
appnope 0.1.0 py36_0
beautifulsoup4 4.5.3 py36_0
cycler 0.10.0 py36_0
decorator 4.0.11 py36_0
freetype 2.5.5 2
icu 54.1 0
ipykernel 4.6.1 py36_0
ipython 6.0.0 py36_0
ipython_genutils 0.2.0 py36_0
jupyter_client 5.0.1 py36_0
jupyter_core 4.3.0 py36_0
libpng 1.6.27 0
matplotlib 2.0.2 np112py36_0
mkl 2017.0.1 0
numpy 1.12.1 py36_0
openssl 1.0.2k 1
pandas 0.20.1 np112py36_0
pandas-datareader 0.4.0 py36_0 anaconda
path.py 10.3.1 py36_0
pexpect 4.2.1 py36_0
pickleshare 0.7.4 py36_0
pip 9.0.1 py36_1
prompt_toolkit 1.0.14 py36_0
ptyprocess 0.5.1 py36_0
pygments 2.2.0 py36_0
pyparsing 2.1.4 py36_0
pyqt 5.6.0 py36_2
python 3.6.1 0
python-dateutil 2.6.0 py36_0
pytz 2017.2 py36_0
pyzmq 16.0.2 py36_0
qt 5.6.2 2
readline 6.2 2
requests 2.14.2 py36_0 anaconda
requests-file 1.4.1 py36_0 anaconda
requests-ftp 0.3.1 py36_0 anaconda
scipy 0.19.0 np112py36_0
seaborn 0.7.1 py36_0
setuptools 27.2.0 py36_0
simplegeneric 0.8.1 py36_1
sip 4.18 py36_0
six 1.10.0 py36_0
sqlite 3.13.0 0
tk 8.5.18 0
tornado 4.5.1 py36_0
traitlets 4.3.2 py36_0
wcwidth 0.1.7 py36_0
wheel 0.29.0 py36_0
xz 5.2.2 1
zlib 1.2.8 3
Are you running the notebook in the ipykernel_py3 environment?
source activate ipykernel_py3
ipython notebook
Just type
pip install pandas_datareader in your anaconda prompt
and try running it again in jupyter.

Resources