Wheel file installation

后端 未结 2 1241
春和景丽
春和景丽 2020-11-28 05:44

How do I install a .whl file? I have the Wheel library but I don\'t know how to use it to install those files. I have the .whl file but I don\'t know how to run it. Pleas

相关标签:
2条回答
  • 2020-11-28 05:57

    You normally use a tool like pip to install wheels. Leave it to the tool to discover and download the file if this is for a project hosted on PyPI.

    For this to work, you do need to install the wheel package:

    pip install wheel
    

    You can then tell pip to install the project (and it'll download the wheel if available), or the wheel file directly:

    pip install project_name  # discover, download and install
    pip install wheel_file.whl  # directly install the wheel
    

    The wheel module, once installed, also is runnable from the command line, you can use this to install already-downloaded wheels:

    python -m wheel install wheel_file.whl
    

    Also see the wheel project documentation.

    0 讨论(0)
  • 2020-11-28 06:04

    If you already have a wheel file (.whl) on your pc, then just go with the following code:

    cd ../user
    pip install file.whl
    

    If you want to download a file from web, and then install it, go with the following in command line:

    pip install package_name
    

    or, if you have the url:

    pip install http//websiteurl.com/filename.whl
    

    This will for sure install the required file.

    Note: I had to type pip2 instead of pip while using Python 2.

    0 讨论(0)
提交回复
热议问题