mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Call pip via subprocess, to make it use virtualenv
This commit is contained in:
parent
aa8ff9257f
commit
1754e0db9b
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user