简体   繁体   中英

Manually install xlwings in windows behind a blocking firewall?

I am using Microsoft's Visual Studio Code on Windows.

Office firewall blocked https://pypi.org/ 's download site https://files.pythonhosted.org , so

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

doesn't work and I'm looking for a work-around to install xlwings .

From https://anaconda.org/conda-forge/xlwings/files I downloaded xlwings-0.15.8-py36_0.tar.bz2 , but

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

also does not working.

Is there a way to install xlwings via the ...tar.bz2 file, or, any other alternative?

Update: below is the content in the ...tar.bz2 file, which contains no 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

The problem is xlwings doesn't provide a wheel file which you can install from a file in pip . You should be able to extract the .tar.gz source distribution from PyPI -- aka sdist -- and then install it manually (xlwings is probably using setuptools, so it would be /path/to/python setup.py install ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM