Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use --pypi-mirror can't modify PyPI index when creating virtual environment #4094

Closed
yili1992 opened this issue Jan 13, 2020 · 1 comment
Closed
Labels

Comments

@yili1992
Copy link

Issue description

I want to change PyPi index when creating virtual environment, but pipenv still to download package via default pypi source(files.pythonhosted.org)

pipenv install --pypi-mirror https://mirrors.163.com/pypi/simple

Expected result

when creating virtual environment , it will to download setuptools via https://mirrors.163.com/pypi/simple

Actual result

Installing setuptools, pip, wheel...

  Complete output from command /home/jenkins/.local...z5im/bin/python3.6.8 - setuptools pip wheel:
  Looking in links: /usr/local/lib/python3.7/site-packages/virtualenv_support
Collecting setuptools
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)",)': /packages/af/e7/02db816dc88c598281bacebbb7ccf2c9f1a6164942e88f1a0fded8643659/setuptools-45.0.0-py2.py3-none-any.whl
  Downloading https://files.pythonhosted.org/packages/af/e7/02db816dc88c598281bacebbb7ccf2c9f1a6164942e88f1a0fded8643659/setuptools-45.0.0-py2.py3-none-any.whl (583kB)
Collecting pip
  Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/response.py", line 360, in _error_catcher
    yield
  File "/usr/local/lib/python3.7/site-packages/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/response.py", line 442, in read
    data = self._fp.read(amt)
  File "/usr/local/lib/python3.7/site-packages/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "/usr/local/python3.6.8/lib/python3.6/http/client.py", line 449, in read
    n = self.readinto(b)
  File "/usr/local/python3.6.8/lib/python3.6/http/client.py", line 493, in readinto
    n = self.fp.readinto(b)
  File "/usr/local/python3.6.8/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/python3.6.8/lib/python3.6/ssl.py", line 1012, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/python3.6.8/lib/python3.6/ssl.py", line 874, in read
    return self._sslobj.read(len, buffer)
  File "/usr/local/python3.6.8/lib/python3.6/ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.

<details><summary>$ pipenv --support</summary>

Pipenv version: `'2018.11.26'`

Pipenv location: `'/usr/local/lib/python3.7/site-packages/pipenv'`

Python location: `'/usr/local/bin/python3.7'`

Python installations found:

  - `3.7.0`: `/usr/local/bin/python3.7m`
  - `3.7.0`: `/usr/local/bin/python3.7`
  - `3.6.1`: `/usr/bin/python3.6`
  - `3.5.3`: `/usr/bin/python3.5`
  - `3.5.3`: `/usr/bin/python3.5m`
  - `2.7.13`: `/usr/bin/python2.7`

PEP 508 Information:

{'implementation_name': 'cpython',
'implementation_version': '3.7.0',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.9.0-9-amd64',
'platform_system': 'Linux',
'platform_version': '#1 SMP Debian 4.9.168-1 (2019-04-12)',
'python_full_version': '3.7.0',
'python_version': '3.7',
'sys_platform': 'linux'}


System environment variables:

  - `JENKINS_URL`
  - `YARN_VERSION`
  - `UPLIB_AUTOQA_SERVICE_PORT_HTTP`
  - `LANG`
  - `QA_REPORT_DOC_PORT`
  - `JENKINS_SERVICE_PORT_HTTP`
  - `HOSTNAME`
  - `JENKINS_SERVICE_PORT_SLAVE`
  - `QA_REPORT_DOC_SERVICE_PORT_QA_REPORT_DOC`
  - `QA_REPORT_DOC_SERVICE_HOST`
  - `JENKINS_PORT_50000_TCP`
  - `JAVA_HOME`
  - `JENKINS_PORT_8080_TCP_PORT`
  - `JENKINS_SERVICE_HOST`
  - `JENKINS_TUNNEL`
  - `KUBERNETES_PORT_443_TCP_PROTO`
  - `KUBERNETES_PORT_443_TCP_ADDR`
  - `UPLIB_AUTOQA_SERVICE_HOST`
  - `JAVA_VERSION`
  - `JENKINS_PORT_8080_TCP_ADDR`
  - `JENKINS_PORT_50000_TCP_PROTO`
  - `UPLIB_AUTOQA_PORT_2335_TCP`
  - `KUBERNETES_PORT`
  - `JENKINS_PORT_8080_TCP_PROTO`
  - `JENKINS_PORT_8080_TCP`
  - `QA_REPORT_DOC_SERVICE_PORT`
  - `PWD`
  - `QA_REPORT_DOC_PORT_2444_TCP_PORT`
  - `HOME`
  - `JENKINS_AGENT_NAME`
  - `JENKINS_SECRET`
  - `KUBERNETES_SERVICE_PORT_HTTPS`
  - `GIT_VERSION`
  - `KUBERNETES_PORT_443_TCP_PORT`
  - `UPLIB_AUTOQA_PORT_2335_TCP_PROTO`
  - `CA_CERTIFICATES_JAVA_VERSION`
  - `NODE_VERSION`
  - `AGENT_WORKDIR`
  - `JENKINS_NAME`
  - `QA_REPORT_DOC_PORT_2444_TCP`
  - `JAVA_DEBIAN_VERSION`
  - `JENKINS_PORT`
  - `KUBERNETES_PORT_443_TCP`
  - `UPLIB_AUTOQA_PORT_2335_TCP_PORT`
  - `TERM`
  - `JENKINS_PORT_50000_TCP_PORT`
  - `SHLVL`
  - `QA_REPORT_DOC_PORT_2444_TCP_ADDR`
  - `UPLIB_AUTOQA_SERVICE_PORT`
  - `UPLIB_AUTOQA_PORT_2335_TCP_ADDR`
  - `KUBERNETES_SERVICE_PORT`
  - `QA_REPORT_DOC_PORT_2444_TCP_PROTO`
  - `UPLIB_AUTOQA_PORT`
  - `PATH`
  - `KUBERNETES_SERVICE_HOST`
  - `JENKINS_PORT_50000_TCP_ADDR`
  - `JENKINS_SERVICE_PORT`
  - `_`
  - `PIP_DISABLE_PIP_VERSION_CHECK`
  - `PYTHONDONTWRITEBYTECODE`
  - `PIP_SHIMS_BASE_MODULE`
  - `PIP_PYTHON_PATH`
  - `PYTHONFINDER_IGNORE_UNSUPPORTED`

Pipenv–specific environment variables:


Debug–specific environment variables:

  - `PATH`: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`
  - `LANG`: `C.UTF-8`
  - `PWD`: `/home/jenkins`


---------------------------

</details>
@matteius
Copy link
Member

@yili1992 This should be solved with pipenv==2022.8.19 and the index package restrictions implemented earlier this year. Pass the --index argument though instead of --pypi-mirror to specify to use an index other than the default index in the Pipfile (which is the first source listed). For more details: https://pipenv.pypa.io/en/latest/advanced/#specifying-package-indexes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants