Support CNTK installation in VirtualEnv
CNTK installation using pip place dlls in the root folder of the python environment. Unlike Conda, VirtualEnv doesn't add this folder in library search path and hence 'import CNTK' is broken in VirtualEnv. Fix: Place CNTK libraries in site-packages/CNTK/lib and add the same to library search path.
This commit is contained in:
Родитель
997d3a1e13
Коммит
3765da9ae7
|
@ -5,6 +5,9 @@
|
|||
|
||||
__version__ = '2.3.1+'
|
||||
|
||||
import os
|
||||
os.environ["PATH"] += os.pathsep + os.path.join(os.path.dirname(__file__), 'libs')
|
||||
|
||||
import numpy as np
|
||||
|
||||
from . import cntk_py
|
||||
|
|
|
@ -159,15 +159,8 @@ cntk_module = Extension(
|
|||
packages = [x for x in find_packages() if x.startswith('cntk') and not x.startswith('cntk.swig')]
|
||||
|
||||
package_data = { 'cntk': ['pytest.ini', 'io/tests/tf_data.txt', 'contrib/deeprl/tests/data/initial_policy_network.dnn'] }
|
||||
|
||||
if IS_WINDOWS:
|
||||
# On Windows copy all runtime libs to the base folder of Python
|
||||
kwargs = dict(data_files = [('.', [ os.path.join('cntk', lib) for lib in rt_libs ])],
|
||||
package_data = package_data)
|
||||
else:
|
||||
# On Linux copy all runtime libs into the cntk/lib folder.
|
||||
package_data['cntk'] += rt_libs
|
||||
kwargs = dict(package_data = package_data)
|
||||
package_data['cntk'] += rt_libs
|
||||
kwargs = dict(package_data = package_data)
|
||||
|
||||
cntk_install_requires = [
|
||||
'numpy>=1.11',
|
||||
|
|
Загрузка…
Ссылка в новой задаче