Kernel crashes when I use tensorflow - tensorflow

I created my anaconda environment and installed a few modules on it (see below full list) notably tensorflow and matplotlib
(FreeCodeCampML) C:\Users\abelm>conda list
# packages in environment at C:\Users\abelm\anaconda3\envs\FreeCodeCampML:
#
# Name Version Build Channel
_tflow_select 2.3.0 mkl
absl-py 1.4.0 pyhd8ed1ab_0 conda-forge
aiohttp 3.8.1 py310he2412df_1 conda-forge
aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge
anyio 3.5.0 py310haa95532_0
appdirs 1.4.4 pyhd3eb1b0_0
argon2-cffi 21.3.0 pyhd3eb1b0_0
argon2-cffi-bindings 21.2.0 py310h2bbff1b_0
asttokens 2.0.5 pyhd3eb1b0_0
astunparse 1.6.3 pyhd8ed1ab_0 conda-forge
async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge
attrs 22.1.0 py310haa95532_0
babel 2.11.0 py310haa95532_0
backcall 0.2.0 pyhd3eb1b0_0
beautifulsoup4 4.11.1 py310haa95532_0
blas 1.0 mkl
bleach 4.1.0 pyhd3eb1b0_0
blinker 1.5 pyhd8ed1ab_0 conda-forge
bottleneck 1.3.5 py310h9128911_0
brotli 1.0.9 h2bbff1b_7
brotli-bin 1.0.9 h2bbff1b_7
brotlipy 0.7.0 py310h2bbff1b_1002
bzip2 1.0.8 he774522_0
ca-certificates 2022.12.7 h5b45459_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cachetools 5.3.0 pyhd8ed1ab_0 conda-forge
certifi 2022.12.7 pyhd8ed1ab_0 conda-forge
cffi 1.15.1 py310h2bbff1b_3
charset-normalizer 2.0.4 pyhd3eb1b0_0
click 8.1.3 win_pyhd8ed1ab_2 conda-forge
colorama 0.4.6 py310haa95532_0
comm 0.1.2 py310haa95532_0
cryptography 38.0.4 py310h21b164f_0
cycler 0.11.0 pyhd3eb1b0_0
debugpy 1.5.1 py310hd77b12b_0
decorator 5.1.1 pyhd3eb1b0_0
defusedxml 0.7.1 pyhd3eb1b0_0
entrypoints 0.4 py310haa95532_0
executing 0.8.3 pyhd3eb1b0_0
fftw 3.3.9 h2bbff1b_1
flatbuffers 2.0.0 h6c2663c_0
flit-core 3.6.0 pyhd3eb1b0_0
fonttools 4.25.0 pyhd3eb1b0_0
freetype 2.12.1 ha860e81_0
frozenlist 1.3.3 py310h2bbff1b_0
gast 0.4.0 pyh9f0ad1d_0 conda-forge
giflib 5.2.1 h8d14728_2 conda-forge
glib 2.69.1 h5dc1a3c_2
google-auth 2.16.0 pyh1a96a4e_1 conda-forge
google-auth-oauthlib 0.4.6 pyhd8ed1ab_0 conda-forge
google-pasta 0.2.0 pyh8c360ce_0 conda-forge
grpcio 1.42.0 py310hc60d5dd_0
gst-plugins-base 1.18.5 h9e645db_0
gstreamer 1.18.5 hd78058f_0
h5py 3.7.0 nompi_py310h00cbb18_100 conda-forge
hdf5 1.12.1 nompi_h2a0e4a3_100 conda-forge
icc_rt 2022.1.0 h6049295_2
icu 58.2 ha925a31_3
idna 3.4 py310haa95532_0
importlib-metadata 6.0.0 pyha770c72_0 conda-forge
intel-openmp 2021.4.0 haa95532_3556
ipykernel 6.19.2 py310h9909e9c_0
ipython 8.8.0 py310haa95532_0
ipython_genutils 0.2.0 pyhd3eb1b0_1
ipywidgets 7.6.5 pyhd3eb1b0_1
jedi 0.18.1 py310haa95532_1
jinja2 3.1.2 py310haa95532_0
jpeg 9e h2bbff1b_0
json5 0.9.6 pyhd3eb1b0_0
jsonschema 4.16.0 py310haa95532_0
jupyter 1.0.0 py310haa95532_8
jupyter_client 7.4.9 py310haa95532_0
jupyter_console 6.4.4 py310haa95532_0
jupyter_core 5.1.1 py310haa95532_0
jupyter_server 1.23.4 py310haa95532_0
jupyterlab 3.5.3 py310haa95532_0
jupyterlab_pygments 0.1.2 py_0
jupyterlab_server 2.16.5 py310haa95532_0
jupyterlab_widgets 1.0.0 pyhd3eb1b0_1
keras 2.10.0 py310haa95532_0 anaconda
keras-preprocessing 1.1.2 pyhd3eb1b0_0
kiwisolver 1.4.4 py310hd77b12b_0
lerc 3.0 hd77b12b_0
libbrotlicommon 1.0.9 h2bbff1b_7
libbrotlidec 1.0.9 h2bbff1b_7
libbrotlienc 1.0.9 h2bbff1b_7
libclang 12.0.0 default_h627e005_2
libcurl 7.87.0 h86230a5_0
libdeflate 1.8 h2bbff1b_5
libffi 3.4.2 hd77b12b_6
libiconv 1.16 h2bbff1b_2
libogg 1.3.5 h2bbff1b_1
libpng 1.6.37 h2a8f88b_0
libprotobuf 3.20.3 h23ce68f_0
libsodium 1.0.18 h62dcd97_0
libssh2 1.10.0 h680486a_2 conda-forge
libtiff 4.5.0 h6c2663c_1
libvorbis 1.3.7 he774522_0
libwebp 1.2.4 h2bbff1b_0
libwebp-base 1.2.4 h2bbff1b_0
libxml2 2.9.14 h0ad7f3c_0
libxslt 1.1.35 h2bbff1b_0
lxml 4.9.1 py310h1985fb9_0
lz4-c 1.9.4 h2bbff1b_0
markdown 3.4.1 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py310h2bbff1b_0
matplotlib 3.5.3 py310h5588dad_2 conda-forge
matplotlib-base 3.5.3 py310hd77b12b_0
matplotlib-inline 0.1.6 py310haa95532_0
mistune 0.8.4 py310h2bbff1b_1000
mkl 2021.4.0 haa95532_640
mkl-service 2.4.0 py310h2bbff1b_0
mkl_fft 1.3.1 py310ha0764ea_0
mkl_random 1.2.2 py310h4ed8f06_0
multidict 6.0.2 py310h2bbff1b_0
munkres 1.1.4 py_0
nbclassic 0.4.8 py310haa95532_0
nbclient 0.5.13 py310haa95532_0
nbconvert 6.5.4 py310haa95532_0
nbformat 5.7.0 py310haa95532_0
nest-asyncio 1.5.6 py310haa95532_0
notebook 6.5.2 py310haa95532_0
notebook-shim 0.2.2 py310haa95532_0
numexpr 2.8.4 py310hd213c9f_0
numpy 1.23.5 py310h60c9a35_0
numpy-base 1.23.5 py310h04254f7_0
oauthlib 3.2.2 pyhd8ed1ab_0 conda-forge
openssl 1.1.1t h2bbff1b_0
opt_einsum 3.3.0 pyhd8ed1ab_1 conda-forge
packaging 22.0 py310haa95532_0
pandas 1.5.2 py310h4ed8f06_0
pandocfilters 1.5.0 pyhd3eb1b0_0
parso 0.8.3 pyhd3eb1b0_0
pcre 8.45 hd77b12b_0
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 9.3.0 py310hd77b12b_2
pip 22.3.1 py310haa95532_0
platformdirs 2.5.2 py310haa95532_0
ply 3.11 py310haa95532_0
pooch 1.4.0 pyhd3eb1b0_0
prometheus_client 0.14.1 py310haa95532_0
prompt-toolkit 3.0.36 py310haa95532_0
prompt_toolkit 3.0.36 hd3eb1b0_0
protobuf 3.20.3 py310hd77b12b_0
psutil 5.9.0 py310h2bbff1b_0
pure_eval 0.2.2 pyhd3eb1b0_0
pyasn1 0.4.8 py_0 conda-forge
pyasn1-modules 0.2.7 py_0 conda-forge
pycparser 2.21 pyhd3eb1b0_0
pygments 2.11.2 pyhd3eb1b0_0
pyjwt 2.6.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd3eb1b0_0
pyparsing 3.0.9 py310haa95532_0
pyqt 5.15.7 py310hd77b12b_0
pyqt5-sip 12.11.0 py310hd77b12b_0
pyrsistent 0.18.0 py310h2bbff1b_0
pysocks 1.7.1 py310haa95532_0
python 3.10.9 h966fe2a_0
python-dateutil 2.8.2 pyhd3eb1b0_0
python-fastjsonschema 2.16.2 py310haa95532_0
python-flatbuffers 23.1.21 pyhd8ed1ab_0 conda-forge
python_abi 3.10 2_cp310 conda-forge
pytz 2022.7 py310haa95532_0
pyu2f 0.1.5 pyhd8ed1ab_0 conda-forge
pywin32 305 py310h2bbff1b_0
pywinpty 2.0.2 py310h5da7b33_0
pyzmq 23.2.0 py310hd77b12b_0
qt-main 5.15.2 he8e5bd7_7
qt-webengine 5.15.9 hb9a9bb5_5
qtconsole 5.4.0 pypi_0 pypi
qtpy 2.2.0 py310haa95532_0
qtwebkit 5.212 h3ad3cdb_4
requests 2.28.1 py310haa95532_0
requests-oauthlib 1.3.1 pyhd8ed1ab_0 conda-forge
rsa 4.9 pyhd8ed1ab_0 conda-forge
scipy 1.10.0 py310hb9afe5d_0
send2trash 1.8.0 pyhd3eb1b0_1
setuptools 65.6.3 py310haa95532_0
sip 6.6.2 py310hd77b12b_0
six 1.16.0 pyhd3eb1b0_1
snappy 1.1.9 h82413e6_1 conda-forge
sniffio 1.2.0 py310haa95532_1
soupsieve 2.3.2.post1 py310haa95532_0
sqlite 3.40.1 h2bbff1b_0
stack_data 0.2.0 pyhd3eb1b0_0
tensorboard 2.10.0 py310haa95532_0
tensorboard-data-server 0.6.1 py310haa95532_0
tensorboard-plugin-wit 1.8.1 pyhd8ed1ab_0 conda-forge
tensorflow 2.10.0 mkl_py310hd99672f_0
tensorflow-base 2.10.0 mkl_py310h6a7f48e_0
tensorflow-estimator 2.10.0 py310haa95532_0
termcolor 2.2.0 pyhd8ed1ab_0 conda-forge
terminado 0.17.1 py310haa95532_0
tinycss2 1.2.1 py310haa95532_0
tk 8.6.12 h2bbff1b_0
toml 0.10.2 pyhd3eb1b0_0
tomli 2.0.1 py310haa95532_0
tornado 6.2 py310h2bbff1b_0
traitlets 5.7.1 py310haa95532_0
typing-extensions 4.4.0 py310haa95532_0
typing_extensions 4.4.0 py310haa95532_0
tzdata 2022g h04d1e81_0
urllib3 1.26.14 py310haa95532_0
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
wcwidth 0.2.5 pyhd3eb1b0_0
webencodings 0.5.1 py310haa95532_1
websocket-client 0.58.0 py310haa95532_4
werkzeug 2.2.2 pyhd8ed1ab_0 conda-forge
wheel 0.37.1 pyhd3eb1b0_0
widgetsnbextension 3.5.2 py310haa95532_0
win_inet_pton 1.1.0 py310haa95532_0
wincertstore 0.2 py310haa95532_2
winpty 0.4.3 4
wrapt 1.14.1 py310he2412df_0 conda-forge
xz 5.2.10 h8cc25b3_1
yarl 1.7.2 py310he2412df_2 conda-forge
zeromq 4.3.4 hd77b12b_0
zipp 3.13.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 h8cc25b3_0
zstd
When I run my code (see just below), I got the following error: "Canceled future for execute_request message before replies were done
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details."
model = models.Sequential()
model.add(layers.Conv2D(32, (3,3), activation='relu', input_shape=(32, 32, 3))) #32 represents number of filters and (3,3) the size of the filters
model.add(layers.MaxPooling2D((2,2)))
model.add(layers.Conv2D(64, (3,3), activation='relu'))
model.add(layers.MaxPooling2D((2,2)))
model.add(layers.Conv2D(64, (3,3),activation='relu'))
The first blocks of my code (which work fine) are as followed:
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data()
#Normalize pixel values to be between 0 and 1
train_images, test_images = train_images / 255, test_images
class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
IMG_INDEX = 69
plt.imshow(train_images[IMG_INDEX], cmap=plt.cm.binary)
plt.xlabel(class_names[train_labels[IMG_INDEX][0]])
plt.show()
So I followed the instruction and tried to reinstall tensorflow. I also created a new environment to just have tensorflow and matplotlib as the modules I manually installed (fearing that other modules that I installed might interfere with the tensorflow one). I also used another environment with an older python version (3.9.16 instead of 3.10.9) Nothing worked
The instructions I followed come from github: "
If a kernel crashes when using tensorflow, this is indicative of tensorflow having been incorrectly installed into the Python Environment. Re-installing the package would resolve the issue.
If this does not work, it is also possible other dependent packages could cause the package to fall over, in such cases, its best to start out with a new environment.
Finally, when using Conda environments, please avoid using pip to install packages, instead use conda install.
Originally filed here https://github.com/microsoft/vscode-jupyter/issues/9283 and here https://github.com/microsoft/vscode-jupyter/issues/9157
Could you guys help ?

