如何通过pip install安装pystan时出现此错误?

时间:2018-10-24 00:34:15

标签: python pip stan pystan

这是我在Windows命令提示符中键入的内容:

C:\Users\jeane\Desktop\ethan\stan> pip install pystan

这是我的输出:

Collecting pystan
Using cached https://files.pythonhosted.org/packages/6f/a1/fdf8906311733b7894aad1395d4d43afbbc79ca7573a07200eb105c5938c/pystan-2.18.0.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\jeane\AppData\Local\Temp\pip-install-wwq65uzi\pystan\setup.py", line 122, in <module>
    from Cython.Build.Inline import _get_build_extension
ModuleNotFoundError: No module named 'Cython'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\jeane\AppData\Local\Temp\pip-install-wwq65uzi\pystan\

谢谢!

2 个答案:

答案 0 :(得分:3)

实际上,您可以尝试安装Anaconda。在Google上搜索“ Anaconda”,下载并安装。然后,在Windows系统中搜索“ Anaconda Prompt”,并使用以下命令安装pystan:

conda install pystan -c conda-forge

在那之后,您应该看到以下内容:

Solving environment: done

## Package Plan ##

  environment location: C:\Users\User\Anaconda3

  added / updated specs:
    - pystan


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pystan-2.17.1.0            |   py37h830ac7b_2        14.3 MB  conda-forge
    openssl-1.0.2p             |       hfa6e2cd_0         5.4 MB  conda-forge
    conda-4.5.11               |        py37_1000         654 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        20.3 MB

The following NEW packages will be INSTALLED:

    pystan:  2.17.1.0-py37h830ac7b_2 conda-forge

The following packages will be UPDATED:

    conda:   4.5.11-py37_0                       --> 4.5.11-py37_1000  conda-forge
    openssl: 1.0.2p-hfa6e2cd_0                   --> 1.0.2p-hfa6e2cd_0 conda-forge

Proceed ([y]/n)?

只需按y,Anaconda就会自动下载并安装它。

答案 1 :(得分:0)

您是否尝试在其中安装其内容?

pip install Cython 

应该工作