Installing PyMC3 on Anaconda 3 / Win - pymc3

This installation is a nightmare!!!
Using:
conda install -c conda-forge pymc3
Will not work.
I then tried to install theano first (and its dependencies), found out the hard way that it works with python=3.5, NOT 3.6.
# Install theano reqirements
conda install numpy scipy mkl-service libpython m2w64-toolchain
# Install theano
conda install theano pygpu
# You are using a different python version (3.5) from the base installation,
# you must point to the right kernel for Jupyter:
conda install ipykernel
python -m ipykernel install --user
# Install & test on jupyter, spyder
conda install jupyter spyder qt
# Install PyMC3
pip install pymc3
Everything imports, but then when I run the code the 'NUTS' thing won't initialize...

Not sure which process worked for me but this is the step I took
reset my whole laptop
re-download wsl2
install conda
go to this directory
path_to_your_python_env>/Lib/site-packages/theano/misc/windows.py
delete or comment out following
params['shell'] = True
Even though it works, the compiler is extremely still slows

Related

Cythonizing sklearn/_isotonic.pyx failed

I'm trying to install the OCRF-Examples (https://github.com/ngoix/OCRF).
The installation instructions said:
conda create -n OCRF_env python=2.7 anaconda
source activate OCRF_env
conda install -n OCRF_env numpy scipy cython matplotlib
git clone https://github.com/ngoix/OCRF
cd OCRF
pip install --upgrade pip
pip install pyper
python setup.py install
I was able to run all the commands of the installation instructions without any problems - except for the last one:
python setup.py install
Here I got this error:
Cython is installed with the latest version (0.29.13) and no other Cython versions are installed.
If relevant: I already had Python 3.6.9 installed on my Macbook. Due to the OCRF installation, I now have Python 2.7. as additional environment.
Am I doing something wrong?

Install opencv python package in Anaconda

Can someone provide the steps and the necessary links of the dependencies to install external python package "opencv-python" for image processing?
I tried installing it in pycharm, but it was not able to import cv2(opencv) and was throwing version mismatch with numpy!
Please help!
The good thing with anaconda is that it should make your life easier without getting your hands too dirty. If you use only basic libs, only install packages with anaconda commands to be sure not to corrupt your python environment.
if you're on linux, use conda install -c conda-forge opencv
on windows, do the same with the "anaconda prompt" terminal.
If you still have some trouble with you numpy version, try conda update numpy
Create a virtual env. Following which run following instals
pip install numpy scipy matplotlib scikit-learn jupyter
pip install opencv-contrib-python
pip install dlib
You may verify the install via this script in Python environment-
import cv2
cv2.version
Remove all previous/current (if any) python installation
Install Anaconda and add anaconda to PATH(Envirnoment variables:: Adavanced system setting->Environment variables->under system variables go to variable PATHand click edit to add new envirnomental variables)
(During installation check box involve PATH)
Open anaconda prompt with admin access. Type and enter:-
conda update --all
conda install -c conda-forge opencv
conda install spyder=4.0.0 (spyder updation)
conda update python (for python updation)
To install this package with conda run one of the following:
conda install -c conda-forge opencv
conda install -c conda-forge/label/gcc7 opencv
conda install -c conda-forge/label/broken opencv
conda install -c conda-forge/label/cf201901 opencv

does pip install -U break virtualenv?

I have a virtualenv where I'm running python 2.7.13. I did install numpy a while ago. Today I wanted to install statsmodels as well in the same virtualenv. That's why I did (according to the webpage):
pip install -U statsmodels
and several packages where updated (numpy among others). I forgot that the -U forces to install the newest version. Since numpy was updated to numpy 1.13.3 I'm not sure if this broke a dependency. Is the forced version 1.13.3 not suitable for the virtualenv? If so how can I remove it and install the correct one. If I'm running
pip uninstall numpy
followed by a
pip install numpy
it says:
pip install numpy
Collecting numpy
Using cached numpy-1.13.3-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.13.3
Yes, the compatibility with Python is guaranteed: look at the filename of the wheel that is installed: numpy-1.13.3-cp27-cp27mu-manylinux1_x86_64.whl. That matches the Python version you're using (including your OS).
As for statsmodels and the upgraded NumPy: if statsmodels requires numpy 1.13.3, you're fine; that's the whole point of a virtualenv: it doesn't break any other dependencies/virtualenvs you might have set up. It is unlikely you have another package in the same virtualenv that requires a lower version of NumPy.

how avoid Anaconda to hijack pip