Related

Unable to run anipose due to ImportError: cannot import name 'keras_export' from 'tensorflow.python.util.tf_export'

I've been attempting to install and run anipose in Ubuntu 18.04
I keep getting the same import error though I've made sure keras is installed.
I've also searched for version compatibility because in the anipose environment setup tensorflow version is set to 1.13.1, though I see when I install everything it downloads tensorflow 2.8.0
(anipose) nimrod#msi-ubuntu:~/anipose_projects/hand-demo-unfilled$ anipose run-all
Analyzing videos...
Traceback (most recent call last):
File "/home/nimrod/anaconda3/envs/anipose/bin/anipose", line 8, in <module>
sys.exit(cli())
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/anipose.py", line 365, in run_all
pose_videos_all(config)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/common.py", line 168, in fun
return process_all(config, process_session, **args)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/common.py", line 153, in process_all
output[past_folders] = process_session(config, path, **args)
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/pose_videos.py", line 56, in process_session
import deeplabcut
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/deeplabcut/__init__.py", line 14, in <module>
import tensorflow as tf
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/__init__.py", line 30, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 82, in <module>
from tensorflow.python import keras
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/__init__.py", line 24, in <module>
from tensorflow.python.keras import activations
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/activations.py", line 24, in <module>
from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/utils/__init__.py", line 38, in <module>
from tensorflow.python.keras.utils.multi_gpu_utils import multi_gpu_model
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/utils/multi_gpu_utils.py", line 22, in <module>
from tensorflow.python.keras.engine.training import Model
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/engine/__init__.py", line 23, in <module>
from tensorflow.python.keras.engine.base_layer import Layer
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 36, in <module>
from tensorflow.python.keras import initializers
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/initializers/__init__.py", line 20, in <module>
from tensorflow.python.keras.initializers import initializers_v1
File "/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/keras/initializers/initializers_v1.py", line 19, in <module>
from tensorflow.python.util.tf_export import keras_export
ImportError: cannot import name 'keras_export' from 'tensorflow.python.util.tf_export' (/home/nimrod/anaconda3/envs/anipose/lib/python3.7/site-packages/tensorflow/python/util/tf_export.py)
(anipose) nimrod#msi-ubuntu:~/anipose_projects/hand-demo-unfilled$ conda list
# packages in environment at /home/nimrod/anaconda3/envs/anipose:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 4.5 1_gnu
_tflow_select 2.3.0 mkl
absl-py 0.15.0 pyhd3eb1b0_0
anipose 1.0.1 pypi_0 pypi
aniposelib 0.4.3 pypi_0 pypi
apptools 5.1.0 pyhd3eb1b0_0
argon2-cffi 21.3.0 pyhd3eb1b0_0
argon2-cffi-bindings 21.2.0 py37h7f8727e_0
astor 0.8.1 py37h06a4308_0
astunparse 1.6.3 pypi_0 pypi
attrs 21.4.0 pyhd3eb1b0_0
backcall 0.2.0 pyhd3eb1b0_0
beautifulsoup4 4.11.1 py37h06a4308_0
blas 1.0 mkl
bleach 4.1.0 pyhd3eb1b0_0
brotli 1.0.9 pypi_0 pypi
bzip2 1.0.8 h7b6447c_0
c-ares 1.18.1 h7f8727e_0
ca-certificates 2022.3.29 h06a4308_1
cached-property 1.5.2 py_0
cachetools 5.0.0 pypi_0 pypi
certifi 2021.10.8 py37h06a4308_2
cffi 1.15.0 py37hd667e15_1
charset-normalizer 2.0.12 pypi_0 pypi
click 8.1.2 pypi_0 pypi
configobj 5.0.6 py37h06a4308_1
curl 7.82.0 h7f8727e_0
cycler 0.11.0 pypi_0 pypi
dataclasses 0.8 pyh6d0b6a4_7
dbus 1.13.18 hb2f20db_0
debugpy 1.5.1 py37h295c915_0
decorator 5.1.1 pyhd3eb1b0_0
deeplabcut 2.2.1 pypi_0 pypi
defusedxml 0.7.1 pyhd3eb1b0_0
entrypoints 0.4 py37h06a4308_0
envisage 6.0.1 pyhd3eb1b0_0
expat 2.4.4 h295c915_0
ffmpeg 4.2.2 h20bf706_0
filterpy 1.4.5 pypi_0 pypi
flask 2.1.1 pypi_0 pypi
flask-compress 1.12 pypi_0 pypi
flask-ipban 1.1.5 pypi_0 pypi
flatbuffers 2.0 pypi_0 pypi
fontconfig 2.13.1 h6c09931_0
fonttools 4.33.3 pypi_0 pypi
freetype 2.11.0 h70c0345_0
future 0.18.2 py37_1
gast 0.5.3 pyhd3eb1b0_0
glib 2.69.1 h4ff587b_1
gmp 6.2.1 h2531618_2
gnutls 3.6.15 he1e5248_0
google-auth 2.6.6 pypi_0 pypi
google-auth-oauthlib 0.4.6 pypi_0 pypi
google-pasta 0.2.0 pypi_0 pypi
grpcio 1.42.0 py37hce63b2e_0
gst-plugins-base 1.14.0 h8213a91_2
gstreamer 1.14.0 h28cd5cc_2
h5py 2.10.0 py37h7918eee_0
hdf4 4.2.13 h3ca952b_2
hdf5 1.10.4 hb1b8bf9_0
icu 58.2 he6710b0_3
idna 3.3 pypi_0 pypi
imageio 2.18.0 pypi_0 pypi
imgaug 0.4.0 pypi_0 pypi
importlib-metadata 4.11.3 py37h06a4308_0
importlib-resources 5.7.1 pypi_0 pypi
importlib_metadata 4.11.3 hd3eb1b0_0
importlib_resources 5.2.0 pyhd3eb1b0_1
intel-openmp 2021.4.0 h06a4308_3561
ipykernel 6.9.1 py37h06a4308_0
ipython 7.32.0 pypi_0 pypi
ipython_genutils 0.2.0 pyhd3eb1b0_1
ipywidgets 7.6.5 pyhd3eb1b0_1
itsdangerous 2.1.2 pypi_0 pypi
jedi 0.18.1 py37h06a4308_1
jinja2 3.1.1 pypi_0 pypi
joblib 1.1.0 pypi_0 pypi
jpeg 9e h7f8727e_0
jsoncpp 1.9.4 hff7bd54_2
jsonschema 4.4.0 py37h06a4308_0
jupyter 1.0.0 py37_7
jupyter_client 7.2.2 py37h06a4308_0
jupyter_console 6.4.3 pyhd3eb1b0_0
jupyter_core 4.9.2 py37h06a4308_0
jupyterlab_pygments 0.1.2 py_0
jupyterlab_widgets 1.0.0 pyhd3eb1b0_1
keras 2.8.0 pypi_0 pypi
keras-applications 1.0.8 py_1
keras-base 2.3.1 py37_0
keras-preprocessing 1.1.2 pyhd3eb1b0_0
kiwisolver 1.4.2 pypi_0 pypi
krb5 1.19.2 hac12032_0
lame 3.100 h7b6447c_0
ld_impl_linux-64 2.35.1 h7274673_9
libclang 14.0.1 pypi_0 pypi
libcurl 7.82.0 h0b77cf5_0
libedit 3.1.20210910 h7f8727e_0
libev 4.33 h7f8727e_1
libffi 3.3 he6710b0_2
libgcc-ng 9.3.0 h5101ec6_17
libgfortran-ng 7.5.0 ha8ba4b0_17
libgfortran4 7.5.0 ha8ba4b0_17
libgomp 9.3.0 h5101ec6_17
libidn2 2.3.2 h7f8727e_0
libnetcdf 4.6.1 h11d0813_2
libnghttp2 1.46.0 hce63b2e_0
libogg 1.3.5 h27cfd23_1
libopus 1.3.1 h7b6447c_0
libpng 1.6.37 hbc83047_0
libprotobuf 3.19.1 h4ff587b_0
libsodium 1.0.18 h7b6447c_0
libssh2 1.10.0 h8f2d780_0
libstdcxx-ng 9.3.0 hd4cf53a_17
libtasn1 4.16.0 h27cfd23_0
libtheora 1.1.1 h7f8727e_3
libtiff 4.1.0 h2733197_0
libunistring 0.9.10 h27cfd23_0
libuuid 1.0.3 h7f8727e_2
libvorbis 1.3.7 h7b6447c_0
libvpx 1.7.0 h439df22_0
libxcb 1.14 h7b6447c_0
libxml2 2.9.12 h03d6c58_0
llvmlite 0.38.0 pypi_0 pypi
lz4-c 1.8.1.2 h14c3975_0
markdown 3.3.4 py37h06a4308_0
markupsafe 2.1.1 pypi_0 pypi
matplotlib 3.5.1 pypi_0 pypi
matplotlib-inline 0.1.3 pypi_0 pypi
mayavi 4.7.1 py37h94891b3_2
mistune 0.8.4 py37h14c3975_1001
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py37h7f8727e_0
mkl_fft 1.3.1 py37hd3c417c_0
mkl_random 1.2.2 py37h51133e4_0
mock 4.0.3 pyhd3eb1b0_0
msgpack 1.0.3 pypi_0 pypi
msgpack-numpy 0.4.7.1 pypi_0 pypi
nbclient 0.5.13 py37h06a4308_0
nbconvert 6.4.4 py37h06a4308_0
nbformat 5.3.0 py37h06a4308_0
ncurses 6.3 h7f8727e_2
nest-asyncio 1.5.5 py37h06a4308_0
nettle 3.7.3 hbbd107a_1
networkx 2.6.3 pypi_0 pypi
notebook 6.4.8 py37h06a4308_0
numba 0.55.1 pypi_0 pypi
numexpr 2.8.1 pypi_0 pypi
numpy 1.21.5 py37he7a7128_1
numpy-base 1.21.5 py37hf524024_1
oauthlib 3.2.0 pypi_0 pypi
opencv-contrib-python 4.5.5.64 pypi_0 pypi
opencv-python 4.5.5.64 pypi_0 pypi
openh264 2.1.1 h4ff587b_0
openssl 1.1.1n h7f8727e_0
opt-einsum 3.3.0 pypi_0 pypi
packaging 21.3 pyhd3eb1b0_0
pandas 1.3.5 pypi_0 pypi
pandocfilters 1.5.0 pyhd3eb1b0_0
parso 0.8.3 pyhd3eb1b0_0
patsy 0.5.2 pypi_0 pypi
pcre 8.45 h295c915_0
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 9.1.0 pypi_0 pypi
pip 21.2.2 py37h06a4308_0
pip-autoremove 0.10.0 pypi_0 pypi
prometheus_client 0.13.1 pyhd3eb1b0_0
prompt-toolkit 3.0.29 pypi_0 pypi
prompt_toolkit 3.0.20 hd3eb1b0_0
protobuf 3.19.1 py37h295c915_0
psutil 5.9.0 pypi_0 pypi
ptyprocess 0.7.0 pyhd3eb1b0_2
pyasn1 0.4.8 pypi_0 pypi
pyasn1-modules 0.2.8 pypi_0 pypi
pycparser 2.21 pyhd3eb1b0_0
pyface 7.3.0 py37h06a4308_1
pygments 2.12.0 pypi_0 pypi
pyparsing 3.0.8 pypi_0 pypi
pyqt 5.9.2 py37h05f1152_2
pyrsistent 0.18.0 py37heee7806_0
python 3.7.13 h12debd9_0
python-dateutil 2.8.2 pyhd3eb1b0_0
python-fastjsonschema 2.15.1 pyhd3eb1b0_0
pytz 2022.1 pypi_0 pypi
pywavelets 1.3.0 pypi_0 pypi
pyyaml 6.0 pypi_0 pypi
pyzmq 22.3.0 py37h295c915_2
qt 5.9.7 h5867ecd_1
qtconsole 5.3.0 pyhd3eb1b0_0
qtpy 2.0.1 pyhd3eb1b0_0
readline 8.1.2 h7f8727e_1
requests 2.27.1 pypi_0 pypi
requests-oauthlib 1.3.1 pypi_0 pypi
rsa 4.8 pypi_0 pypi
ruamel-yaml 0.17.21 pypi_0 pypi
ruamel-yaml-clib 0.2.6 pypi_0 pypi
scikit-image 0.18.1 pypi_0 pypi
scikit-learn 1.0.2 pypi_0 pypi
scikit-video 1.1.11 pypi_0 pypi
scipy 1.7.3 py37hc147768_0
send2trash 1.8.0 pyhd3eb1b0_1
setuptools 61.2.0 py37h06a4308_0
shapely 1.8.1.post1 pypi_0 pypi
sip 4.19.8 py37hf484d3e_0
six 1.16.0 pyhd3eb1b0_1
soupsieve 2.3.1 pyhd3eb1b0_0
sqlite 3.38.2 hc218d9a_0
statsmodels 0.13.1 pypi_0 pypi
tables 3.7.0 pypi_0 pypi
tabulate 0.8.9 pypi_0 pypi
tbb 2021.5.0 hd09550d_0
tensorboard 2.8.0 pypi_0 pypi
tensorboard-data-server 0.6.1 pypi_0 pypi
tensorboard-plugin-wit 1.8.1 pypi_0 pypi
tensorflow 2.8.0 pypi_0 pypi
tensorflow-base 1.13.1 mkl_py37h7ce6ba3_0
tensorflow-estimator 1.13.0 py_0
tensorflow-io-gcs-filesystem 0.25.0 pypi_0 pypi
tensorpack 0.11 pypi_0 pypi
termcolor 1.1.0 py37h06a4308_1
terminado 0.13.1 py37h06a4308_0
testpath 0.5.0 pyhd3eb1b0_0
tf-estimator-nightly 2.8.0.dev2021122109 pypi_0 pypi
tf-slim 1.1.0 pypi_0 pypi
threadpoolctl 3.1.0 pypi_0 pypi
tifffile 2021.11.2 pypi_0 pypi
tk 8.6.11 h1ccaba5_0
toml 0.10.2 pypi_0 pypi
tornado 6.1 py37h27cfd23_0
tqdm 4.64.0 pypi_0 pypi
traitlets 5.1.1 pyhd3eb1b0_0
traits 6.2.0 py37h27cfd23_0
traitsui 7.2.1 pyhd3eb1b0_0
typing-extensions 4.1.1 hd3eb1b0_0
typing_extensions 4.1.1 pyh06a4308_0
urllib3 1.26.9 pypi_0 pypi
vtk 8.2.0 py37haa4764d_200
wcwidth 0.2.5 pyhd3eb1b0_0
webencodings 0.5.1 py37_1
werkzeug 2.0.3 pyhd3eb1b0_0
wheel 0.37.1 pyhd3eb1b0_0
widgetsnbextension 3.5.2 py37h06a4308_0
wrapt 1.14.0 pypi_0 pypi
wxpython 4.1.1 pypi_0 pypi
x264 1!157.20191217 h7b6447c_0
xz 5.2.5 h7b6447c_0
yaml 0.2.5 h7b6447c_0
zeromq 4.3.4 h2531618_0
zipp 3.7.0 pyhd3eb1b0_0
zlib 1.2.12 h7f8727e_2
zstd 1.3.7 h0b5b093_0
Tell me if there's any more information I can add
anipose supports Tensorflow 1.13.1.
pip install tensorflow==1.13.1
Below import works fine with Tf v2.8.0
from tensorflow.python.util.tf_export import keras_export
Make sure you have installed compatible version between anipose and Tensorflow.

