Call pip via subprocess, to make it use virtualenv

This commit is contained in:
Matthew Honnibal 2017-03-18 19:29:36 +01:00
parent aa8ff9257f
commit 1754e0db9b

View File

@ -4,6 +4,9 @@ from __future__ import unicode_literals
import pip import pip
import requests import requests
import os import os
import subprocess
import sys
from .link import link_package from .link import link_package
from .. import about from .. import about
from .. import util from .. import util
@ -52,8 +55,9 @@ def get_version(model, comp):
def download_model(filename): def download_model(filename):
util.print_msg("Downloading {f}".format(f=filename)) util.print_msg("Downloading {f}".format(f=filename))
download_url = os.path.join(about.__download_url__, filename) download_url = about.__download_url__ + '/' + filename
pip.main(['install', download_url]) subprocess.call([sys.executable, '-m', 'pip', 'install', download_url],
env=os.environ.copy())
def check_error_depr(model): def check_error_depr(model):