Skip to content

Commit 2085654

Browse files
committed
Fix bug of install_requres in setup.py
Signed-off-by: fengyuan <[email protected]>
1 parent 93045fe commit 2085654

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ pip install -U setuptools
3939

4040
Then, install ideep from the source code:
4141
```
42+
pip install .
43+
```
44+
```
4245
python setup.py install
4346
```
4447

python/setup.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from setuptools import Command, distutils, Extension, setup
2-
from numpy import get_include
32
from platform import system
43

54
import external
65
import sys
76

87
import setuptools.command.install
8+
import setuptools.command.build_ext
99
import distutils.command.build
1010
import distutils.command.clean
1111

@@ -33,6 +33,13 @@ class build(distutils.command.build.build):
3333
] + distutils.command.build.build.sub_commands
3434

3535

36+
class build_ext(setuptools.command.build_ext.build_ext):
37+
def run(self):
38+
import numpy
39+
self.include_dirs.append(numpy.get_include())
40+
setuptools.command.build_ext.build_ext.run(self)
41+
42+
3643
class install(setuptools.command.install.install):
3744
def run(self):
3845
if not self.skip_build:
@@ -48,6 +55,7 @@ def run(self):
4855

4956
cmdclass = {
5057
'build': build,
58+
'build_ext': build_ext,
5159
'build_deps': build_deps,
5260
'install': install,
5361
'clean': clean,
@@ -73,8 +81,7 @@ def run(self):
7381
link_opts = ['-Wl,-z,now', '-Wl,-z,noexecstack',
7482
'-Wl,-rpath,' + '$ORIGIN/lib', '-L' + './external/lib']
7583

76-
includes = [get_include(),
77-
'ideep4py/include',
84+
includes = ['ideep4py/include',
7885
'ideep4py/include/mkl',
7986
'ideep4py/common',
8087
'ideep4py/include/mm',
@@ -138,9 +145,7 @@ def run(self):
138145
###############################################################################
139146

140147
install_requires = [
141-
'numpy>=1.9.0'
142-
'protobuf>=3.0.0',
143-
'six>=1.9.0'
148+
'numpy>=1.9,<=1.13',
144149
]
145150

146151
tests_require = [

0 commit comments

Comments
 (0)