Matplotlib plots won't display with sublime text and conda

I have set up and activated conda virtual environment that I use in Sublime Text 3. I have installed matplotlib into my conda virtual environment. When I try to generate a simple plot with the Conda build system, no plot is displayed and the code finishes running. I've tried editing the "Conda (Windows).sublime-settings" file to set "run_through_shell" to true but that hasn't fixed the problem. I've also tried adding "shell": true to the "Preferences.sublime-settings" but that hasn't worked either.
Edit: Matplotlib will plot when I import torch, but not when I don't have torch imported. Is there a dependency that comes along with torch that allows plots to be displayed?
Edit2: Here is the output of conda list for my virtual env:
# packages in environment at C:\Users\noami\anaconda3\envs\practice:
#
# Name Version Build Channel
blas 1.0 mkl
brotli 1.0.9 ha925a31_2
ca-certificates 2022.2.1 haa95532_0
certifi 2021.10.8 py39haa95532_2
cudatoolkit 10.2.89 h74a9793_1
cycler 0.11.0 pyhd3eb1b0_0
fonttools 4.25.0 pyhd3eb1b0_0
freetype 2.10.4 hd328e21_0
icu 58.2 ha925a31_3
intel-openmp 2021.4.0 haa95532_3556
jpeg 9d h2bbff1b_0
kiwisolver 1.3.2 py39hd77b12b_0
libpng 1.6.37 h2a8f88b_0
libtiff 4.2.0 hd0e1b90_0
libuv 1.40.0 he774522_0
libwebp 1.2.2 h2bbff1b_0
lz4-c 1.9.3 h2bbff1b_1
matplotlib 3.5.1 py39haa95532_0
matplotlib-base 3.5.1 py39hd77b12b_0
mkl 2021.4.0 haa95532_640
mkl-service 2.4.0 py39h2bbff1b_0
mkl_fft 1.3.1 py39h277e83a_0
mkl_random 1.2.2 py39hf11a4ad_0
munkres 1.1.4 py_0
numpy 1.21.5 py39ha4e8547_0
numpy-base 1.21.5 py39hc2deb75_0
olefile 0.46 pyhd3eb1b0_0
openssl 1.1.1m h2bbff1b_0
packaging 21.3 pyhd3eb1b0_0
pillow 8.4.0 py39hd45dc43_0
pip 21.2.4 py39haa95532_0
pyparsing 3.0.4 pyhd3eb1b0_0
pyqt 5.9.2 py39hd77b12b_6
python 3.9.7 h6244533_1
python-dateutil 2.8.2 pyhd3eb1b0_0
pytorch 1.10.2 py3.9_cuda10.2_cudnn7_0 pytorch
pytorch-mutex 1.0 cuda pytorch
qt 5.9.7 vc14h73c81de_0
setuptools 58.0.4 py39haa95532_0
sip 4.19.13 py39hd77b12b_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.37.2 h2bbff1b_0
tk 8.6.11 h2bbff1b_0
torchaudio 0.10.2 py39_cu102 pytorch
torchvision 0.11.3 py39_cu102 pytorch
tornado 6.1 py39h2bbff1b_0
typing_extensions 3.10.0.2 pyh06a4308_0
tzdata 2021e hda174b7_0
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
wheel 0.37.1 pyhd3eb1b0_0
wincertstore 0.2 py39haa95532_2
xz 5.2.5 h62dcd97_0
zlib 1.2.11 h8cc25b3_4
zstd 1.4.9 h19a0ad4_0
When I run this code, I don't get a plot:
import matplotlib.pyplot as plt
plt.plot([1,2,3,4,5])
plt.show()
print("Done!")
However when I run this code, I DO get a plot:
import matplotlib.pyplot as plt
import torch
plt.plot([1,2,3,4,5])
plt.show()
print("Done!")

