Skip to content

installing pymc3 on windows+anaconda python36 #2988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
grinsted opened this issue May 23, 2018 · 8 comments
Closed

installing pymc3 on windows+anaconda python36 #2988

grinsted opened this issue May 23, 2018 · 8 comments

Comments

@grinsted
Copy link

grinsted commented May 23, 2018

Description of your problem

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

Versions and main components

  • PyMC3 Version:3.4.1
  • Theano Version:1.0.1
  • Python Version:3.6.5
  • Operating system: fully updated windows10
  • How did you install PyMC3: I've tried both pip & conda.
@twiecki
Copy link
Member

twiecki commented May 23, 2018

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.

@grinsted
Copy link
Author

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). (?)

@twiecki
Copy link
Member

twiecki commented May 24, 2018

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

@twiecki twiecki closed this as completed May 24, 2018
@grinsted
Copy link
Author

grinsted commented May 29, 2018

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

@twiecki
Copy link
Member

twiecki commented May 29, 2018

Thanks for sharing. Did you have problems with a newer mkl version?

@grinsted
Copy link
Author

Yes it failed without specifying 2017. I don't remember exactly the message.

@waiyawuth
Copy link

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:\Users\waiyawuth.e\AppData\Local\Continuum\anaconda3\lib\site-packages\theano\configdefaults.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:\Users\waiyawuth.e\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py_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?

@junpenglao
Copy link
Member

@waiyawuth I think on Windows it is much easier to set up Theano using anaconda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants