1

I an installing environment.yml file via

conda env create -f environment.yml

But I get

raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

failed

CondaEnvException: Pip failed

My environment.yml has a structure like this

name: relightable-nr
channels:
  - pytorch
  - defaults
dependencies: 
  - zlib=1.2.11=h7b6447c_3
  - zstd=1.3.7=h0b5b093_0
  - pip:
    - absl-py==0.8.0
    - astor==0.8.0
    - astroid==2.3.3
    - wrapt==1.11.2
    - xarray==0.13.0
prefix: /root/anaconda3/envs/envn

I read How to solve ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443) with pip? and Pip Install Timeout Issue I changed my conda default timeout to 300 but how to change pip timeout in my case here?

merv
  • 67,214
  • 13
  • 180
  • 245

2 Answers2

0

Pip will pull configuration options from a pip.conf/pip.inf (Unix/Win) file located in either a global, user, or environment scope, and settings such as timeout can be configured there. See the Pip User Guide section on Config Files.

While that answers the question proper, I would be remiss were I not to mention that all the packages listed in the YAML can come from Conda. A more appropriate solution would be to reconfigure the YAML to not hit PyPI in the first place, e.g.,

name: relightable-nr
channels:
  - pytorch
  - conda-forge
  - defaults
dependencies: 
  - zlib=1.2.11=h7b6447c_3
  - zstd=1.3.7=h0b5b093_0
  - absl-py=0.8.0
  - astor=0.8.0
  - astroid=2.3.3
  - wrapt=1.11.2
  - xarray=0.13.0

but perhaps you abridged the YAML and left out packages that only have PyPI builds. Still, I would recommend getting everything possible from Conda.

merv
  • 67,214
  • 13
  • 180
  • 245
  • 1
    thanks, I made the separate requirements file for pip packages and installed it. It didn't give timeout then. :) – Avani Gupta Sep 18 '20 at 14:59
  • @AvaniGupta You should really consider installing all the packages through Conda. – AMC Sep 19 '20 at 01:00
-1

You can use:

sudo pip install --default-timeout=100 <name_of_your_library>
Ivan Aracki
  • 4,861
  • 11
  • 59
  • 73
circassia_ai
  • 422
  • 4
  • 5
  • 1
    The OP has said that they read [Pip Install Timeout Issue](https://stackoverflow.com/q/50305112/1364007) which suggested what you just said. – Wai Ha Lee Jan 13 '22 at 10:57