I have struggled for so long to get pymc3 to work on my machine. It fails everytime. Please help.
It would be great with more verbose install instructions.
Please provide a minimal, self-contained, and reproducible example.
using conda, python36 in a new clean conda environment i do the following:
conda create -n testpymc3
activate testpymc3
conda install cloudpickle ipykernel
conda install mingw libpython
conda install theano pygpu
conda install pymc3
conda install nose-parameterized
and then i run the linear regression example from here:
http://docs.pymc.io/notebooks/getting_started#A-Motivating-Example:-Linear-Regression
Please provide the full traceback.
C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\nose_parameterized\__init__.py:7: UserWarning: The 'nose-parameterized' package has been renamed 'parameterized'. For the two step migration instructions, see: https://github.com/wolever/parameterized#migrating-from-nose-parameterized-to-parameterized (set NOSE_PARAMETERIZED_NO_WARN=1 to suppress this warning)
"The 'nose-parameterized' package has been renamed 'parameterized'. "
Traceback (most recent call last):
File "<ipython-input-3-eb4b63f93aef>", line 1, in <module>
runfile('C:/Users/ag/Documents/Python/hurdmg/helloworld.py', wdir='C:/Users/ag/Documents/Python/hurdmg')
File "C:\Users\ag\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "C:\Users\ag\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/ag/Documents/Python/hurdmg/helloworld.py", line 23, in <module>
import pymc3 as pm
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\__init__.py", line 5, in <module>
from .distributions import *
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\distributions\__init__.py", line 1, in <module>
from . import timeseries
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\distributions\timeseries.py", line 5, in <module>
from .continuous import get_tau_sd, Normal, Flat
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\distributions\continuous.py", line 18, in <module>
from . import transforms
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\distributions\transforms.py", line 4, in <module>
from ..model import FreeRV
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\model.py", line 15, in <module>
from pymc3.math import flatten_list
File "C:\Users\ag\Anaconda3\envs\hurdmg\lib\site-packages\pymc3\math.py", line 81, in <module>
kron_solve_lower = partial(kron_matrix_op, op=tt.slinalg.solve_lower_triangular)
AttributeError: module 'theano.tensor.slinalg' has no attribute 'solve_lower_triangular'
Please provide any additional information below.
(Note also the undeclared dependency on nose-parameterized.)
That is pretty odd, under the same Theano version I have theano.tensor.slinalg.solve_lower_triangular. I wonder if that's a windows packaging bug?
Can you do:
from theano.tensor.slinalg import solve_lower_triangular. If that fails, open an issue on the Theano repo with the error.
I think it may have something to do with spyder.
I can run from theano.tensor.slinalg import solve_lower_triangular from the python REPL.
I cannot run it in spyder (i've set the interpreter to the python in my conda environment). (?)
@grinsted Yeah, we've seen weird things with spyder before. I would recommend using jupyter NB or figure out what the differences between the environments are.
In any case, it doesn't seem like a pymc3 issue so closing this.
For anybody struggling like i have. I finally got it to work using a conda environment based on this yml file:
name: shawarma
dependencies:
- python
- cloudpickle
- ipykernel
- mingw
- libpython
- m2w64-toolchain
- mkl=2017
- pygpu
- theano
- pymc3
- parameterized
conda env create -f shawarma.yml
The 2017 version of MKL is probably only needed at this very moment.
This works in the REPL, and in a jupyter notebook, but i have not got it to work in spyder (it is complaining about nose parameterized).
Thanks for sharing. Did you have problems with a newer mkl version?
Yes it failed without specifying 2017. I don't remember exactly the message.
I'm very new to pymc3. I can install pymc3 on windows7 via pip but it's quite slow and showed these warning.
Here is my current env.
PyMC3 Version:3.4.1
Theano Version:1.0.2
Python Version:3.6.5
Operating system: fully updated windows7
I think it would be some problem with theano or my environment.
WARNING (theano.configdefaults): g++ not available, if using conda: conda install m2w64-toolchain
C:Userswaiyawuth.eAppDataLocalContinuumanaconda3libsite-packagestheanoconfigdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
C:Userswaiyawuth.eAppDataLocalContinuumanaconda3libsite-packagesh5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
But, when I tried shawarma environment last night. I died anther way. =*= Could you guys please help me on this issue?
@waiyawuth I think on Windows it is much easier to set up Theano using anaconda.
Most helpful comment
For anybody struggling like i have. I finally got it to work using a conda environment based on this yml file:
conda env create -f shawarma.ymlThe 2017 version of MKL is probably only needed at this very moment.
This works in the REPL, and in a jupyter notebook, but i have not got it to work in spyder (it is complaining about nose parameterized).