0

I am using VPN to connect to the client VM. I am unable to install a python-Docx package using pip or manually downloading the tar.gz.

When using pip I get the below error

after connection broken by ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002544D09BF50>, 'Connection to pypi.org timed out. (connect timeout=15)'):

When trying to manually install it get an error

Download error on https://pypi.org/simple/: timed out -- Some packages may not be found!
No local packages or working download links were found for lxml>=2.3.2

After researching a few posts I found this could be because I'm behind a proxy or a network issue. Two solutions are provided in the forum but I have my doubts

Solution 1 use the below command. I wanted to know where can I find the username, password, server, and port details. Are these my VM login credentials pip install package --proxy=http://username:password@server:port

Solution 2 create two environment variables: HTTP_PROXY and HTTPS_PROXY. What should be the value for the environment variable.

WhatsThePoint
  • 3,395
  • 8
  • 31
  • 53
user3015322
  • 1
  • 1
  • 2

1 Answers1

0

as I see this package only one dependency, "lxml" (can be check from here)
You should download lxml first and install from local (how to guide here)
lxml:
https://pypi.org/project/lxml/

python-docx:
https://pypi.org/project/python-docx/

it will work if you load both tar.gz files by following the order.

Sezer BOZKIR
  • 534
  • 2
  • 13
  • Thanks for the reply. While trying to install LXML i get the below 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/ – user3015322 Jan 25 '23 at 01:22
  • If you are using Windows based server (obviosly right :) ), you should install this package: https://stackoverflow.com/a/64262038/5942941 installation.exe file URL: https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170 offline installer: – Sezer BOZKIR Jan 25 '23 at 12:29
  • Thanks again. I installed the Visual Studio Installer. Now the next set of challenges. C:\Users\AANYWH~1\AppData\Local\Temp\xmlXPathInit_dx5pc_5.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 – user3015322 Jan 26 '23 at 23:53
  • Your welcome :) here we go, follow this guideline: https://stackoverflow.com/a/40445375/5942941 – Sezer BOZKIR Jan 27 '23 at 07:15