Google Cloud TPU: capture_tpu_profile: No trace event is collected after N attempt(s)

While following Cloud TPU profiling guide and Bert FineTuning, I got error when creating Profile data.
Scalars and Graphs in TensorBoards are working well.
Is there anything I'm missing?
Configurations
Zone: us-central1-a(Both for Storage and TPU)
TPU Type: v3-8
TPU software version: tpu-vm-tf-2.7.0
TPU Architecture: TPU VM
Error log
Using CLI
(Run when training is process)
> capture_tpu_profile --tpu=bert-tpu --logdir=${MODEL_DIR} --duration_ms=3000
2022-01-20 06:34:29.301737: I tensorflow/core/tpu/tpu_initializer_helper.cc:68] libtpu.so already in used by another process. Not attempting to load libtpu.so in this process.
2022-01-20 06:34:29.301787: I tensorflow/core/tpu/tpu_api_dlsym_initializer.cc:116] Libtpu path is: libtpu.so
WARNING: Logging before InitGoogle() is written to STDERR
I0120 06:34:29.324573 67944 tpu_initializer_helper.cc:68] libtpu.so already in used by another process. Not attempting to load libtpu.so in this process.
2022-01-20 06:34:29.336671: I tensorflow/core/tpu/tpu_initializer_helper.cc:68] libtpu.so already in used by another process. Not attempting to load libtpu.so in this process.
2022-01-20 06:34:31.607899: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (4 tries left)
2022-01-20 06:34:32.608170: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (3 tries left)
2022-01-20 06:34:33.608461: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (2 tries left)
2022-01-20 06:34:34.608757: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:77] No TPU platform registered. Waiting 1 second and trying again... (1 tries left)
2022-01-20 06:34:35.609050: I tensorflow/stream_executor/tpu/tpu_platform_interface.cc:74] No TPU platform found.
TensorFlow version 2.7.0 detected
Welcome to the Cloud TPU Profiler v2.4.0
I0120 06:34:35.628104 140127504198720 discovery.py:280] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/tpu/v1/rest
I0120 06:34:35.709828 140127504198720 discovery.py:911] URL being requested: GET https://tpu.googleapis.com/v1/projects/elsa-270714/locations/us-central1-a/nodes/bert-tpu?alt=json
I0120 06:34:35.710047 140127504198720 transport.py:157] Attempting refresh to obtain initial access_token
I0120 06:34:35.710207 140127504198720 client.py:777] Refreshing access_token
I0120 06:34:35.806093 140127504198720 discovery.py:280] URL being requested: GET https://www.googleapis.com/discovery/v1/apis/tpu/v1/rest
I0120 06:34:35.838788 140127504198720 discovery.py:911] URL being requested: GET https://tpu.googleapis.com/v1/projects/elsa-270714/locations/us-central1-a/nodes/bert-tpu?alt=json
I0120 06:34:35.838929 140127504198720 transport.py:157] Attempting refresh to obtain initial access_token
I0120 06:34:35.839013 140127504198720 client.py:777] Refreshing access_token
Starting to trace for 3000 ms. Remaining attempt(s): 2
No trace event is collected. Automatically retrying.
Starting to trace for 3000 ms. Remaining attempt(s): 1
No trace event is collected. Automatically retrying.
Starting to trace for 3000 ms. Remaining attempt(s): 0
No trace event is collected after 3 attempt(s). Perhaps, you want to try again (with more attempts?).
Tip: increase number of attempts with --num_tracing_attempts.
Using TensorBoard
(TPU name: bert-tpu)
Packages
> pip3 list
Package Version
--------------------------------- --------------------
absl-py 0.12.0
anyio 3.5.0
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asttokens 2.0.5
astunparse 1.6.3
attrs 19.3.0
Automat 0.8.0
Babel 2.9.1
backcall 0.2.0
backports.entry-points-selectable 1.1.1
black 21.12b0
bleach 4.1.0
blinker 1.4
cachetools 4.2.4
certifi 2021.10.8
cffi 1.15.0
chardet 3.0.4
charset-normalizer 2.0.7
click 8.0.3
cloud-init 21.4
cloud-tpu-client 0.10
cloud-tpu-profiler 2.4.0
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
constantly 15.1.0
cryptography 2.8
cycler 0.11.0
Cython 0.29.24
dbus-python 1.2.16
debugpy 1.5.1
decorator 5.1.1
defusedxml 0.7.1
dill 0.3.4
distlib 0.3.3
distro 1.4.0
distro-info 0.23ubuntu1
dm-tree 0.1.6
entrypoints 0.3
executing 0.8.2
filelock 3.4.0
flatbuffers 2.0
fonttools 4.28.5
future 0.18.2
gast 0.4.0
gin-config 0.5.0
google-api-core 1.31.4
google-api-python-client 1.8.0
google-auth 1.35.0
google-auth-httplib2 0.1.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
googleapis-common-protos 1.53.0
grpcio 1.42.0
gviz-api 1.10.0
h5py 3.6.0
httplib2 0.20.2
hyperlink 19.0.0
idna 3.3
importlib-metadata 4.8.2
importlib-resources 5.4.0
incremental 16.10.1
intel-openmp 2021.4.0
ipykernel 6.7.0
ipython 8.0.0
ipython-genutils 0.2.0
jax 0.2.25
jaxlib 0.1.74
jedi 0.18.1
Jinja2 2.10.1
joblib 1.1.0
json5 0.9.6
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
jupyter-client 7.1.1
jupyter-core 4.9.1
jupyter-server 1.13.3
jupyterlab 3.2.8
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
kaggle 1.5.12
keras 2.7.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.2
keyring 18.0.1
kiwisolver 1.3.2
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
libclang 12.0.0
Markdown 3.3.6
MarkupSafe 1.1.0
matplotlib 3.5.1
matplotlib-inline 0.1.3
mistune 0.8.4
mkl 2021.4.0
mkl-include 2021.4.0
mock 4.0.3
more-itertools 4.2.0
mypy-extensions 0.4.3
nbclassic 0.3.5
nbclient 0.5.10
nbconvert 6.4.0
nbformat 5.1.3
nest-asyncio 1.5.4
netifaces 0.10.4
notebook 6.4.7
numpy 1.18.5
oauth2client 4.1.3
oauthlib 3.1.0
opencv-python-headless 4.5.5.62
opt-einsum 3.3.0
packaging 21.3
pandas 1.3.5
pandocfilters 1.5.0
parso 0.8.3
pathspec 0.9.0
pexpect 4.6.0
pickleshare 0.7.5
Pillow 8.4.0
pip 21.3.1
platformdirs 2.4.0
portalocker 2.3.2
prometheus-client 0.12.0
promise 2.3
prompt-toolkit 3.0.24
protobuf 3.19.1
psutil 5.9.0
ptyprocess 0.7.0
pure-eval 0.2.1
py-cpuinfo 8.0.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycocotools 2.0.4
pycparser 2.21
Pygments 2.11.2
PyGObject 3.36.0
PyHamcrest 1.9.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyparsing 3.0.6
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.6
python-dateutil 2.8.2
python-debian 0.1.36ubuntu1
python-slugify 5.0.2
pytz 2021.3
PyYAML 5.4.1
pyzmq 22.3.0
regex 2022.1.18
requests 2.26.0
requests-oauthlib 1.3.0
requests-unixsocket 0.2.0
rsa 4.7.2
sacrebleu 2.0.0
scikit-learn 1.0.2
scipy 1.7.2
SecretStorage 2.3.1
Send2Trash 1.8.0
sentencepiece 0.1.96
seqeval 1.2.2
service-identity 18.1.0
setuptools 59.2.0
simplejson 3.16.0
six 1.16.0
sniffio 1.2.0
sos 4.1
ssh-import-id 5.10
stack-data 0.1.4
systemd-python 234
tabulate 0.8.9
tbb 2021.4.0
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-profile 2.5.0
tensorboard-plugin-wit 1.8.0
tensorflow 2.7.0
tensorflow-addons 0.15.0
tensorflow-datasets 4.4.0
tensorflow-estimator 2.7.0
tensorflow-hub 0.12.0
tensorflow-io-gcs-filesystem 0.22.0
tensorflow-metadata 1.5.0
tensorflow-model-optimization 0.7.0
tensorflow-text 2.7.0rc1
termcolor 1.1.0
terminado 0.12.1
testpath 0.5.0
text-unidecode 1.3
tf-slim 1.1.0
threadpoolctl 3.0.0
tomli 1.2.3
torch 1.11.0a0+git4635f57
torch-xla 1.11+73a3937
torchvision 0.12.0a0+59baae9
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
Twisted 18.9.0
typeguard 2.13.3
typing_extensions 4.0.0
ubuntu-advantage-tools 27.4
ufw 0.36
unattended-upgrades 0.1
uritemplate 3.0.1
urllib3 1.26.7
virtualenv 20.10.0
wadllib 1.3.3
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.2.3
Werkzeug 2.0.2
wheel 0.34.2
wrapt 1.13.3
zipp 3.7.0
zope.interface 4.7.1
Unfortunately capture_tpu_profile doesn't work with TPU VM.
If you're using TF2/Keras, one very accessible way is to use the TensorBoard Callback and set profile_batch=1 for instance. This would work for v3-8 but unfortunately wouldn't work for >v3-8.
Alternatively, you can use tf.profiler.experimental.start(...) and tf.profiler.experimental.stop() which is what the TensorBoard callback uses under the hood.
If you're using >v3-8 (for instance v3-32) you can use tf.profiler.experimental.client.trace() where service_addr is accessible from TPUClusterResolver's get_master() function.

