I am working on a plant leaf detection model using imageAI library. when I create an instance of the model the following error occurs. I can not understand the error.
this is my code:
from imageai.Detection import ObjectDetection
detector = ObjectDetection()
Error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-6-3bc804fbfef2> in <module>()
1 from imageai.Detection import ObjectDetection
----> 2 detector = ObjectDetection()
/usr/local/lib/python3.6/dist-packages/imageai/Detection/__init__.py in __init__(self)
86 self.__yolo_model_image_size = (416, 416)
87 self.__yolo_boxes, self.__yolo_scores, self.__yolo_classes = "", "", ""
---> 88 self.sess = K.get_session()
89
90 # Unique instance variables for TinyYOLOv3.
AttributeError: module 'keras.backend' has no attribute 'get_session'
you have to use older version of keras and tensorflow.
try this
pip3 install tensorflow==1.13.1
pip3 install keras==2.2.4
or you can install tensorflow 1.14 or 1.15.1
follow this versions..
Package Version
----------------------- ---------
absl-py 0.15.0
astunparse 1.6.3
cached-property 1.5.2
cachetools 4.2.4
certifi 2021.10.8
charset-normalizer 2.0.7
cycler 0.10.0
flatbuffers 1.12
gast 0.3.3
google-auth 2.3.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
grpcio 1.32.0
h5py 2.10.0
idna 3.3
imageai 2.1.6
importlib-metadata 4.8.1
Keras 2.4.3
Keras-Preprocessing 1.1.2
keras-resnet 0.2.0
kiwisolver 1.3.2
Markdown 3.3.4
matplotlib 3.3.2
numpy 1.19.3
oauthlib 3.1.1
opencv-python 4.5.3.56
opt-einsum 3.3.0
Pillow 7.0.0
pip 21.2.4
protobuf 3.19.0rc1
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyparsing 2.4.7
python-dateutil 2.8.2
PyYAML 6.0
requests 2.26.0
requests-oauthlib 1.3.0
rsa 4.7.2
scipy 1.4.1
setuptools 58.0.4
six 1.15.0
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
tensorflow 2.4.0
tensorflow-estimator 2.4.0
termcolor 1.1.0
typing-extensions 3.7.4.3
urllib3 1.26.7
Werkzeug 2.0.2
wheel 0.37.0
wincertstore 0.2
wrapt 1.12.1
zipp 3.6.0
Related
When I run the pip install in the new conda env:
(base) brando9~ $ pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.9.1+cu111 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2)
ERROR: No matching distribution found for torch==1.9.1+cu111
the other env with that pytorch version:
(metalearning3.9) [pzy2#vision-submit ~]$ pip list
Package Version Location
---------------------------------- -------------------- ------------------
absl-py 1.0.0
aiohttp 3.8.3
aiosignal 1.3.1
alabaster 0.7.12
anaconda-client 1.9.0
anaconda-project 0.10.1
antlr4-python3-runtime 4.8
anyio 2.2.0
appdirs 1.4.4
argcomplete 2.0.0
argh 0.26.2
argon2-cffi 20.1.0
arrow 0.13.1
asn1crypto 1.4.0
astroid 2.6.6
astropy 4.3.1
asttokens 2.0.7
astunparse 1.6.3
async-generator 1.10
async-timeout 4.0.2
atomicwrites 1.4.0
attrs 21.2.0
autopep8 1.5.7
Babel 2.9.1
backcall 0.2.0
backports.shutil-get-terminal-size 1.0.0
beautifulsoup4 4.10.0
binaryornot 0.4.4
bitarray 2.3.0
bkcharts 0.2
black 19.10b0
bleach 4.0.0
bokeh 2.4.1
boto 2.49.0
Bottleneck 1.3.2
brotlipy 0.7.0
cached-property 1.5.2
cachetools 5.0.0
certifi 2021.10.8
cffi 1.14.6
chardet 4.0.0
charset-normalizer 2.0.4
cherry-rl 0.1.4
click 8.0.3
cloudpickle 2.0.0
clyent 1.2.2
colorama 0.4.4
conda 4.12.0
conda-content-trust 0+unknown
conda-pack 0.6.0
conda-package-handling 1.8.0
conda-token 0.3.0
configparser 5.3.0
contextlib2 0.6.0.post1
cookiecutter 1.7.2
crc32c 2.3
crcmod 1.7
cryptography 3.4.8
cycler 0.10.0
Cython 0.29.24
cytoolz 0.11.0
daal4py 2021.3.0
dask 2021.10.0
debugpy 1.4.1
decorator 5.1.0
defusedxml 0.7.1
diff-match-patch 20200713
dill 0.3.4
distributed 2021.10.0
docker-pycreds 0.4.0
docutils 0.17.1
entrypoints 0.3
et-xmlfile 1.1.0
executing 0.9.1
fairseq 0.12.2 /home/pzy2/fairseq
fastcache 1.1.0
fastcluster 1.2.6
fasteners 0.17.3
filelock 3.3.1
flake8 3.9.2
Flask 1.1.2
flatbuffers 2.0.7
fonttools 4.25.0
frozenlist 1.3.0
fsspec 2021.8.1
gast 0.4.0
gcs-oauth2-boto-plugin 3.0
gevent 21.8.0
gitdb 4.0.9
GitPython 3.1.27
glob2 0.7
gmpy2 2.0.8
google-apitools 0.5.32
google-auth 2.6.3
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
google-reauth 0.1.1
gql 0.2.0
graphql-core 1.1
greenlet 1.1.1
grpcio 1.44.0
gsutil 5.9
gym 0.22.0
gym-notices 0.0.6
h5py 3.3.0
HeapDict 1.0.1
higher 0.2.1
html5lib 1.1
httplib2 0.20.4
huggingface-hub 0.5.1
hydra-core 1.0.7
idna 3.2
imagecodecs 2021.8.26
imageio 2.9.0
imagesize 1.2.0
importlib-metadata 4.12.0
inflection 0.5.1
iniconfig 1.1.1
intervaltree 3.1.0
ipykernel 6.4.1
ipython 7.29.0
ipython-genutils 0.2.0
ipywidgets 7.6.5
isort 5.9.3
itsdangerous 2.0.1
jdcal 1.4.1
jedi 0.18.0
jeepney 0.7.1
Jinja2 2.11.3
jinja2-time 0.2.0
joblib 1.1.0
json5 0.9.6
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.12
jupyter-console 6.4.0
jupyter-core 4.8.1
jupyter-server 1.4.1
jupyterlab 3.2.1
jupyterlab-pygments 0.1.2
jupyterlab-server 2.8.2
jupyterlab-widgets 1.0.0
keras 2.10.0
Keras-Preprocessing 1.1.2
keyring 23.1.0
kiwisolver 1.3.1
lark-parser 0.12.0
lazy-object-proxy 1.6.0
learn2learn 0.1.7
libarchive-c 2.9
libclang 14.0.6
littleutils 0.2.2
llvmlite 0.37.0
locket 0.2.1
loguru 0.6.0
lxml 4.6.3
Markdown 3.3.6
MarkupSafe 1.1.1
matplotlib 3.4.3
matplotlib-inline 0.1.2
mccabe 0.6.1
mistune 0.8.4
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mock 4.0.3
monotonic 1.6
more-itertools 8.10.0
mpmath 1.2.1
msgpack 1.0.2
multidict 6.0.2
multipledispatch 0.6.0
munkres 1.1.4
mypy-extensions 0.4.3
nbclassic 0.2.6
nbclient 0.5.3
nbconvert 6.1.0
nbformat 5.1.3
nest-asyncio 1.5.1
networkx 2.6.3
nltk 3.6.5
nose 1.3.7
notebook 6.4.5
numba 0.54.1
numexpr 2.7.3
numpy 1.20.3
numpydoc 1.1.0
nvidia-ml-py3 7.352.0
nvidia-smi 0.1.3
oauth2client 4.1.3
oauthlib 3.2.0
olefile 0.46
omegaconf 2.0.6
opencv-python 4.6.0.66
openpyxl 3.0.9
opt-einsum 3.3.0
ordered-set 4.1.0
packaging 21.0
pandas 1.3.4
pandocfilters 1.4.3
parso 0.8.2
partd 1.2.0
path 16.0.0
pathlib2 2.3.6
pathspec 0.7.0
pathtools 0.1.2
patsy 0.5.2
pep8 1.7.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 8.4.0
pip 22.2.2
pkginfo 1.7.1
plotly 5.7.0
pluggy 0.13.1
ply 3.11
portalocker 2.5.1
poyo 0.5.0
progressbar2 4.0.0
prometheus-client 0.11.0
promise 2.3
prompt-toolkit 3.0.20
protobuf 3.19.6
psutil 5.8.0
ptyprocess 0.7.0
py 1.10.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycodestyle 2.7.0
pycosat 0.6.3
pycparser 2.20
pycurl 7.44.1
pydocstyle 6.1.1
pyerfa 2.0.0
pyflakes 2.3.1
Pygments 2.10.0
pylint 2.9.6
pyls-spyder 0.4.0
pyodbc 4.0.0-unsupported
pyOpenSSL 21.0.0
pyparsing 3.0.4
pyrsistent 0.18.0
PySocks 1.7.1
pytest 6.2.4
python-dateutil 2.8.2
python-lsp-black 1.0.0
python-lsp-jsonrpc 1.0.0
python-lsp-server 1.2.4
python-slugify 5.0.2
python-utils 3.1.0
pytz 2021.3
pyu2f 0.1.5
PyWavelets 1.1.1
pyxdg 0.27
PyYAML 6.0
pyzmq 22.2.1
QDarkStyle 3.0.2
qpth 0.0.15
qstylizer 0.1.10
QtAwesome 1.0.2
qtconsole 5.1.1
QtPy 1.10.0
regex 2021.8.3
requests 2.26.0
requests-oauthlib 1.3.1
retry-decorator 1.1.1
rope 0.19.0
rsa 4.7.2
Rtree 0.9.7
ruamel-yaml-conda 0.15.100
sacrebleu 2.2.0
sacremoses 0.0.49
scikit-image 0.18.3
scikit-learn 0.24.2
scikit-learn-intelex 2021.20210714.170444
scipy 1.7.1
seaborn 0.11.2
SecretStorage 3.3.1
Send2Trash 1.8.0
sentry-sdk 1.5.9
setproctitle 1.2.2
setuptools 58.0.4
shortuuid 1.0.8
simplegeneric 0.8.1
singledispatch 3.7.0
sip 4.19.13
six 1.16.0
sklearn 0.0
smmap 5.0.0
sniffio 1.2.0
snowballstemmer 2.1.0
sorcery 0.2.2
sortedcollections 2.1.0
sortedcontainers 2.4.0
soupsieve 2.2.1
Sphinx 4.2.0
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
sphinxcontrib-websupport 1.2.4
spyder 5.1.5
spyder-kernels 2.1.3
SQLAlchemy 1.4.22
statsmodels 0.12.2
subprocess32 3.5.4
sympy 1.9
tables 3.6.1
TBB 0.2
tblib 1.7.0
tensorboard 2.10.1
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow-estimator 2.10.0
tensorflow-gpu 2.10.1
tensorflow-io-gcs-filesystem 0.27.0
termcolor 2.0.1
terminado 0.9.4
testpath 0.5.0
text-unidecode 1.3
textdistance 4.2.1
tfrecord 1.14.1
threadpoolctl 2.2.0
three-merge 0.1.1
tifffile 2021.7.2
timm 0.6.11
tinycss 0.4
tokenizers 0.11.6
toml 0.10.2
toolz 0.11.1
torch 1.9.1+cu111
torchaudio 0.9.1
torchmeta 1.8.0
torchtext 0.10.1
torchvision 0.10.1+cu111
tornado 6.1
tqdm 4.62.3
traitlets 5.1.0
transformers 4.18.0
typed-ast 1.4.3
typing-extensions 3.10.0.2
ujson 4.0.2
ultimate-anatome 0.1.1
ultimate-aws-cv-task2vec 0.0.1
unicodecsv 0.14.1
Unidecode 1.2.0
urllib3 1.26.7
wandb 0.13.5
watchdog 2.1.3
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 2.0.2
wheel 0.37.0
whichcraft 0.6.1
widgetsnbextension 3.5.1
wrapt 1.12.1
wurlitzer 2.1.1
xlrd 2.0.1
XlsxWriter 3.0.1
xlwt 1.3.0
yapf 0.31.0
yarl 1.7.2
zict 2.0.0
zipp 3.6.0
zope.event 4.5.0
zope.interface 5.4.0
WARNING: You are using pip version 22.2.2; however, version 22.3.1 is available.
You should consider upgrading via the '/home/pzy2/miniconda3/envs/metalearning3.9/bin/python -m pip install --upgrade pip' command.
(metalearning3.9) [pzy2#vision-submit ~]$
I asked a related question because I can't install pytorch with cuda with conda, see details here: why does conda install the pytorch CPU version despite me putting explicitly to download the cuda toolkit version?
I think this works:
# -- Install PyTorch sometimes requires more careful versioning due to cuda, ref: official install instruction https://pytorch.org/get-started/previous-versions/
# you need python 3.9 for torch version 1.9.1 to work, due to torchmeta==1.8.0 requirement
if ! python -V 2>&1 | grep -q 'Python 3\.9'; then
echo "Error: Python 3.9 is required!"
exit 1
fi
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
From looking at the link you've provided, I can see
cu111/torch-1.9.1%2Bcu111-cp36-cp36m-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp36-cp36m-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp37-cp37m-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp37-cp37m-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp38-cp38-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp39-cp39-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp39-cp39-win_amd64.whl
cp39 means Python version 3.9. Notice there is no support for 3.10 or 3.11. In your new environment, you probably are running a newer version of Python, whereas in the other environment you have Python 3.6, 3.7, 3.8, or 3.9
To install pytorch 1.9.1cu11 you need python 3.9 to be avaiable. Added that to my bash install.sh
# - create conda env
conda create -n metalearning_gpu python=3.9
conda activate metalearning_gpu
## conda remove --name metalearning_gpu --all
# - make sure pip is up to date
which python
pip install --upgrade pip
pip3 install --upgrade pip
which pip
which pip3
# -- Install PyTorch sometimes requires more careful versioning due to cuda, ref: official install instruction https://pytorch.org/get-started/previous-versions/
# you need python 3.9 for torch version 1.9.1 to work, due to torchmeta==1.8.0 requirement
if ! python -V 2>&1 | grep -q 'Python 3\.9'; then
echo "Error: Python 3.9 is required!"
exit 1
fi
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
I am trying to run my simple AI program but I keep getting this DLL error:
ImportError: Could not find the DLL(s) 'msvcp140_1.dll'. TensorFlow requires that these DLLs be installed in a directory that is named in your %PATH% environment variable.
You may install these DLLs by downloading "Microsoft C++ Redistributable for Visual Studio 2015, 2017 and 2019" for your platform from this URL:
https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads
I went ahead and downloaded that support file and restarted my computer but that didn't work. I also found the specified dll file in my system 32 and made sure it was in my PATH environment for both system and user. Still doesn't work. I am using python3.8 with gpu enabled. Am
I missing something? Is this a version issue because it has never happened on my previous projects.
Here are my libraries:
_tflow_select 2.3.0
absl-py 0.12.0
aggdraw 1.3.12
aiofiles 0.7.0
aiohttp 3.7.4
alembic 1.6.4
argon2-cffi 20.1.0
astor 0.8.1
asttokens 2.0.5
astunparse 1.6.3
async-timeout 3.0.1
async_generator 1.10
attrs 20.3.0
autokeras 1.0.16
backcall 0.2.0
beautifulsoup4 4.9.3
blas 1.0
bleach 3.3.0
blinker 1.4
brotlipy 0.7.0
ca-certificates 2021.7.5
cachetools 4.2.2
certifi 2021.5.30
cffi 1.14.5
chardet 4.0.0
click 7.1.2
cliff 3.8.0
cmaes 0.8.2
cmd2 2.1.2
colorama 0.4.4
colorlog 5.0.1
coverage 5.5
cryptography 3.4.7
cycler 0.10.0
cython 0.29.23
decorator 5.0.9
defusedxml 0.7.1
docopt 0.6.2
entrypoints 0.3
executing 0.6.0
fastapi 0.65.1
flaml 0.6.9
flatbuffers 1.12
freetype 2.10.4
gast 0.4.0
gin-config 0.4.0
google-auth 1.30.0
google-auth-oauthlib 0.4.4
google-pasta 0.2.0
greenlet 1.1.0
grpcio 1.34.1
h11 0.12.0
h5py 3.1.0
hdf5 1.10.5
icc_rt 2019.0.0
icecream 2.1.0
icu 58.2
idna 2.10
importlib-metadata 3.10.0
importlib_metadata 3.10.0
intel-openmp 2021.2.0
ipykernel 5.3.4
ipython 7.25.0
ipython_genutils 0.2.0
ipywidgets 7.6.3
jedi 0.18.0
jinja2 3.0.1
joblib 1.0.1
jpeg 9b
jsonschema 3.2.0
jupyter_client 6.1.12
jupyter_core 4.7.1
jupyterlab_pygments 0.1.2
jupyterlab_widgets 1.0.0
keras 2.7.0
keras-applications 1.0.8
keras-nightly 2.5.0.dev2021032900
keras-preprocessing 1.1.2
keras-tuner 1.0.4
kiwisolver 1.3.1
kt-legacy 1.0.4
libclang 12.0.0
libpng 1.6.37
libprotobuf 3.14.0
libsodium 1.0.18
libtiff 4.1.0
lightgbm 3.3.1
llvmlite 0.37.0
lxml 4.6.3
lz4-c 1.9.3
m2w64-gcc-libgfortran 5.3.0
m2w64-gcc-libs 5.3.0
m2w64-gcc-libs-core 5.3.0
m2w64-gmp 6.1.0
m2w64-libwinpthread-git 5.0.0.4634.697f757
mako 1.1.4
markdown 3.3.4
markupsafe 2.0.1
matplotlib 3.3.4
matplotlib-base 3.3.4
matplotlib-inline 0.1.2
mistune 0.8.4
mkl 2021.2.0
mkl-service 2.3.0
mkl_fft 1.3.0
mkl_random 1.2.1
msys2-conda-epoch 20160418
multidict 5.1.0
nbclient 0.5.3
nbconvert 6.1.0
nbformat 5.1.3
nest-asyncio 1.5.1
notebook 6.4.0
numba 0.54.0
numexpr 2.7.3
numpy 1.19.5
oauthlib 3.1.0
olefile 0.46
opencv-contrib-python 4.5.3.56
opencv-python 4.5.3.56
openssl 1.1.1k
opt-einsum 3.3.0
opt_einsum 3.1.0
optuna 2.8.0
orca 1.6
packaging 20.9
pandas 1.2.4
pandocfilters 1.4.3
parso 0.8.2
pbr 5.6.0
pickleshare 0.7.5
pillow 8.2.0
pip 21.3.1
pipreqs 0.4.10
plotly 4.14.3
plotly-orca 1.3.1
prettytable 2.1.0
prometheus_client 0.11.0
prompt-toolkit 3.0.17
protobuf 3.16.0
psutil 5.8.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.20
pydantic 1.8.1
pydot 1.4.2
pygments 2.9.0
pyjwt 2.1.0
pyopenssl 20.0.1
pyparsing 2.4.7
pyperclip 1.8.2
pyqt 5.9.2
pyreadline 2.1
pyreadline3 3.3
pyrsistent 0.17.3
pysocks 1.7.1
python 3.8.0
python-dateutil 2.8.1
python-dotenv 0.17.1
python-editor 1.0.4
python-multipart 0.0.5
python_abi 3.8
pytz 2021.1
pywin32 227
pywinpty 0.5.7
pyyaml 5.4.1
pyzmq 20.0.0
qt 5.9.7
requests 2.25.1
requests-oauthlib 1.3.0
retrying 1.3.3
rsa 4.7.2
scikit-learn 0.24.2
scipy 1.6.2
seaborn 0.11.1
send2trash 1.5.0
setuptools 52.0.0
sip 4.19.13
six 1.15.0
soupsieve 2.2.1
sqlalchemy 1.4.22
sqlite 3.35.4
starlette 0.14.2
stevedore 3.3.0
tables 3.6.1
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
tensorflow 2.5.0
tensorflow-addons 0.13.0
tensorflow-base 2.3.0
tensorflow-estimator 2.5.0
tensorflow-gpu 2.4.1
tensorflow-io-gcs-filesystem 0.21.0
termcolor 1.1.0
terminado 0.9.4
testpath 0.5.0
threadpoolctl 2.1.0
tk 8.6.10
toolz 0.11.1
tornado 6.1
tqdm 4.61.2
traitlets 5.0.5
typeguard 2.12.1
typing-extensions 3.7.4.3
typing_extensions 3.7.4.3
urllib3 1.26.4
uvicorn 0.13.4
vc 14.2
visualkeras 0.0.2
vs2015_runtime 14.27.29016
watchgod 0.6
wcwidth 0.2.5
webencodings 0.5.1
websockets 8.1
werkzeug 1.0.1
wheel 0.36.2
widgetsnbextension 3.5.1
win_inet_pton 1.1.0
wincertstore 0.2
winpty 0.4.3
wrapt 1.12.1
xgboost 1.3.3
xz 5.2.5
yaml 0.2.5
yarg 0.1.9
yarl 1.6.3
zeromq 4.3.3
zipp 3.4.1
zlib 1.2.11
zstd 1.4.9
First, check to see if msvcp140.dll (not msvcp140_1.dll) is installed.
Download it here: https://www.microsoft.com/en-us/download/details.aspx?id=53587
Restart your computer and see if it works.
If that doesn't work try copying msvcp140_1.dll into: C:\Users\PCName\AppData\Local\Programs\Python\Python38
If nothing still works, it could be a version issue.
As far as I know, Python 3.8 support requires TensorFlow 2.2 or later.
Run this:
pip install tensorflow ==2.2.0
Look here for system requirements: https://www.tensorflow.org/install/pip#system-requirements
Tensorflow will work only on Windows 7 or later (64-bit) (According to the above link)
Package location: https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-2.7.0-cp38-cp38-win_amd64.whl
If you are using 32-bit python,
replace your 32-bit python with a 64-bit version. Tensorflow does not support 32-bit architecture.
data source: https://catalog.data.gov/dataset/nyc-transit-subway-entrance-and-exit-data
I tried looking for a similar problem but I can't find an answer and the error does not help much. I'm kinda frustrated at this point.
Thanks for the help.
I'm calculating the closest distance from a point.
df_subway = pd.read_csv('/content/drive/MyDrive/Despliegue_de_modelos/NYC_Transit_Subway_Entrance_And_Exit_Data.csv')
geometry = [Point(xy) for xy in zip(df_subway['Station Longitude'], df_subway['Station Latitude'])]
# Coordinate reference system :
crs = {'init': 'EPSG:4326'}
# Creating a Geographic data frame
gdf_subway_entrance_geometry = gpd.GeoDataFrame(df_subway, crs=crs, geometry=geometry).to_crs('EPSG:5234')
gdf_subway_entrance_geometry
df_yes_entry = gdf_subway_entrance_geometry[gdf_subway_entrance_geometry.Entry=='YES']
df_yes_entry
from shapely.geometry import Point, MultiPoint
from shapely.ops import nearest_points
pts = MultiPoint(df_yes_entry['geometry']) #it fails in this line
pt = Point(gpdPoint.x, gpdPoint.y)
#[o.wkt for o in nearest_points(pt, pts)]
for o in nearest_points(pt, pts):
print(o)
The problem is that if I do the same but with gdf_subway_entrance_geometry instead of df_yes_entry it works, but I need to do some filters!
This is the error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2897 try:
-> 2898 return self._engine.get_loc(casted_key)
2899 except KeyError as err:
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: 13
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
7 frames
<ipython-input-480-b6733def46e0> in <module>()
1 from shapely.geometry import Point, MultiPoint
2 from shapely.ops import nearest_points
----> 3 pts = MultiPoint(df_yes_entry['geometry'])
4 pt = Point(gpdPoint.x, gpdPoint.y)
5 #[o.wkt for o in nearest_points(pt, pts)]
/usr/local/lib/python3.7/dist-packages/shapely/geometry/multipoint.py in __init__(self, points)
56 pass
57 else:
---> 58 self._geom, self._ndim = geos_multipoint_from_py(points)
59
60 def shape_factory(self, *args):
/usr/local/lib/python3.7/dist-packages/shapely/geometry/multipoint.py in geos_multipoint_from_py(ob)
169 # add to coordinate sequence
170 for i in range(m):
--> 171 coords = ob[i]
172 geom, ndims = point.geos_point_from_py(coords)
173
/usr/local/lib/python3.7/dist-packages/geopandas/geoseries.py in __getitem__(self, key)
606
607 def __getitem__(self, key):
--> 608 return self._wrapped_pandas_method("__getitem__", key)
609
610 #doc(pd.Series)
/usr/local/lib/python3.7/dist-packages/geopandas/geoseries.py in _wrapped_pandas_method(self, mtd, *args, **kwargs)
599 def _wrapped_pandas_method(self, mtd, *args, **kwargs):
600 """Wrap a generic pandas method to ensure it returns a GeoSeries"""
--> 601 val = getattr(super(), mtd)(*args, **kwargs)
602 if type(val) == Series:
603 val.__class__ = GeoSeries
/usr/local/lib/python3.7/dist-packages/pandas/core/series.py in __getitem__(self, key)
880
881 elif key_is_scalar:
--> 882 return self._get_value(key)
883
884 if is_hashable(key):
/usr/local/lib/python3.7/dist-packages/pandas/core/series.py in _get_value(self, label, takeable)
988
989 # Similar to Index.get_value, but we do not fall back to positional
--> 990 loc = self.index.get_loc(label)
991 return self.index._get_values_for_loc(self, loc, label)
992
/usr/local/lib/python3.7/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2898 return self._engine.get_loc(casted_key)
2899 except KeyError as err:
-> 2900 raise KeyError(key) from err
2901
2902 if tolerance is not None:
KeyError: 13
I am working with colab this are my packages:
Package Version
----------------------------- --------------
absl-py 0.12.0
alabaster 0.7.12
albumentations 0.1.12
altair 4.1.0
appdirs 1.4.4
argcomplete 1.12.3
argon2-cffi 21.1.0
arviz 0.11.4
astor 0.8.1
astropy 4.3.1
astunparse 1.6.3
atari-py 0.2.9
atomicwrites 1.4.0
attrs 21.2.0
audioread 2.1.9
autograd 1.3
Babel 2.9.1
backcall 0.2.0
beautifulsoup4 4.6.3
bleach 4.1.0
blis 0.4.1
bokeh 2.4.0
Bottleneck 1.3.2
branca 0.4.2
bs4 0.0.1
CacheControl 0.12.6
cached-property 1.5.2
cachetools 4.2.4
Cartopy 0.19.0.post1
catalogue 1.0.0
certifi 2021.5.30
cffi 1.14.6
cftime 1.5.1
chardet 3.0.4
charset-normalizer 2.0.6
clang 5.0
click 7.1.2
click-plugins 1.1.1
cligj 0.7.2
cloudpickle 1.3.0
cmake 3.12.0
cmdstanpy 0.9.5
colorcet 2.0.6
colorlover 0.3.0
community 1.0.0b1
contextlib2 0.5.5
convertdate 2.3.2
coverage 3.7.1
coveralls 0.5
crcmod 1.7
cufflinks 0.17.3
cvxopt 1.2.7
cvxpy 1.0.31
cycler 0.10.0
cymem 2.0.5
Cython 0.29.24
daft 0.0.4
dask 2.12.0
datascience 0.10.6
debugpy 1.0.0
decorator 4.4.2
defusedxml 0.7.1
descartes 1.1.0
dill 0.3.4
distributed 1.25.3
dlib 19.18.0
dm-tree 0.1.6
docopt 0.6.2
docutils 0.17.1
dopamine-rl 1.0.5
earthengine-api 0.1.284
easydict 1.9
ecos 2.0.7.post1
editdistance 0.5.3
en-core-web-sm 2.2.5
entrypoints 0.3
ephem 4.1
et-xmlfile 1.1.0
fa2 0.3.5
fastai 1.0.61
fastdtw 0.3.4
fastprogress 1.0.0
fastrlock 0.6
fbprophet 0.7.1
feather-format 0.4.1
filelock 3.3.0
Fiona 1.8.20
firebase-admin 4.4.0
fix-yahoo-finance 0.0.22
Flask 1.1.4
flatbuffers 1.12
folium 0.8.3
future 0.16.0
gast 0.4.0
GDAL 2.2.2
gdown 3.6.4
gensim 3.6.0
geographiclib 1.52
geopandas 0.10.1
geopy 1.17.0
geoviews 1.9.2
gin-config 0.4.0
glob2 0.7
google 2.0.3
google-api-core 1.26.3
google-api-python-client 1.12.8
google-auth 1.35.0
google-auth-httplib2 0.0.4
google-auth-oauthlib 0.4.6
google-cloud-bigquery 1.21.0
google-cloud-bigquery-storage 1.1.0
google-cloud-core 1.0.3
google-cloud-datastore 1.8.0
google-cloud-firestore 1.7.0
google-cloud-language 1.2.0
google-cloud-storage 1.18.1
google-cloud-translate 1.5.0
google-colab 1.0.0
google-pasta 0.2.0
google-resumable-media 0.4.1
googleapis-common-protos 1.53.0
googledrivedownloader 0.4
graphviz 0.10.1
greenlet 1.1.2
grpcio 1.41.0
gspread 3.0.1
gspread-dataframe 3.0.8
gym 0.17.3
h5py 3.1.0
HeapDict 1.0.1
hijri-converter 2.2.2
holidays 0.10.5.2
holoviews 1.14.6
html5lib 1.0.1
htmlmin 0.1.12
httpimport 0.5.18
httplib2 0.17.4
httplib2shim 0.0.3
humanize 0.5.1
hyperopt 0.1.2
ideep4py 2.0.0.post3
idna 2.10
ImageHash 4.2.1
imageio 2.4.1
imagesize 1.2.0
imbalanced-learn 0.4.3
imblearn 0.0
imgaug 0.2.9
importlib-metadata 4.8.1
importlib-resources 5.2.2
imutils 0.5.4
inflect 2.1.0
iniconfig 1.1.1
intel-openmp 2021.4.0
intervaltree 2.1.0
ipykernel 4.10.1
ipython 5.5.0
ipython-genutils 0.2.0
ipython-sql 0.3.9
ipywidgets 7.6.5
itsdangerous 1.1.0
jax 0.2.21
jaxlib 0.1.71+cuda111
jdcal 1.4.1
jedi 0.18.0
jieba 0.42.1
Jinja2 2.11.3
joblib 1.0.1
jpeg4py 0.1.4
jsonschema 2.6.0
jupyter 1.0.0
jupyter-client 5.3.5
jupyter-console 5.2.0
jupyter-core 4.8.1
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.2
kaggle 1.5.12
kapre 0.3.5
keras 2.6.0
Keras-Preprocessing 1.1.2
keras-vis 0.4.1
kiwisolver 1.3.2
korean-lunar-calendar 0.2.1
librosa 0.8.1
lightgbm 2.2.3
llvmlite 0.34.0
lmdb 0.99
LunarCalendar 0.0.9
lxml 4.2.6
Markdown 3.3.4
MarkupSafe 2.0.1
matplotlib 3.2.2
matplotlib-inline 0.1.3
matplotlib-venn 0.11.6
missingno 0.5.0
mistune 0.8.4
mizani 0.6.0
mkl 2019.0
mlxtend 0.14.0
more-itertools 8.10.0
moviepy 0.2.3.5
mpmath 1.2.1
msgpack 1.0.2
multimethod 1.6
multiprocess 0.70.12.2
multitasking 0.0.9
munch 2.5.0
murmurhash 1.0.5
music21 5.5.0
natsort 5.5.0
nbclient 0.5.4
nbconvert 5.6.1
nbformat 5.1.3
nest-asyncio 1.5.1
netCDF4 1.5.7
networkx 2.6.3
nibabel 3.0.2
nltk 3.2.5
notebook 5.3.1
numba 0.51.2
numexpr 2.7.3
numpy 1.19.5
nvidia-ml-py3 7.352.0
oauth2client 4.1.3
oauthlib 3.1.1
okgrade 0.4.3
opencv-contrib-python 4.1.2.30
opencv-python 4.1.2.30
openpyxl 2.5.9
opt-einsum 3.3.0
osqp 0.6.2.post0
packaging 21.0
palettable 3.3.0
pandas 1.1.5
pandas-datareader 0.9.0
pandas-gbq 0.13.3
pandas-profiling 3.1.0
pandocfilters 1.5.0
panel 0.12.4
param 1.11.1
parso 0.8.2
pathlib 1.0.1
patsy 0.5.2
pep517 0.11.0
pexpect 4.8.0
phik 0.12.0
pickleshare 0.7.5
Pillow 7.1.2
pip 21.1.3
pip-tools 6.2.0
plac 1.1.3
plotly 4.4.1
plotnine 0.6.0
pluggy 0.7.1
pooch 1.5.1
portpicker 1.3.9
prefetch-generator 1.0.1
preshed 3.0.5
prettytable 2.2.1
progressbar2 3.38.0
prometheus-client 0.11.0
promise 2.3
prompt-toolkit 1.0.18
protobuf 3.17.3
psutil 5.4.8
psycopg2 2.7.6.1
ptyprocess 0.7.0
py 1.10.0
pyarrow 3.0.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycocotools 2.0.2
pycparser 2.20
pyct 0.4.8
pydantic 1.8.2
pydata-google-auth 1.2.0
pydot 1.3.0
pydot-ng 2.0.0
pydotplus 2.0.2
PyDrive 1.3.1
pyemd 0.5.1
pyerfa 2.0.0
pyglet 1.5.0
Pygments 2.6.1
pygobject 3.26.1
pymc3 3.11.4
PyMeeus 0.5.11
pymongo 3.12.0
pymystem3 0.2.0
PyOpenGL 3.1.5
pyparsing 2.4.7
pyproj 3.2.1
pyrsistent 0.18.0
pyshp 2.1.3
pysndfile 1.3.8
PySocks 1.7.1
pystan 2.19.1.1
pytest 3.6.4
python-apt 0.0.0
python-chess 0.23.11
python-dateutil 2.8.2
python-louvain 0.15
python-slugify 5.0.2
python-utils 2.5.6
pytz 2018.9
pyviz-comms 2.1.0
PyWavelets 1.1.1
PyYAML 5.4.1
pyzmq 22.3.0
qdldl 0.1.5.post0
qtconsole 5.1.1
QtPy 1.11.2
regex 2019.12.20
requests 2.26.0
requests-oauthlib 1.3.0
resampy 0.2.2
retrying 1.3.3
rpy2 3.4.5
rsa 4.7.2
scikit-image 0.16.2
scikit-learn 0.22.2.post1
scipy 1.7.1
screen-resolution-extra 0.0.0
scs 2.1.4
seaborn 0.11.2
semver 2.13.0
Send2Trash 1.8.0
setuptools 57.4.0
setuptools-git 1.2
Shapely 1.7.1
simplegeneric 0.8.1
six 1.15.0
sklearn 0.0
sklearn-pandas 1.8.0
smart-open 5.2.1
snowballstemmer 2.1.0
sortedcontainers 2.4.0
SoundFile 0.10.3.post1
spacy 2.2.4
Sphinx 1.8.5
sphinxcontrib-serializinghtml 1.1.5
sphinxcontrib-websupport 1.2.4
SQLAlchemy 1.4.25
sqlparse 0.4.2
srsly 1.0.5
statsmodels 0.10.2
sympy 1.7.1
tables 3.4.4
tabulate 0.8.9
tangled-up-in-unicode 0.1.0
tblib 1.7.0
tensorboard 2.6.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
tensorflow 2.6.0
tensorflow-datasets 4.0.1
tensorflow-estimator 2.6.0
tensorflow-gcs-config 2.6.0
tensorflow-hub 0.12.0
tensorflow-metadata 1.2.0
tensorflow-probability 0.14.1
termcolor 1.1.0
terminado 0.12.1
testpath 0.5.0
text-unidecode 1.3
textblob 0.15.3
Theano-PyMC 1.1.2
thinc 7.4.0
tifffile 2021.8.30
toml 0.10.2
tomli 1.2.1
toolz 0.11.1
torch 1.9.0+cu111
torchsummary 1.5.1
torchtext 0.10.0
torchvision 0.10.0+cu111
tornado 5.1.1
tqdm 4.62.3
traitlets 5.1.0
tweepy 3.10.0
typeguard 2.7.1
typing-extensions 3.10.0.2
tzlocal 1.5.1
uritemplate 3.0.1
urllib3 1.24.3
vega-datasets 0.9.0
visions 0.7.4
wasabi 0.8.2
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 1.0.1
wheel 0.37.0
widgetsnbextension 3.5.1
wordcloud 1.5.0
wrapt 1.12.1
xarray 0.18.2
xgboost 0.90
xkit 0.0.0
xlrd 1.1.0
xlwt 1.3.0
yellowbrick 0.9.1
zict 2.0.0
zipp 3.6.0
geopandas 0.10.1
have noted that your data is on kaggle, so start by sourcing it
there really is only one issue shapely.geometry.MultiPoint() constructor does not work with a filtered series. Pass it a numpy array instead and it works.
full code below, have randomly selected a point to serve as gpdPoint
# https://www.kaggle.com/new-york-state/nys-nyc-transit-subway-entrance-and-exit-data
import kaggle.cli
import sys, requests, urllib
import pandas as pd
from pathlib import Path
from zipfile import ZipFile
# fmt: off
# download data set
url = "https://www.kaggle.com/new-york-state/nys-nyc-transit-subway-entrance-and-exit-data"
sys.argv = [sys.argv[0]] + f"datasets download {urllib.parse.urlparse(url).path[1:]}".split(" ")
kaggle.cli.main()
zfile = ZipFile(f'{urllib.parse.urlparse(url).path.split("/")[-1]}.zip')
dfs = {f.filename: pd.read_csv(zfile.open(f)) for f in zfile.infolist() if Path(f.filename).suffix in [".csv"]}
# fmt: on
df_subway = dfs['nyc-transit-subway-entrance-and-exit-data.csv']
from shapely.geometry import Point, MultiPoint
from shapely.ops import nearest_points
import geopandas as gpd
geometry = [Point(xy) for xy in zip(df_subway['Station Longitude'], df_subway['Station Latitude'])]
# Coordinate reference system :
crs = {'init': 'EPSG:4326'}
# Creating a Geographic data frame
gdf_subway_entrance_geometry = gpd.GeoDataFrame(df_subway, crs=crs, geometry=geometry).to_crs('EPSG:5234')
gdf_subway_entrance_geometry
df_yes_entry = gdf_subway_entrance_geometry
df_yes_entry = gdf_subway_entrance_geometry[gdf_subway_entrance_geometry.Entry=='YES']
df_yes_entry
# randomly select a point....
gpdPoint = gdf_subway_entrance_geometry.sample(1).geometry.tolist()[0]
pts = MultiPoint(df_yes_entry['geometry'].values) # does not work with a geopandas series, works with a numpy array
pt = Point(gpdPoint.x, gpdPoint.y)
#[o.wkt for o in nearest_points(pt, pts)]
for o in nearest_points(pt, pts):
print(o)
I am trying to use DialogFlow to make a small talk chatbot on Raspberry Pi 4, and I am getting this error:
ImportError: /usr/local/lib/python3.7/dist-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so: undefined symbol: aes_hw_encrypt
My code is as follows:
"""
Libraries used:
dialogflow 1.1.0 - I did pip3 install dialogflow -U and it upgraded to this
google-api-core 1.29.0
os Latest version - not sure
"""
import os
import dialogflow
from google.api_core.exceptions import InvalidArgument
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'secrets.json'
DIALOGFLOW_PROJECT_ID = '[test_id]'
DIALOGFLOW_LANGUAGE_CODE= '[en]'
SESSION_ID = 'me'
text_to_be_analyzed = "Howdy"
session_client = dialogflow.SessionsClient()
session = session_client.session_path(DIALOGFLOW_PROJECT_ID, SESSION_ID)
text_input = dialogflow.types.TextInput(text=text_to_be_analyzed, language_code=DIALOGFLOW_LANGUAGE_CODE)
query_input = dialogflow.types.QueryInput(text=text_input)
try:
response = session_client.detect_intent(session=session, query_input=query_input)
except InvalidArgument:
raise
print("Query text:", response.query_result.query_text)
print("Detected intent:", response.query_result.intent.display_name)
print("Detected intent confidence:", response.query_result.intent_detection_confidence)
print("Fulfillment text:", response.query_result.fulfillment_text)
pip3 list gives me:
-------------------------------- ---------------
Adafruit-BBIO 1.2.0
Adafruit-Blinka 6.10.0
Adafruit-CharLCD 1.1.1
adafruit-circuitpython-busdevice 5.0.6
adafruit-circuitpython-framebuf 1.4.7
adafruit-circuitpython-ssd1306 2.11.4
Adafruit-GPIO 1.0.3
Adafruit-ILI9341 1.5.1
Adafruit-PlatformDetect 3.13.3
Adafruit-PureIO 1.1.8
Adafruit-SSD1306 1.6.2
appdirs 1.4.3
asn1crypto 0.24.0
astroid 2.1.0
asttokens 1.1.13
attrs 21.2.0
automationhat 0.2.0
beautifulsoup4 4.7.1
blinker 1.4
blinkt 0.1.2
bs4 0.0.1
buttonshim 0.0.2
cachetools 4.2.2
Cap1xxx 0.1.3
certifi 2018.8.24
chardet 3.0.4
Click 7.0
colorama 0.3.7
colorzero 1.1
cookies 2.2.1
cryptography 2.6.1
cupshelpers 1.0
cycler 0.10.0
decorator 4.4.2
dialogflow 1.1.0
docutils 0.14
drumhat 0.1.0
entrypoints 0.3
envirophat 1.0.0
ExplorerHAT 0.4.2
flake8 3.9.2
Flask 1.0.2
fourletterphat 0.1.0
fuzzywuzzy 0.18.0
google-api-core 1.29.0
google-auth 1.30.1
googleapis-common-protos 1.53.0
gpiozero 1.5.1
grpcio 1.38.0
guizero 0.6.0
html5lib 1.0.1
idna 2.6
imageio 2.9.0
importlib-metadata 4.0.1
iniconfig 1.1.1
ipykernel 4.9.0
ipython 5.8.0
ipython-genutils 0.2.0
isort 4.3.4
itsdangerous 0.24
jaraco.context 4.0.0
jedi 0.13.2
Jinja2 2.10
jupyter-client 5.2.3
jupyter-core 4.4.0
keyring 17.1.1
keyrings.alt 3.1.1
kiwisolver 1.3.1
lazy-object-proxy 1.3.1
logilab-common 1.4.2
lxml 4.3.2
MarkupSafe 1.1.0
matplotlib 3.4.2
mccabe 0.6.1
microdotphat 0.2.1
mongo-db 0.1
more-itertools 8.8.0
mote 0.0.4
motephat 0.0.3
mypy 0.670
mypy-extensions 0.4.1
networkx 2.5.1
nightly 0.0.1
nudatus 0.0.4
numpy 1.20.3
oauthlib 2.1.0
olefile 0.46
packaging 20.9
pandas 1.2.4
pantilthat 0.0.7
parso 0.3.1
pexpect 4.6.0
pgzero 1.2
phatbeat 0.1.1
pianohat 0.1.0
picamera 1.13
pickleshare 0.7.5
piglow 1.2.5
pigpio 1.78
Pillow 8.2.0
pip 18.1
pluggy 0.13.1
prompt-toolkit 3.0.18
protobuf 3.17.2
psutil 5.5.1
py 1.10.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycairo 1.16.2
pycodestyle 2.7.0
pycrypto 2.6.1
pycups 1.9.73
pyflakes 2.3.1
pyftdi 0.53.1
pygame 1.9.4.post1
Pygments 2.3.1
PyGObject 3.30.4
pyinotify 0.9.6
PyJWT 1.7.0
pylint 2.2.2
pymongo 3.4.0
pyOpenSSL 19.0.0
pyparsing 2.4.7
pyserial 3.4
pysmbc 1.0.15.6
pytest 6.2.4
python-apt 1.8.4.3
python-dateutil 2.8.1
python-espeak 0.5
python-Levenshtein 0.12.2
pytz 2021.1
pyusb 1.1.1
PyWavelets 1.1.1
pyxdg 0.25
PyYAML 5.4.1
pyzmq 17.1.2
qtconsole 4.3.1
rainbowhat 0.1.0
reportlab 3.5.13
requests 2.21.0
requests-oauthlib 1.0.0
responses 0.9.0
roman 2.0.0
rpi-ws281x 4.2.6
RPi.GPIO 0.7.0
rsa 4.7.2
RTIMULib 7.2.1
scikit-image 0.18.1
scipy 1.6.3
screen 1.0.1
scrollphat 0.0.7
scrollphathd 1.2.1
SecretStorage 2.3.1
semver 2.0.1
Send2Trash 1.5.0
sense-hat 2.2.0
setuptools 40.8.0
simplegeneric 0.8.1
simplejson 3.16.0
six 1.16.0
skywriter 0.0.7
sn3218 1.2.7
soupsieve 1.8
sox 1.4.1
spidev 3.4
ssh-import-id 5.7
sysv-ipc 1.1.0
thonny 3.3.6
tifffile 2021.4.8
toml 0.10.2
torch 1.0.0a0+8322165
torchvision 0.2.0
tornado 5.1.1
touchphat 0.0.1
traitlets 4.3.2
twython 3.7.0
typed-ast 1.3.1
typing 3.7.4.3
typing-extensions 3.10.0.0
uflash 1.2.4
unicornhathd 0.0.4
urllib3 1.24.1
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 0.14.1
wheel 0.32.3
wit 6.0.0
wolframalpha 5.0.0
wrapt 1.10.11
xmltodict 0.12.0
zipp 3.4.1
I might have accidentally installed the libraries some other way when I updated, but I don't think so...
I didn't install anything using apt.
I am using Thonny Python. Thanks!
cryptography lib was old. Thanks to everyone who helped!
im having troubles while using JupyterNotebook.
When I try to import SciPy and NumPy while using JupyterNotebook im always getting Errors:
import scipy as sp
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-6b0df46be2d8> in <module>
----> 1 import scipy as sp
~\Anaconda3\envs\MachineL\lib\site-packages\scipy\__init__.py in <module>
60 __all__ = ['test']
61
---> 62 from numpy import show_config as show_numpy_config
63 if show_numpy_config is None:
64 raise ImportError(
ImportError: cannot import name 'show_config'
And when I try to check if NumPy works:
import numpy as np
print("I like", np.pi)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-dbcfc58336e0> in <module>
1 import numpy as np
----> 2 print("I like", np.pi)
AttributeError: module 'numpy' has no attribute 'pi'
But the really confusing thing is that everything works when I try everything in a terminal.
>>> import scipy as sp
>>> print(sp.__version__)
1.3.1
or
>>> import numpy as np
>>> print("I like", np.pi)
I like 3.141592653589793
And I dont know what the problem could be...
I first thought that my JupyterNotebook would use a different VirtualEnvironment so I tried this:
(In JupyterNotebook):
pip list
Package Version
-------------------- ---------
absl-py 0.8.1
astor 0.8.0
attrs 19.2.0
backcall 0.1.0
bleach 3.1.0
certifi 2019.9.11
colorama 0.4.1
cycler 0.10.0
decorator 4.4.0
defusedxml 0.6.0
entrypoints 0.3
gast 0.2.2
google-pasta 0.1.7
grpcio 1.24.1
h5py 2.10.0
ipykernel 5.1.2
ipython 7.8.0
ipython-genutils 0.2.0
jedi 0.15.1
Jinja2 2.10.3
jsonschema 3.0.2
jupyter-client 5.3.4
jupyter-core 4.6.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
kiwisolver 1.1.0
Markdown 3.1.1
MarkupSafe 1.1.1
matplotlib 3.1.1
mistune 0.8.4
nbconvert 5.6.0
nbformat 4.4.0
notebook 6.0.1
numpy 1.17.3
opt-einsum 3.1.0
pandas 0.25.1
pandocfilters 1.4.2
parso 0.5.1
pickleshare 0.7.5
pip 19.2.3
prometheus-client 0.7.1
prompt-toolkit 2.0.10
protobuf 3.10.0
Pygments 2.4.2
pyparsing 2.4.2
pyrsistent 0.15.4
python-dateutil 2.8.0
pytz 2019.3
pywin32 223
pywinpty 0.5.5
pyzmq 18.1.0
scipy 1.3.1
Send2Trash 1.5.0
setuptools 41.4.0
six 1.12.0
tensorboard 2.0.0
tensorflow 2.0.0
tensorflow-estimator 2.0.0
termcolor 1.1.0
terminado 0.8.2
testpath 0.4.2
tornado 6.0.3
traitlets 4.3.3
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.16.0
wheel 0.33.6
wincertstore 0.2
wrapt 1.11.2
And then I tried the same thing in my VirtualEnvironment:
Package Version
-------------------- ---------
absl-py 0.8.1
astor 0.8.0
attrs 19.2.0
backcall 0.1.0
bleach 3.1.0
certifi 2019.9.11
colorama 0.4.1
cycler 0.10.0
decorator 4.4.0
defusedxml 0.6.0
entrypoints 0.3
gast 0.2.2
google-pasta 0.1.7
grpcio 1.24.1
h5py 2.10.0
ipykernel 5.1.2
ipython 7.8.0
ipython-genutils 0.2.0
jedi 0.15.1
Jinja2 2.10.3
jsonschema 3.0.2
jupyter-client 5.3.4
jupyter-core 4.6.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
kiwisolver 1.1.0
Markdown 3.1.1
MarkupSafe 1.1.1
matplotlib 3.1.1
mistune 0.8.4
nbconvert 5.6.0
nbformat 4.4.0
notebook 6.0.1
numpy 1.17.3
opt-einsum 3.1.0
pandas 0.25.1
pandocfilters 1.4.2
parso 0.5.1
pickleshare 0.7.5
pip 19.2.3
prometheus-client 0.7.1
prompt-toolkit 2.0.10
protobuf 3.10.0
Pygments 2.4.2
pyparsing 2.4.2
pyrsistent 0.15.4
python-dateutil 2.8.0
pytz 2019.3
pywin32 223
pywinpty 0.5.5
pyzmq 18.1.0
scipy 1.3.1
Send2Trash 1.5.0
setuptools 41.4.0
six 1.12.0
tensorboard 2.0.0
tensorflow 2.0.0
tensorflow-estimator 2.0.0
termcolor 1.1.0
terminado 0.8.2
testpath 0.4.2
tornado 6.0.3
traitlets 4.3.3
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.16.0
wheel 0.33.6
wincertstore 0.2
wrapt 1.11.2
The python version im using:
import sys
print(sys.version)
3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)]
This output is equally to the output of my terminal
And after I tried this I was pretty sure that both use the same VirtualEnvironment, so I dont really know what I should try anymore.
Thank you for your time, I hope anybody can help me.
Is there perhaps a numpy.py script anywhere in your Jupiter notebook directory? This could be taking priority over the actual numpy module. Try to change the directory that your working in with your jupiter notebook and restart the kernel I believe this will solve the issue.