Skip to content
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

Cannot install libplinkio on Windows #33

Open
Patricklv opened this issue May 16, 2022 · 6 comments
Open

Cannot install libplinkio on Windows #33

Patricklv opened this issue May 16, 2022 · 6 comments

Comments

@Patricklv
Copy link

I am following page 385 of the book "An introduction to statistical genetic data analysis" to install the package libplinkio using the code pip install plinkio. Here is my code and what I was returned in Win 10 cmd:

C:\Users\Patrick Wen>pip install plinkio
Collecting plinkio
  Using cached plinkio-0.9.8.tar.gz (34 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: plinkio
  Building wheel for plinkio (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\plinkfile.py -> build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\__init__.py -> build\lib.win-amd64-3.10\plinkio
      creating build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\write_test.py -> build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\__init__.py -> build\lib.win-amd64-3.10\tests
      running build_ext
      building 'plinkio.cplinkio' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for plinkio
  Running setup.py clean for plinkio
Failed to build plinkio
Installing collected packages: plinkio
  Running setup.py install for plinkio ... error
  error: subprocess-exited-with-error

  × Running setup.py install for plinkio did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\plinkfile.py -> build\lib.win-amd64-3.10\plinkio
      copying py-plinkio\plinkio\__init__.py -> build\lib.win-amd64-3.10\plinkio
      creating build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\write_test.py -> build\lib.win-amd64-3.10\tests
      copying py-plinkio\tests\__init__.py -> build\lib.win-amd64-3.10\tests
      running build_ext
      building 'plinkio.cplinkio' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> plinkio

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Any idea why the error? I have install the wheel package.

@mfranberg
Copy link
Owner

I don't work with windows a lot, but did you try to download the new version of the build tools as suggested by the error message: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

@Patricklv
Copy link
Author

The Programs and Features section in Control Panel suggests I already have Microsoft Visual C++ 14.0 or greater:
Microsoft Visual C++ 2015-2019 Redistributable (*64) - 14.26.28720
Microsoft Visual C++ 2015-2019 Redistributable (*86) - 14.28.29325

Given the above info, is outdated Microsoft Visual C++ the reason of my failure to install plinkio?

Additionally, I did downloaded the newest version of Microsoft Visual C++ and I was given the option to install multiple programs: Desktop development with C++, Universal Windows Platform build tools, .NET desktop buid tools, Mobile Development with .NET, Web developent build tools, Azure development build tools, Office/SharePoint build tools, Data storage and proessing build tools, Node.js build tools, and Visual Studio extension development.

If outdated Microsoft Visual C++ is the reason of the installation failure, which of the above program should I click? They seem to occupy quite a lot space. So I wish to install those that are necessary. Thank you.

@mfranberg
Copy link
Owner

Hmm, looks correct then, any chance python is not able to locate your installation of microsoft visual c++?

As mentioned, I don't have much experience with windows development, but of the tools it wants to install the only ones I could imagine are relevant is "Universal Windows Platform build tools". But the link suggested by the error message seems to only contain the build tools "https://visualstudio.microsoft.com/visual-cpp-build-tools/", that should be enough, you shouldn't need the whole visual c++ package.

@mfranberg
Copy link
Owner

The second answer here also has some tips: https://stackoverflow.com/questions/44951456/pip-error-microsoft-visual-c-14-0-is-required

The third answer also suggest updating setuptools might be necessary: pip install --upgrade setuptools

@Kazuki-TAKEDA
Copy link
Collaborator

Kazuki-TAKEDA commented Jun 27, 2022

With #26 and #34, you can compile libplinkio on Windows. However, they haven't been uploaded to PyPI yet. Please use the latest version on github and follow the #33 (comment) procedure.

In summary,

  1. Install Visual Studio Build Tools with the “Visual C++ build tools“ option or the “Desktop development with C++” option as well as Visual C++ Redistributable.
  2. Install Git if you haven't already.
  3. Run pip install --upgrade setuptools.
  4. Run pip install git+https://github.com/mfranberg/libplinkio instead of pip install plinkio.

@Kazuki-TAKEDA
Copy link
Collaborator

Kazuki-TAKEDA commented Jul 19, 2022

Here is the zip file containing the pre-built wheels. If you cannot build py-plinkio yourself, please use this file.
dist.zip

For example, if you are using the 64-bit version of Python 3.8, you can install this wheel by running pip install plinkio-0.9.9-cp38-cp38-win_amd64.whl.

@Kazuki-TAKEDA Kazuki-TAKEDA changed the title Cannot install libplinkio Cannot install libplinkio on Windows Jul 21, 2022
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

3 participants