I have 2 versions of Python installed on my PC (Windows 7, 64Bit).
Python 2.7 Version installed with Anaconda
Python 3.6 Version installed directly from python.org (the "regular IDLE")
Now, i would like to install the necessary packages on the 3.6 using pip, but anaconda keeps on hijacking the command.
For example, on typing in the cmd window:
pip install numpy
and i get:
Requirement already satisfied: numpy in
c:\users\georges\anaconda2\lib\site_packages
Which is the case for python2.7, but i was trying to install it for version 3.6 installed without Anaconda.
I tried re-installing pip hoping it would erase the hijacking by Anaconda2 ... failed.
I am contemplating to remove Anaconda2 altogether although i risk that in windows, removing a programme does not necessaraly remove the dependencies.
Any lead please ?
I think what you are looking for is pip3 install pip3 and you should be able install packages for python3
It should come as standard with python3 installation setup.
First check if it is there with
where pip3
For any further issues check this post
You don't need to uninstall anaconda2. Both python versions can co-exist and libraries different managed by different package installers pip for python 2 and pip3 for python 3 respectively.
Hope this answers your question.
Install it with pip3, because you want it for python 3:
pip3 install numpy

How do I install Keras and Theano in Anaconda Python on Windows?

I am trying to work on neural networks in Python using the following Keras packages:
from keras.utils import np_utils
from keras.layers.core import Dense, Activation, Dropout
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
But, I am getting the following error:
15 import theano
---> 16 from theano import gof
17 from theano.compat.python2x import partial
18 import theano.compile.mode
ImportError: cannot import name gof
Installing installed conda install keras. Later I tried to use pip install Theano, but it did not work. I Tried to install using pip install git, but I am getting this error: cannot find command git. So I installed Git and I set the environment variables.
So, is there any procedure to install these packages?
It is my solution for the same problem
Install TDM GCC x64.
Install Anaconda x64.
Open the Anaconda prompt
Run conda update conda
Run conda update --all
Run conda install mingw libpython
Install the latest version of Theano,
pip install git+git://github.com/Theano/Theano.git
Run pip install git+git://github.com/fchollet/keras.git
The trick is that you need to create an environment/workspace for Python. This solution should work for Python 2.7 but at the time of writing keras can run on python 3.5, especially if you have the latest anaconda installed (this took me awhile to figure out so I'll outline the steps I took to install KERAS in python 3.5):
Create environment/workspace for Python 3.5
C:\conda create --name neuralnets python=3.5
C:\activate neuralnets
Install everything (notice the neuralnets workspace in parenthesis on each line). Accept any dependencies each of those steps wants to install:
(neuralnets) C:\conda install theano
(neuralnets) C:\conda install mingw libpython
(neuralnets) C:\pip install tensorflow
(neuralnets) C:\pip install keras
Test it out:
(neuralnets) C:\python -c "from keras import backend; print(backend._BACKEND)"
Just remember, if you want to work in the workspace you always have to do:
C:\activate neuralnets
so you can launch Jupyter for example (assuming you also have Jupyter installed in this environment/workspace) as:
C:\activate neuralnets
(neuralnets) jupyter notebook
You can read more about managing and creating conda environments/workspaces
at the follwing URL: https://conda.io/docs/using/envs.html
In windows with anaconda, just go on conda prompt and use this command
conda install --channel https://conda.anaconda.org/conda-forge keras
I use macOS and used to have the same problem.
Running the following command in the terminal saved me:
conda install -c conda-forge keras tensorflow
Hope it helps.
In case you want to train CNN's with the theano backend like the Keras mnist_cnn.py example:
You better use theano bleeding edge version. Otherwise there may occur assertion errors.
Run Theano bleeding edge
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
Run Keras (like 1.0.8 works fine)
pip install git+git://github.com/fchollet/keras.git
install by this command given below
conda install -c conda-forge keras
this is error "CondaError: Cannot link a source that does not exist" ive get in win 10.
for your error put this command in your command line.
conda update conda
this work for me .
In windows environment with Anconda. Go to anconda prompt from start. Then if you are behind proxy then .copndarc file needs to eb updated with the proxy details.
ssl_verify: false
channels:
- defaults
proxy_servers:
http: http://xx.xx.xx.xx:xxxx
https: https://xx.xx.xx.xx:xxxx
I had ssl_verify initially marked as 'True' then I was getting ssl error. So i turned it to false as above and then ran the below commands
conda update conda
conda update --all
conda install --channel https://conda.anaconda.org/conda-forge keras
conda install --channel https://conda.anaconda.org/conda-forge tensorflow
My python version is 3.6.7
Anaconda with Windows
Run anaconda prompt with administrator privilages
conda update conda
conda update --all
conda install mingw libpython
conda install theano
After conda commands it's required to accept process - Proceed ([y]/n)?