diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 8e1d9994f8303fc00d6c954257831c3e4def3608..f21fd5cd6ec1a7c526694bfc3e7fc574cbbc365d 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -79,7 +79,7 @@ function cmake_gen() { -DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27mu/include/python2.7 -DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs4/lib/libpython2.7.so" elif [ "$1" == "cp35-cp35m" ]; then - export LD_LIBRARY_PATH=/opt/_internal/cpython-3.5.1/lib/ + export LD_LIBRARY_PATH=/opt/_internal/cpython-3.5.1/lib/:${LD_LIBRARY_PATH} export PATH=/opt/_internal/cpython-3.5.1/bin/:${PATH} export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/_internal/cpython-3.5.1/bin/python3 -DPYTHON_INCLUDE_DIR:PATH=/opt/_internal/cpython-3.5.1/include/python3.5m diff --git a/python/paddle/reader/decorator.py b/python/paddle/reader/decorator.py index 1f83cabb8481451736944823be45185deea4f43b..5a2573f59cf7b06d0269fabc39e72d8421597c0b 100644 --- a/python/paddle/reader/decorator.py +++ b/python/paddle/reader/decorator.py @@ -20,7 +20,7 @@ __all__ = [ from threading import Thread import subprocess -from Queue import Queue +from six.moves import queue import itertools import random import zlib @@ -190,7 +190,7 @@ def buffered(reader, size): def data_reader(): r = reader() - q = Queue(maxsize=size) + q = queue(maxsize=size) t = Thread( target=read_worker, args=( r, @@ -293,8 +293,8 @@ def xmap_readers(mapper, reader, process_num, buffer_size, order=False): out_queue.put(end) def xreader(): - in_queue = Queue(buffer_size) - out_queue = Queue(buffer_size) + in_queue = queue(buffer_size) + out_queue = queue(buffer_size) out_order = [0] # start a read worker in a thread target = order_read_worker if order else read_worker diff --git a/python/requirements.txt b/python/requirements.txt index daf3f368b92408408897e33223118fe3647aa6de..c091ecb111bda9d5e83c3ddcae93aed0745f9e4c 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -8,3 +8,4 @@ scipy>=0.19.0 Pillow nltk>=3.2.2 graphviz +six diff --git a/python/setup.py.in b/python/setup.py.in index fa2bfaa33efb532c9dde6e418bcd17041496fb95..27ba3b2303cd7b30cceec65491e24acd9e6df0a6 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -17,6 +17,7 @@ def git_commit(): git_commit = subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0].strip() except: git_commit = 'Unknown' + git_commit = git_commit.decode() return str(git_commit) def _get_version_detail(idx): @@ -44,6 +45,7 @@ def is_taged(): try: cmd = ['git', 'describe', '--exact-match', '--tags'] git_tag = subprocess.Popen(cmd, stdout = subprocess.PIPE).communicate()[0].strip() + git_tag = git_tag.decode() except: return False