why tensorflow-gpu 2.3.0 is not avaiable to install for linux using conda

A while ago I've installed tensorflow-gpu using : conda install -c anaconda tensorflow-gpu which installed the version 2.3.0 on my Linux machine. Now I need to reinstall the library in a new conda environment and just found out the version is not available anymore in conda packages. Why is that and is there a way that I can install this specific version using conda again?
this is the result of conda list in my old environment which might be helpful:
# packages in environment at /home/marzi/anaconda3/envs/nc_gpu:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_tflow_select 2.1.0 gpu
absl-py 0.11.0 pyhd3eb1b0_1
aiohttp 3.7.3 py36h27cfd23_1
astor 0.8.1 py36_0
astunparse 1.6.3 pypi_0 pypi
async-timeout 3.0.1 py36_0
attrs 20.3.0 pyhd3eb1b0_0
beautifulsoup4 4.9.3 pypi_0 pypi
blas 1.0 mkl
blinker 1.4 py36_0
blis 0.4.1 pypi_0 pypi
brotlipy 0.7.0 py36h27cfd23_1003
bs4 0.0.1 pypi_0 pypi
c-ares 1.17.1 h27cfd23_0
ca-certificates 2020.12.8 h06a4308_0
cachetools 4.2.0 pyhd3eb1b0_0
catalogue 1.0.0 pypi_0 pypi
certifi 2020.12.5 py36h06a4308_0
cffi 1.14.4 py36h261ae71_0
chardet 3.0.4 py36h06a4308_1003
click 7.1.2 py_0
cryptography 2.9.2 py36h1ba5d50_0
cudatoolkit 10.1.243 h6bb024c_0
cudnn 7.6.5 cuda10.1_0
cupti 10.1.168 0
cycler 0.10.0 pypi_0 pypi
cymem 2.0.5 pypi_0 pypi
cython 0.29.21 pypi_0 pypi
dataclasses 0.8 pypi_0 pypi
emoji 0.6.0 pypi_0 pypi
filelock 3.0.12 pypi_0 pypi
flake8 3.5.0 pypi_0 pypi
gast 0.3.3 pypi_0 pypi
gensim 3.8.3 pypi_0 pypi
google-auth 1.24.0 pyhd3eb1b0_0
google-auth-oauthlib 0.4.2 pyhd3eb1b0_2
google-pasta 0.2.0 py_0
grpcio 1.32.0 pypi_0 pypi
h5py 2.10.0 py36hd6299e0_1
hazm 0.7.0 pypi_0 pypi
hdf5 1.10.6 hb1b8bf9_0
idna 2.10 py_0
idna_ssl 1.1.0 py36_0
importlib-metadata 2.0.0 py_1
iniconfig 1.1.1 pypi_0 pypi
intel-openmp 2020.2 254
joblib 0.17.0 pypi_0 pypi
jsonschema 3.0.2 pypi_0 pypi
keras-applications 1.0.8 py_1
keras-preprocessing 1.1.2 pypi_0 pypi
kiwisolver 1.3.1 pypi_0 pypi
ld_impl_linux-64 2.33.1 h53a641e_7
libedit 3.1.20191231 h14c3975_1
libffi 3.3 he6710b0_2
libgcc-ng 9.1.0 hdf63c60_0
libgfortran-ng 7.3.0 hdf63c60_0
libprotobuf 3.13.0.1 hd408876_0
libstdcxx-ng 9.1.0 hdf63c60_0
libwapiti 0.2.1 pypi_0 pypi
markdown 3.3.3 py36h06a4308_0
matplotlib 3.3.3 pypi_0 pypi
mccabe 0.6.1 pypi_0 pypi
mkl 2020.2 256
mkl-service 2.3.0 py36he8ac12f_0
mkl_fft 1.2.0 py36h23d657b_0
mkl_random 1.1.1 py36h0573a6f_0
mock 2.0.0 pypi_0 pypi
multidict 4.7.6 py36h7b6447c_1
murmurhash 1.0.5 pypi_0 pypi
ncurses 6.2 he6710b0_1
nltk 3.3 pypi_0 pypi
numpy 1.18.5 pypi_0 pypi
oauthlib 3.1.0 py_0
openssl 1.1.1i h27cfd23_0
opt-einsum 3.3.0 pypi_0 pypi
packaging 20.8 pypi_0 pypi
pandas 1.1.5 pypi_0 pypi
pbr 5.5.1 pypi_0 pypi
pillow 8.0.1 pypi_0 pypi
pip 20.3.3 py36h06a4308_0
plac 1.1.3 pypi_0 pypi
pluggy 0.13.1 pypi_0 pypi
preshed 3.0.5 pypi_0 pypi
protobuf 3.13.0.1 py36he6710b0_1
py 1.10.0 pypi_0 pypi
pyasn1 0.4.8 py_0
pyasn1-modules 0.2.8 py_0
pycodestyle 2.3.1 pypi_0 pypi
pycparser 2.20 py_2
pydot 1.4.1 pypi_0 pypi
pyflakes 1.6.0 pypi_0 pypi
pyjwt 2.0.0 py36h06a4308_0
pyopenssl 20.0.1 pyhd3eb1b0_1
pyparsing 2.4.7 pypi_0 pypi
pyrsistent 0.17.3 pypi_0 pypi
pysocks 1.7.1 py36h06a4308_0
pytest 6.2.0 pypi_0 pypi
pytest-timeout 1.4.2 pypi_0 pypi
python 3.6.12 hcff3b4d_2
python-dateutil 2.8.1 pypi_0 pypi
pytz 2020.4 pypi_0 pypi
readline 8.0 h7b6447c_0
regex 2020.11.13 pypi_0 pypi
requests 2.25.1 pyhd3eb1b0_0
requests-oauthlib 1.3.0 py_0
rsa 4.6 py_0
sacremoses 0.0.43 pypi_0 pypi
scikit-learn 0.23.2 pypi_0 pypi
scipy 1.4.1 pypi_0 pypi
sentencepiece 0.1.94 pypi_0 pypi
setuptools 51.0.0 py36h06a4308_2
six 1.15.0 py36h06a4308_0
sklearn 0.0 pypi_0 pypi
smart-open 4.0.1 pypi_0 pypi
soupsieve 2.2 pypi_0 pypi
sqlite 3.33.0 h62c20be_0
srsly 1.0.5 pypi_0 pypi
tensorboard 2.4.0 pypi_0 pypi
tensorboard-plugin-wit 1.6.0 py_0
tensorflow 2.4.0 pypi_0 pypi
tensorflow-addons 0.12.1 pypi_0 pypi
tensorflow-estimator 2.3.0 pypi_0 pypi
tensorflow-gpu 2.3.0 pypi_0 pypi
termcolor 1.1.0 py36_1
thinc 7.4.1 pypi_0 pypi
threadpoolctl 2.1.0 pypi_0 pypi
tk 8.6.10 hbc83047_0
tokenizers 0.9.4 pypi_0 pypi
toml 0.10.2 pypi_0 pypi
tqdm 4.54.1 pypi_0 pypi
transformers 4.1.1 pypi_0 pypi
typeguard 2.12.0 pypi_0 pypi
typing-extensions 3.7.4.3 0
typing_extensions 3.7.4.3 py_0
urllib3 1.26.2 pyhd3eb1b0_0
wasabi 0.8.0 pypi_0 pypi
werkzeug 1.0.1 py_0
wheel 0.36.2 pyhd3eb1b0_0
wrapt 1.12.1 py36h7b6447c_1
xz 5.2.5 h7b6447c_0
yarl 1.5.1 py36h7b6447c_0
zipp 3.4.0 pyhd3eb1b0_0
zlib 1.2.11 h7b6447c_3

