GP-Tree icon indicating copy to clipboard operation
GP-Tree copied to clipboard

The issue about pypolyagamma

Open dadadaray opened this issue 1 year ago • 3 comments

I just tried to install pypolyagamma using pip install pypolyagamma, but I encountered the following issue. Can you give me some suggestions?

Collecting pypolyagamma Using cached pypolyagamma-1.2.3.tar.gz (151 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: numpy in d:\lenovoqmdownload\python\lib\site-packages (from pypolyagamma) (1.24.3) Requirement already satisfied: scipy in d:\lenovoqmdownload\python\lib\site-packages (from pypolyagamma) (1.10.1) Requirement already satisfied: matplotlib in d:\lenovoqmdownload\python\lib\site-packages (from pypolyagamma) (3.7.1) Requirement already satisfied: contourpy>=1.0.1 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (1.0.7) Requirement already satisfied: cycler>=0.10 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (0.11.0) Requirement already satisfied: fonttools>=4.22.0 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (4.39.3) Requirement already satisfied: kiwisolver>=1.0.1 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (1.4.4) Requirement already satisfied: packaging>=20.0 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (23.1) Requirement already satisfied: pillow>=6.2.0 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (9.5.0) Requirement already satisfied: pyparsing>=2.3.1 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (3.0.9) Requirement already satisfied: python-dateutil>=2.7 in d:\lenovoqmdownload\python\lib\site-packages (from matplotlib->pypolyagamma) (2.8.2) Requirement already satisfied: six>=1.5 in d:\lenovoqmdownload\python\lib\site-packages (from python-dateutil>=2.7->matplotlib->pypolyagamma) (1.16.0) Building wheels for collected packages: pypolyagamma Building wheel for pypolyagamma (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [52 lines of output] '.' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 'make' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 D:\LenovoQMDownload\Python\Lib\site-packages\setuptools\dist.py:755: SetuptoolsDeprecationWarning: Invalid dash-separated options !!

          ********************************************************************************
          Usage of dash-separated 'description-file' will not be supported in future
          versions. Please use the underscore name 'description_file' instead.

          By 2023-Sep-26, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    opt = self.warn_dash_deprecation(opt, section)
  D:\LenovoQMDownload\Python\Lib\site-packages\setuptools\_distutils\dist.py:265: UserWarning: Unknown distribution option: 'cmd_class'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-cpython-311
  creating build\lib.win-amd64-cpython-311\pypolyagamma
  copying pypolyagamma\binary_trees.py -> build\lib.win-amd64-cpython-311\pypolyagamma
  copying pypolyagamma\distributions.py -> build\lib.win-amd64-cpython-311\pypolyagamma
  copying pypolyagamma\utils.py -> build\lib.win-amd64-cpython-311\pypolyagamma
  copying pypolyagamma\__init__.py -> build\lib.win-amd64-cpython-311\pypolyagamma
  running build_ext
  building 'pypolyagamma.pypolyagamma' extension
  creating build\temp.win-amd64-cpython-311
  creating build\temp.win-amd64-cpython-311\Release
  creating build\temp.win-amd64-cpython-311\Release\deps
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\cdf
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\complex
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\err
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\randist
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\rng
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\specfunc
  creating build\temp.win-amd64-cpython-311\Release\deps\gsl\sys
  creating build\temp.win-amd64-cpython-311\Release\pypolyagamma
  creating build\temp.win-amd64-cpython-311\Release\pypolyagamma\cpp
  creating build\temp.win-amd64-cpython-311\Release\pypolyagamma\cpp\include
  "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Ipypolyagamma -Ipypolyagamma/cpp/include -Ideps/gsl -Ideps/gsl/gsl -ID:\LenovoQMDownload\Python\include -ID:\LenovoQMDownload\Python\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcdeps/gsl/cdf/gamma.c /Fobuild\temp.win-amd64-cpython-311\Release\deps/gsl/cdf/gamma.obj -w -DHAVE_INLINE
  cl: 命令行 warning D9025 :正在重写“/W3”(用“/w”)
  gamma.c
  deps/gsl/cdf/gamma.c(24): fatal error C1083: 无法打开包括文件: “config.h”: No such file or directory
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.35.32215\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pypolyagamma Running setup.py clean for pypolyagamma Failed to build pypolyagamma ERROR: Could not build wheels for pypolyagamma, which is required to install pyproject.toml-based projects

dadadaray avatar May 12 '23 07:05 dadadaray

I think that the above issue is caused by the .whl. However, my python version is 3.11, and the lastest version for pypolyagamma is 3.7. How can I install this pypolyagamma?

dadadaray avatar May 12 '23 08:05 dadadaray

Hi, I believe this error indeed occurs due to version mismatch between the polyagamma package and other packages. I recommend installing this repo in a clean environment as suggested in the instructions.

Cheers, Idan

IdanAchituve avatar May 12 '23 16:05 IdanAchituve

@dadadaray Have you installed this package successfully? I encountered the same problem even I created a new environment with Python 3.7

yuhaoliu94 avatar Nov 16 '23 20:11 yuhaoliu94