Is there a downloadable Scipy file for Python 3.6 - numpy

I have Python 3.6 and I was wondering if there is a downloadable scipy file for version 3.6. I opened up the command prompt and ran "py -m pip install scipy". And it just gives me an error. I know its not the pip because its already updated. When I did it for nltk and numpy it worked but it doesn't work for scipy. I read somewhere that you have to download and install 3.4 because scipy is not compatible with 3.6. Any answer would be very much appreciated thank you

This is not python 3.6 specific. There are official manylinux1 and macOS wheels on pypi, so pip install should pick them. On Windows, you can use Christoph Gohlke wheels,
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Or, as others noted, there are prebuilt packages for python 3.6 in the conda-land.

I had the same problem but i now use anaconda and this has it already installed.. as well as most science data modules..
https://docs.continuum.io/anaconda/pkg-docs

If you are working with conda, there is one simple trick to know this...
type
conda search scipy
it will tell you the best combinations.
scipy 1.4.1 py38h82752d6_0 conda-forge
scipy 1.4.1 py38hebbc057_0 pkgs/main
scipy 1.5.0 py36h1dac7e4_0 conda-forge
scipy 1.5.0 py36h912ce22_0 pkgs/main
scipy 1.5.0 py36hadf427e_0 pkgs/main
scipy 1.5.0 py36he995f2f_0 conda-forge
scipy 1.5.0 py37h912ce22_0 pkgs/main
scipy 1.5.0 py37hadf427e_0 pkgs/main
scipy 1.5.0 py37hce1b9e5_0 conda-forge
scipy 1.5.0 py38h38b60c6_0 conda-forge
scipy 1.5.0 py38h3eb1e28_0 pkgs/main
scipy 1.5.0 py38hbab996c_0 pkgs/main
scipy 1.5.1 py36h1dac7e4_0 conda-forge
scipy 1.5.1 py36he995f2f_0 conda-forge
scipy 1.5.1 py37hce1b9e5_0 conda-forge
scipy 1.5.1 py38h38b60c6_0 conda-forge
scipy 1.5.2 py36h01b1e2b_0 conda-forge
scipy 1.5.2 py36h01b1e2b_1 conda-forge
scipy 1.5.2 py36h01b1e2b_2 conda-forge
scipy 1.5.2 py36h3862da1_2 conda-forge
scipy 1.5.2 py36h61c6cb4_0 conda-forge
scipy 1.5.2 py36h61c6cb4_1 conda-forge
scipy 1.5.2 py36h61c6cb4_2 conda-forge
scipy 1.5.2 py36h912ce22_0 pkgs/main
scipy 1.5.2 py36haa79e3e_2 conda-forge
scipy 1.5.2 py36hadf427e_0 pkgs/main
scipy 1.5.2 py37h2702c91_0 conda-forge
scipy 1.5.2 py37h2702c91_1 conda-forge
scipy 1.5.2 py37h2702c91_2 conda-forge
scipy 1.5.2 py37h912ce22_0 pkgs/main
scipy 1.5.2 py37ha9eab96_2 conda-forge
scipy 1.5.2 py37hadf427e_0 pkgs/main
scipy 1.5.2 py38h1402333_0 conda-forge
scipy 1.5.2 py38h1402333_1 conda-forge
scipy 1.5.2 py38h1402333_2 conda-forge
scipy 1.5.2 py38h9bd2513_2 conda-forge
scipy 1.5.2 py39h27fd13a_1 conda-forge
scipy 1.5.2 py39h27fd13a_2 conda-forge
scipy 1.5.2 py39hea380fd_2 conda-forge
for example:
scipy 1.5.2 py39

Related

Kernel crashes when I use 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 ?

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!")

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...

Anaconda reading wrong CUDA version

