在阻止防火墙后面的 windows 中手动安装 xlwings?

Manually install xlwings in windows behind a blocking firewall?

我在 Windows.

上使用微软的 Visual Studio 代码

Office 防火墙被阻止 https://pypi.org/'s download site https://files.pythonhosted.org,因此

(env) C:\py\ms>python -m pip install C:\whl\xlwings-0.15.8-py36_0.tar.bz2

不起作用,我正在寻找解决方法来安装 xlwings

我从 https://anaconda.org/conda-forge/xlwings/files 下载了 xlwings-0.15.8-py36_0.tar.bz2,但是

(env) C:\py\ms>python -m pip install C:\whl\xlwings-0.15.8-py36_0.tar.bz2

也不行。

有没有办法通过 ...tar.bz2 文件或任何其他替代方法安装 xlwings

更新:下面是...tar.bz2文件中的内容,不包含setup.py:

C:\Python\whl\xlwings-0.15.8-py36_0.tar>tree /f /a
Folder PATH listing for volume Windows 7_x64
Volume serial number is EA08-A1F9
C:.
|   xlwings32-0.15.8.dll
|   xlwings64-0.15.8.dll
|
+---info
|   |   about.json
|   |   files
|   |   git
|   |   hash_input.json
|   |   index.json
|   |   LICENSE.txt
|   |   paths.json
|   |
|   +---recipe
|   |       conda_build_config.yaml
|   |       meta.yaml
|   |       meta.yaml.template
|   |       recipe_log.txt
|   |
|   \---test
|           run_test.bat
|           run_test.py
|
+---Lib
|   \---site-packages
|       +---xlwings
|       |   |   command_line.py
|       |   |   constants.py
|       |   |   expansion.py
|       |   |   mac_dict.py
|       |   |   main.py
|       |   |   quickstart.xlsm
|       |   |   quickstart_standalone_mac.xlsm
|       |   |   quickstart_standalone_win.xlsm
|       |   |   server.py
|       |   |   udfs.py
|       |   |   utils.py
|       |   |   xlwings.applescript
|       |   |   xlwings.bas
|       |   |   _xlmac.py
|       |   |   _xlwindows.py
|       |   |   __init__.py
|       |   |
|       |   +---addin
|       |   |       xlwings.xlam
|       |   |
|       |   +---conversion
|       |   |   |   framework.py
|       |   |   |   numpy_conv.py
|       |   |   |   pandas_conv.py
|       |   |   |   standard.py
|       |   |   |   __init__.py
|       |   |   |
|       |   |   \---__pycache__
|       |   |           framework.cpython-36.pyc
|       |   |           numpy_conv.cpython-36.pyc
|       |   |           pandas_conv.cpython-36.pyc
|       |   |           standard.cpython-36.pyc
|       |   |           __init__.cpython-36.pyc
|       |   |
|       |   +---ext
|       |   |   |   sql.py
|       |   |   |   __init__.py
|       |   |   |
|       |   |   \---__pycache__
|       |   |           sql.cpython-36.pyc
|       |   |           __init__.cpython-36.pyc
|       |   |
|       |   +---rest
|       |   |   |   api.py
|       |   |   |   serializers.py
|       |   |   |   __init__.py
|       |   |   |
|       |   |   \---__pycache__
|       |   |           api.cpython-36.pyc
|       |   |           serializers.cpython-36.pyc
|       |   |           __init__.cpython-36.pyc
|       |   |
|       |   +---tests
|       |   |   |   cell_errors.xlsx
|       |   |   |   common.py
|       |   |   |   macro book.xlsm
|       |   |   |   sample_picture.png
|       |   |   |   test book.xlsx
|       |   |   |   test_active.py
|       |   |   |   test_app.py
|       |   |   |   test_book.py
|       |   |   |   test_conversion.py
|       |   |   |   test_names.py
|       |   |   |   test_range.py
|       |   |   |   test_shape.py
|       |   |   |   test_sheet.py
|       |   |   |   __init__.py
|       |   |   |
|       |   |   +---restapi
|       |   |   |   |   test_restapi.py
|       |   |   |   |   __init__.py
|       |   |   |   |
|       |   |   |   \---__pycache__
|       |   |   |           test_restapi.cpython-36.pyc
|       |   |   |           __init__.cpython-36.pyc
|       |   |   |
|       |   |   \---__pycache__
|       |   |           common.cpython-36.pyc
|       |   |           test_active.cpython-36.pyc
|       |   |           test_app.cpython-36.pyc
|       |   |           test_book.cpython-36.pyc
|       |   |           test_conversion.cpython-36.pyc
|       |   |           test_names.cpython-36.pyc
|       |   |           test_range.cpython-36.pyc
|       |   |           test_shape.cpython-36.pyc
|       |   |           test_sheet.cpython-36.pyc
|       |   |           __init__.cpython-36.pyc
|       |   |
|       |   \---__pycache__
|       |           command_line.cpython-36.pyc
|       |           constants.cpython-36.pyc
|       |           expansion.cpython-36.pyc
|       |           mac_dict.cpython-36.pyc
|       |           main.cpython-36.pyc
|       |           server.cpython-36.pyc
|       |           udfs.cpython-36.pyc
|       |           utils.cpython-36.pyc
|       |           _xlmac.cpython-36.pyc
|       |           _xlwindows.cpython-36.pyc
|       |           __init__.cpython-36.pyc
|       |
|       \---xlwings-0.15.8-py3.6.egg-info
|               dependency_links.txt
|               entry_points.txt
|               PKG-INFO
|               requires.txt
|               SOURCES.txt
|               top_level.txt
|
\---Scripts
        xlwings-script.py
        xlwings.exe

问题是 xlwings 没有提供 wheel file which you can install from a file in pip。您应该能够从 PyPI 中提取 .tar.gz 源分发 -- a.k.a。 sdist -- 然后手动安装它(xlwings 可能正在使用 setuptools,所以它将是 /path/to/python setup.py install)。