Can't run Pandas in R via reticulate: lxml not found

I'm trying to scrape a wiki table in Python from within RStudio (in Rmarkdown) via reticulate. I can't manage to do it with R (tried rvest but the columns end up being misaligned and I can't figure out exactly why) which is why I'm using Python: I have a r-reticulate Conda env and installed BeautifulSoup and requests.
The code I've written runs flawlessly in my Jupyter notebook running the r-reticulate kernel.
However, when I try to run it in RStudio, I get an ImportError saying lxml was not found. Which can't be, because it is there as you can see at the bottom with conda list (and as evidenced by my working notebook).
Here is my full code:
```{r libraries, include=FALSE}
library(reticulate)
use_condaenv("r-reticulate", required = TRUE)
```
```{python results="hide"}
import pandas as pd
import requests
from bs4 import BeautifulSoup
```
```{python}
url = "https://en.wikipedia.org/wiki/COVID-19_lockdowns"
req = requests.get(url)
soup = BeautifulSoup(req.text, "html.parser")
table = soup.find("table", {"class": "wikitable"})
dfs = pd.read_html(str(table)) # this is the line that generates the error
df = dfs[0]
df.head(20)
```
This is the error output from the last chunk:
ImportError: lxml not found, please install it
Detailed traceback:
File "<string>", line 1, in <module>
File "C:\PROGRA~3\ANACON~1\envs\R-RETI~1\lib\site-packages\pandas\util\_decorators.py", line 299, in wrapper
return func(*args, **kwargs)
File "C:\PROGRA~3\ANACON~1\envs\R-RETI~1\lib\site-packages\pandas\io\html.py", line 1100, in read_html
displayed_only=displayed_only,
File "C:\PROGRA~3\ANACON~1\envs\R-RETI~1\lib\site-packages\pandas\io\html.py", line 889, in _parse
parser = _parser_dispatch(flav)
File "C:\PROGRA~3\ANACON~1\envs\R-RETI~1\lib\site-packages\pandas\io\html.py", line 846, in _parser_dispatch
raise ImportError("lxml not found, please install it")
The env name is truncated (R-RETI~1) but I don't have any other env starting with this name, so I'm sure that it is the correct env. py_config() also shows that it is the correct env being used. I don't understand what is going on, or which component is not behaving correctly (is it coming from reticulate?)...
python: C:/ProgramData/Anaconda3/envs/r-reticulate/python.exe
libpython: C:/ProgramData/Anaconda3/envs/r-reticulate/python37.dll
pythonhome: C:/ProgramData/Anaconda3/envs/r-reticulate
version: 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:37:01) [MSC v.1916 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/ProgramData/Anaconda3/envs/r-reticulate/Lib/site-packages/numpy
numpy_version: 1.20.1
NOTE: Python version was forced by use_python function
Output of conda list:
(r-reticulate) C:\[...]>conda list
# packages in environment at C:\ProgramData\Anaconda3\envs\r-reticulate:
#
# Name Version Build Channel
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
beautifulsoup4 4.9.3 pyhb0f4dca_0 conda-forge
brotlipy 0.7.0 py37hcc03f2d_1001 conda-forge
bs4 4.9.3 0 conda-forge
ca-certificates 2020.12.5 h5b45459_0 conda-forge
certifi 2020.12.5 py37h03978a9_1 conda-forge
cffi 1.14.5 py37hd8e9650_0 conda-forge
chardet 4.0.0 py37h03978a9_1 conda-forge
colorama 0.4.4 pyh9f0ad1d_0 conda-forge
cryptography 3.4.6 py37h20c650d_0 conda-forge
cycler 0.10.0 py_2 conda-forge
decorator 4.4.2 py_0 conda-forge
freetype 2.10.4 h546665d_1 conda-forge
icu 68.1 h0e60522_0 conda-forge
idna 2.10 pyh9f0ad1d_0 conda-forge
intel-openmp 2020.3 h57928b3_311 conda-forge
ipykernel 5.5.0 py37heaed05f_1 conda-forge
ipython 7.21.0 py37heaed05f_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.18.0 py37h03978a9_2 conda-forge
jpeg 9d h8ffe710_0 conda-forge
jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge
jupyter_core 4.7.1 py37h03978a9_0 conda-forge
kiwisolver 1.3.1 py37h8c56517_1 conda-forge
lcms2 2.12 h2a16943_0 conda-forge
libblas 3.9.0 8_mkl conda-forge
libcblas 3.9.0 8_mkl conda-forge
libclang 11.1.0 default_h5c34c98_0 conda-forge
libiconv 1.16 he774522_0 conda-forge
liblapack 3.9.0 8_mkl conda-forge
libpng 1.6.37 h1d00b33_2 conda-forge
libsodium 1.0.18 h8d14728_1 conda-forge
libtiff 4.2.0 hc10be44_0 conda-forge
libxml2 2.9.10 hf5bbc77_3 conda-forge
libxslt 1.1.33 h65864e5_2 conda-forge
lxml 4.6.2 py37hd07aab1_1 conda-forge
lz4-c 1.9.3 h8ffe710_0 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
matplotlib 3.3.4 py37h03978a9_0 conda-forge
matplotlib-base 3.3.4 py37h3379fd5_0 conda-forge
mkl 2020.4 hb70f87d_311 conda-forge
msys2-conda-epoch 20160418 1 conda-forge
numpy 1.20.1 py37hd20adf4_0 conda-forge
olefile 0.46 pyh9f0ad1d_1 conda-forge
openssl 1.1.1j h8ffe710_0 conda-forge
pandas 1.2.3 py37h08fd248_0 conda-forge
parso 0.8.1 pyhd8ed1ab_0 conda-forge
patsy 0.5.1 py_0 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 8.1.2 py37h96663a1_0 conda-forge
pip 21.0.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.17 pyha770c72_0 conda-forge
pycparser 2.20 pyh9f0ad1d_2 conda-forge
pygments 2.8.1 pyhd8ed1ab_0 conda-forge
pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pyqt 5.12.3 py37h03978a9_7 conda-forge
pyqt-impl 5.12.3 py37hf2a7229_7 conda-forge
pyqt5-sip 4.19.18 py37hf2a7229_7 conda-forge
pyqtchart 5.12 py37hf2a7229_7 conda-forge
pyqtwebengine 5.12.1 py37hf2a7229_7 conda-forge
pysocks 1.7.1 py37h03978a9_3 conda-forge
python 3.7.10 h7840368_100_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
python_abi 3.7 1_cp37m conda-forge
pytz 2021.1 pyhd8ed1ab_0 conda-forge
pywin32 300 py37hcc03f2d_0 conda-forge
pyzmq 22.0.3 py37hcce574b_1 conda-forge
qt 5.12.9 h5909a2a_4 conda-forge
requests 2.25.1 pyhd3deb0d_0 conda-forge
scipy 1.6.0 py37h6db1a17_0 conda-forge
seaborn 0.11.1 hd8ed1ab_1 conda-forge
seaborn-base 0.11.1 pyhd8ed1ab_1 conda-forge
setuptools 49.6.0 py37h03978a9_3 conda-forge
six 1.15.0 pyh9f0ad1d_0 conda-forge
soupsieve 2.0.1 py_1 conda-forge
sqlite 3.34.0 h8ffe710_0 conda-forge
statsmodels 0.12.2 py37hda49f71_0 conda-forge
tk 8.6.10 h8ffe710_1 conda-forge
tornado 6.1 py37hcc03f2d_1 conda-forge
traitlets 5.0.5 py_0 conda-forge
urllib3 1.26.3 pyhd8ed1ab_0 conda-forge
vc 14.2 hb210afc_4 conda-forge
vs2015_runtime 14.28.29325 h5e1d092_4 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
wheel 0.36.2 pyhd3deb0d_0 conda-forge
win_inet_pton 1.1.0 py37h03978a9_2 conda-forge
wincertstore 0.2 py37h03978a9_1006 conda-forge
xz 5.2.5 h62dcd97_1 conda-forge
zeromq 4.3.4 h0e60522_0 conda-forge
zlib 1.2.11 h62dcd97_1010 conda-forge
zstd 1.4.9 h6255e5f_0 conda-forge
EDIT: For reasons unknown and without doing anything, it now works. The system probably needed one more reboot I guess...