I have a conda environment with PyTorch and Tensorflow, which both require CUDA 9.0 (~cudatoolkit 9.0 from conda). After installing pytorch with torchvision and the cudatoolkit (like they provided on their website) I wanted to install Tensorflow, the problem here is that I get this error:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- tensorflow==1.12.0 -> python[version='2.7.*|3.6.*']
- tensorflow==1.12.0 -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0']
Your python: python=3.5
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
The following specifications were found to be incompatible with your system:
- feature:/linux-64::__cuda==10.2=0
- feature:|#/linux-64::__cuda==10.2=0
Your installed version is: 10.2
If I run nvcc or nvidia-smi on my host or the activated conda environment, I get that I have installed CUDA 10.2, even though conda list shows me that cudatoolkit 9.0 is installed. Any solution to this?
EDIT:
When running this code sample:
# setting device on GPU if available, else CPU
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print('Using device:', device)
print()
#Additional Info when using cuda
if device.type == 'cuda':
print(torch.cuda.get_device_name(0))
print('Memory Usage:')
print('Allocated:', round(torch.cuda.memory_allocated(0)/1024**3,1), 'GB')
print('Cached: ', round(torch.cuda.memory_cached(0)/1024**3,1), 'GB')
print(torch.version.cuda)
I get this output:
GeForce GTX 1050
Memory Usage:
Allocated: 0.0 GB
Cached: 0.0 GB
9.0.176
So PyTorch does get the correct CUDA version, I just cant get tensorflow-gpu installed.
If I run nvcc or nvidia-smi on my host or the activated conda environment, I get that I have installed CUDA 10.2, even though conda list shows me that cudatoolkit 9.0 is installed. Any solution to this?
cudatoolkit doesn't ship with compiler (nvcc), thus when you run nvcc you start compiler from system wide installation. That's why it prints 10.2 istead of 9.0, and pytorch sees the local cudatoolkit.
anaconda / packages / cudatoolkit :
This CUDA Toolkit includes GPU-accelerated libraries, and the CUDA runtime for the Conda ecosystem. For the full CUDA Toolkit with a compiler and development tools visit https://developer.nvidia.com/cuda-downloads
From your comment above I understood that you are using python=3.5.6. So, first of all you should search for available tensorflow py35 builds using:
conda search tensorflow | grep py35
I have the following output:
tensorflow 1.9.0 eigen_py35h8c89287_1 pkgs/main
tensorflow 1.9.0 gpu_py35h42d5ad8_1 pkgs/main
tensorflow 1.9.0 gpu_py35h60c0932_1 pkgs/main
tensorflow 1.9.0 gpu_py35hb39db67_1 pkgs/main
tensorflow 1.9.0 mkl_py35h5be851a_1 pkgs/main
tensorflow 1.10.0 eigen_py35h5ed898b_0 pkgs/main
tensorflow 1.10.0 gpu_py35h566a776_0 pkgs/main
tensorflow 1.10.0 gpu_py35ha6119f3_0 pkgs/main
tensorflow 1.10.0 gpu_py35hd9c640d_0 pkgs/main
tensorflow 1.10.0 mkl_py35heddcb22_0 pkgs/main
As you can see there is no tensorflow 1.12.0 builds for py35, and that's why you are getting that error. You can try to inspect other conda channels, for example, conda-forge:
conda search tensorflow -c conda-forge | grep py35
But that wasn't helpful:
tensorflow 0.9.0 py35_0 conda-forge
tensorflow 0.10.0 py35_0 conda-forge
tensorflow 0.11.0rc0 py35_0 conda-forge
tensorflow 0.11.0rc2 py35_0 conda-forge
tensorflow 0.11.0 py35_0 conda-forge
tensorflow 0.12.1 py35_0 conda-forge
tensorflow 0.12.1 py35_1 conda-forge
tensorflow 0.12.1 py35_2 conda-forge
tensorflow 1.0.0 py35_0 conda-forge
tensorflow 1.1.0 py35_0 conda-forge
tensorflow 1.2.0 py35_0 conda-forge
tensorflow 1.2.1 py35_0 conda-forge
tensorflow 1.3.0 py35_0 conda-forge
tensorflow 1.4.0 py35_0 conda-forge
tensorflow 1.5.0 py35_0 conda-forge
tensorflow 1.5.1 py35_0 conda-forge
tensorflow 1.6.0 py35_0 conda-forge
tensorflow 1.8.0 py35_0 conda-forge
tensorflow 1.8.0 py35_1 conda-forge
tensorflow 1.9.0 eigen_py35h8c89287_1 pkgs/main
tensorflow 1.9.0 gpu_py35h42d5ad8_1 pkgs/main
tensorflow 1.9.0 gpu_py35h60c0932_1 pkgs/main
tensorflow 1.9.0 gpu_py35hb39db67_1 pkgs/main
tensorflow 1.9.0 mkl_py35h5be851a_1 pkgs/main
tensorflow 1.9.0 py35_0 conda-forge
tensorflow 1.10.0 eigen_py35h5ed898b_0 pkgs/main
tensorflow 1.10.0 gpu_py35h566a776_0 pkgs/main
tensorflow 1.10.0 gpu_py35ha6119f3_0 pkgs/main
tensorflow 1.10.0 gpu_py35hd9c640d_0 pkgs/main
tensorflow 1.10.0 mkl_py35heddcb22_0 pkgs/main
tensorflow 1.10.0 py35_0 conda-forge
So, the possible solutions are:
Install one of the older available tensorflow 1.10.0 gpu_py35 builds.
Switch to python 3.6.
conda search tensorflow | grep py36
...
tensorflow 1.11.0 gpu_py36h4459f94_0 pkgs/main
tensorflow 1.11.0 gpu_py36h9c9050a_0 pkgs/main
...
tensorflow 1.12.0 gpu_py36he68c306_0 pkgs/main
tensorflow 1.12.0 gpu_py36he74679b_0 pkgs/main
...
Note that versions >=1.13.1 doesn't support CUDA 9.
Use pip install inside conda env to install missing tensorflow build, because pip hosts more build combinations: Tested build configurations
Here is some best practices from Anaconda how to use pip w/ conda: Using Pip in a Conda Environment
The last option is to build your own missing conda package with conda-build
My experience is that even though the detected cuda version is incorrect by conda, what matters is the cudatoolkit version.
The actual problem for me was the incompatible python version.
E.g. You might have Python 3.7/3.8 but this version of tensorflow doesn't support that:
tensorflow==1.12.0 -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0']
Try an older conda environment or a newer tensorflow, the latest version before 2.0 is 1.15
If I haven't misunderstood, you installed the packages using the
conda install
from https://pytorch.org/get-started/locally/
I once had problems with the conda installation of PyTorch and Cuda: i solved by removing the packages installed with conda and re-installing it via pip.
If you are afraid to mess up the conda enviroment using pip, I suggest you to create another enviroment in order to test this solution.
Use conda to remove pytorch and cuda. See Removing Packages at Conda Managing packages
Install the cuda toolkit you need. Note that pytorch supports only cuda 9.2, 10.1 and 10.2, as you can see on the Pytorch download page.
If your OS is ubuntu 19, follow the CUDA instructions for ubuntu 18. Also note that not all gpus support the latest version of the toolkit for driver reasons (the 1050 should be recent enough to support them all, up to 10.1 sure because I used it).
Follow the instructions to install pytorch with the appropiate cuda support via pip at Pytorch download page. See Using pip in an enviroment at Conda Managing packages