0

I am trying to install flask with pip3 in a virtual environment and it fails when I run

(VirtEnv) $ pip3 install flask 

With:

Collecting flask
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f870ae3bc18>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/flask/
Could not find a version that satisfies the requirement flask (from versions: )
No matching distribution found for flask

However when I run with sudo, the command succeeds but I've read this will install the file outside the virtual environment when using sudo. Running outside the virtual environment also succeeds.

user5389726598465
  • 1,418
  • 2
  • 14
  • 25

1 Answers1

0

Previously for another project, I had set up a local DNS and had changed my dns settings to use a local DNS server 192.168. and my local gateway as the dns. I could access flask from my computer but something about the virtual environment didn't work until I set the DNS servers to google 8.8.8.8. See here for instructions.

user5389726598465
  • 1,418
  • 2
  • 14
  • 25