在Intranet中安装Python模块

时间:2018-02-19 17:00:55

标签: python pip virtualenv

我正在尝试为我们公司内部网上的服务器中的项目安装Python库需求。但是,因此,任何外部访问都被阻止,我无法下载任何所需的库。我们已经为“官方”软件包设置了我们的内部镜像站点,只要它们的依赖关系不会离开内部网络,就可以下载和安装它们。 这是我在尝试安装特定的“ibm_db”软件包时遇到的错误:

    Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip
    Traceback (most recent call last):
      File "d:\app\python\Lib\urllib\request.py", line 1318, in do_open
        encode_chunked=req.has_header('Transfer-encoding'))
      File "d:\app\python\Lib\http\client.py", line 1239, in request
        self._send_request(method, url, body, headers, encode_chunked)
      File "d:\app\python\Lib\http\client.py", line 1285, in _send_request
        self.endheaders(body, encode_chunked=encode_chunked)
      File "d:\app\python\Lib\http\client.py", line 1234, in endheaders
        self._send_output(message_body, encode_chunked=encode_chunked)
      File "d:\app\python\Lib\http\client.py", line 1026, in _send_output
        self.send(msg)
      File "d:\app\python\Lib\http\client.py", line 964, in send
        self.connect()
      File "d:\app\python\Lib\http\client.py", line 1392, in connect
        super().connect()
      File "d:\app\python\Lib\http\client.py", line 936, in connect
        (self.host,self.port), self.timeout, self.source_address)
      File "d:\app\python\Lib\socket.py", line 704, in create_connection
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
      File "d:\app\python\Lib\socket.py", line 743, in getaddrinfo
        for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    socket.gaierror: [Errno 11001] getaddrinfo failed

有办法解决这个问题吗?就像将虚拟环境从本地工作站移动到服务器一样?或者下载所有必需的文件并在离线模式下安装它们?

1 个答案:

答案 0 :(得分:0)

我可以通过执行此解决方法来实现此目的:

Could not connect: Server is not configured to allow ipv6 connections.