VisualDL icon indicating copy to clipboard operation
VisualDL copied to clipboard

python setup.py bdist_wheel failed on MAC

Open luchensk opened this issue 8 years ago • 11 comments

OS version: System Version: macOS 10.12.4 (16E195) Kernel Version: Darwin 16.5.0 Python version: 2.7.13 cmake version: 3.10.2

It failed with the error during running 'python setup.py bdist_wheel':

:
[ 62%] Completed 'extern_protobuf'
[ 62%] Built target extern_protobuf
visualdl/storage/CMakeFiles/storage_proto.dir/build.make:61: *** target pattern contains no `%'.  Stop.
make[1]: *** [visualdl/storage/CMakeFiles/storage_proto.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 97, in <module>
    cmdclass=cmdclass)
  File "/Users/sunkai/work/workspace/project/tf-env/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/sunkai/work/workspace/project/tf-env/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 179, in run
    self.run_command('build')
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 63, in run
    subprocess.check_call(cmd)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bash', 'build.sh']' returned non-zero exit status 2

luchensk avatar Jan 24 '18 11:01 luchensk

Is there some update? Thanks.

luchensk avatar Jan 29 '18 06:01 luchensk

@luchensk Sorry for the lack of responsiveness.

@cs2be Since this is up your alley, could you shed some light here please?

varunarora avatar Feb 02 '18 20:02 varunarora

try brew install protobuf, then rebuild.

TuXiaokang avatar Mar 06 '18 06:03 TuXiaokang

@TuXiaokang I ran as you mentioned as above, and it looks better but still failed after [ 64%], as follows:

+ cmake ..
-- Protobuf protoc executable: /Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/bin/protoc
-- Protobuf library: /Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/lib/libprotobuf.a
-- Protobuf version: 3.5
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/sunkai/work/src/VisualDL/build
+ make -j2
[ 22%] Built target zlib
[ 23%] Built target extern_eigen3
[ 46%] Built target extern_gtest
[ 47%] Built target extern_pybind
[ 49%] Running C++ protocol buffer compiler on storage.proto
[ 60%] Built target extern_protobuf
Scanning dependencies of target storage_proto
Scanning dependencies of target binary_record
[ 61%] Building CXX object visualdl/storage/CMakeFiles/storage_proto.dir/storage.pb.cc.o
[ 63%] Building CXX object visualdl/storage/CMakeFiles/binary_record.dir/binary_record.cc.o
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:12:2: error: This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
 ^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:13:2: error: incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers.  Please update
 ^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:14:2: error: your headers.
#error your headers.
 ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:25:
/usr/local/include/google/protobuf/generated_message_table_driven.h:204:20: error: expected a qualified name after 'typename'
  typedef typename MapEntryToMapField<Entry>::MapFieldType MapFieldType;
                   ^
/usr/local/include/google/protobuf/generated_message_table_driven.h:204:38: error: expected ';' at end of declaration
  typedef typename MapEntryToMapField<Entry>::MapFieldType MapFieldType;
                                     ^
/usr/local/include/google/protobuf/generated_message_table_driven.h:208:43: error: use of undeclared identifier 'MapFieldType'; did you mean 'MapFieldLite'?
  typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;
                                          ^
/Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/include/google/protobuf/map_field_lite.h:48:7: note: 'MapFieldLite' declared here
class MapFieldLite {
      ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:25:
/usr/local/include/google/protobuf/generated_message_table_driven.h:208:43: error: no template named 'MapFieldType'; did you mean 'MapFieldLite'?
  typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;
                                          ^
/Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/include/google/protobuf/map_field_lite.h:48:7: note: 'MapFieldLite' declared here
class MapFieldLite {
      ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:25:
/usr/local/include/google/protobuf/generated_message_table_driven.h:210:33: error: unknown type name 'MapFieldType'; did you mean 'MapFieldBase'?
  ParserType parser(static_cast<MapFieldType*>(map_field));
                                ^
/Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/include/google/protobuf/message.h:143:7: note: 'MapFieldBase' declared here
class MapFieldBase;
      ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:41:46: error: no type named 'FieldMetadata' in namespace 'google::protobuf::internal'
  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:42:46: error: no type named 'SerializationTable' in namespace 'google::protobuf::internal'
  static const ::google::protobuf::internal::SerializationTable serialization_table[];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:179:28: error: expected ';' at end of declaration list
  inline Entry* New() const PROTOBUF_FINAL { return New(NULL); }
                           ^
                           ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:182:57: error: expected ';' at end of declaration list
  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
                                                        ^
                                                        ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:183:58: error: expected ';' at end of declaration list
  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
                                                         ^
                                                         ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:186:15: error: expected ';' at end of declaration list
  void Clear() PROTOBUF_FINAL;
              ^
              ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:187:29: error: expected ';' at end of declaration list
  bool IsInitialized() const PROTOBUF_FINAL;
                            ^
                            ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:189:30: error: expected ';' at end of declaration list
  size_t ByteSizeLong() const PROTOBUF_FINAL;
                             ^
                             ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:191:55: error: expected ';' at end of declaration list
      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
                                                      ^
                                                      ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:193:63: error: expected ';' at end of declaration list
      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
                                                              ^
                                                              ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:195:67: error: expected ';' at end of declaration list
      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
                                                                  ^
                                                                  ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
[ 64%] Building CXX object visualdl/storage/CMakeFiles/binary_record.dir/storage.pb.cc.o
20 errors generated.
make[2]: *** [visualdl/storage/CMakeFiles/storage_proto.dir/storage.pb.cc.o] Error 1
make[1]: *** [visualdl/storage/CMakeFiles/storage_proto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:12:2: error: This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
 ^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:13:2: error: incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers.  Please update
 ^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:14:2: error: your headers.
#error your headers.
 ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:25:
/usr/local/include/google/protobuf/generated_message_table_driven.h:204:20: error: expected a qualified name after 'typename'
  typedef typename MapEntryToMapField<Entry>::MapFieldType MapFieldType;
                   ^
/usr/local/include/google/protobuf/generated_message_table_driven.h:204:38: error: expected ';' at end of declaration
  typedef typename MapEntryToMapField<Entry>::MapFieldType MapFieldType;
                                     ^
/usr/local/include/google/protobuf/generated_message_table_driven.h:208:43: error: use of undeclared identifier 'MapFieldType'; did you mean 'MapFieldLite'?
  typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;
                                          ^
/Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/include/google/protobuf/map_field_lite.h:48:7: note: 'MapFieldLite' declared here
class MapFieldLite {
      ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:25:
/usr/local/include/google/protobuf/generated_message_table_driven.h:208:43: error: no template named 'MapFieldType'; did you mean 'MapFieldLite'?
  typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;
                                          ^
/Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/include/google/protobuf/map_field_lite.h:48:7: note: 'MapFieldLite' declared here
class MapFieldLite {
      ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:25:
/usr/local/include/google/protobuf/generated_message_table_driven.h:210:33: error: unknown type name 'MapFieldType'; did you mean 'MapFieldBase'?
  ParserType parser(static_cast<MapFieldType*>(map_field));
                                ^
/Users/sunkai/work/src/VisualDL/build/third_party/install/protobuf/include/google/protobuf/message.h:143:7: note: 'MapFieldBase' declared here
class MapFieldBase;
      ^
In file included from /Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.cc:4:
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:41:46: error: no type named 'FieldMetadata' in namespace 'google::protobuf::internal'
  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:42:46: error: no type named 'SerializationTable' in namespace 'google::protobuf::internal'
  static const ::google::protobuf::internal::SerializationTable serialization_table[];
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:179:28: error: expected ';' at end of declaration list
  inline Entry* New() const PROTOBUF_FINAL { return New(NULL); }
                           ^
                           ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:182:57: error: expected ';' at end of declaration list
  void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
                                                        ^
                                                        ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:183:58: error: expected ';' at end of declaration list
  void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL;
                                                         ^
                                                         ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:186:15: error: expected ';' at end of declaration list
  void Clear() PROTOBUF_FINAL;
              ^
              ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:187:29: error: expected ';' at end of declaration list
  bool IsInitialized() const PROTOBUF_FINAL;
                            ^
                            ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:189:30: error: expected ';' at end of declaration list
  size_t ByteSizeLong() const PROTOBUF_FINAL;
                             ^
                             ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:191:55: error: expected ';' at end of declaration list
      ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL;
                                                      ^
                                                      ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:193:63: error: expected ';' at end of declaration list
      ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL;
                                                              ^
                                                              ;
/Users/sunkai/work/src/VisualDL/build/visualdl/storage/storage.pb.h:195:67: error: expected ';' at end of declaration list
      bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL;
                                                                  ^
                                                                  ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [visualdl/storage/CMakeFiles/binary_record.dir/storage.pb.cc.o] Error 1
make[1]: *** [visualdl/storage/CMakeFiles/binary_record.dir/all] Error 2
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 100, in <module>
    cmdclass=cmdclass)
  File "/Users/sunkai/work/workspace/project/tf-env/lib/python2.7/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/sunkai/work/workspace/project/tf-env/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 179, in run
    self.run_command('build')
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 66, in run
    subprocess.check_call(cmd, env=env)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bash', 'build.sh']' returned non-zero exit status 2

luchensk avatar Mar 06 '18 09:03 luchensk

My protobuf version is 3.5.1 and use the latest version of VisualDL from master, as below:

$ protoc --version
libprotoc 3.5.1

luchensk avatar Mar 06 '18 09:03 luchensk

@luchensk have you update repo to last commit?

TuXiaokang avatar Mar 06 '18 09:03 TuXiaokang

I removed the repo(still failed if I used by git pull to update) and then re-cloned. Now it works, thanks.

luchensk avatar Mar 06 '18 09:03 luchensk

It failed when running 'python setup.py bdist_wheel':

@luchensk @TuXiaokang Please help

/vdl/lib/python2.7/site-packages/setuptools/dist.py:398: UserWarning: Normalizing '1.1.0 ' to '1.1.0' normalized_version, running bdist_wheel running build running build_py ++ pwd

  • TOP_DIR=/Users/swapan/VisualDL
  • FRONTEND_DIR=/Users/swapan/VisualDL/frontend
  • BACKEND_DIR=/Users/swapan/VisualDL/visualdl
  • BUILD_DIR=/Users/swapan/VisualDL/build
  • mkdir -p /Users/swapan/VisualDL/build
  • ARG=
  • echo 'ARG: ' ARG:
  • '[' '' = travis-CI ']'
  • build_frontend
  • cd /Users/swapan/VisualDL/frontend
  • npm install npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated @types/[email protected]: This is a stub types definition for commander (https://github.com/tj/commander.js). commander provides its own type definitions, so you don't need @types/commander installed! npm WARN deprecated [email protected]: The major version is no longer supported. Please update to 4.x or newer npm ERR! code E403 npm ERR! 403 Forbidden: copy-webpack-plugin@^4.0.1

npm ERR! A complete log of this run can be found in: npm ERR! /Users/swapan/.npm/_logs/2018-09-15T11_30_45_818Z-debug.log Traceback (most recent call last): File "setup.py", line 130, in cmdclass=cmdclass) File "/Users/swapan/vdl/lib/python2.7/site-packages/setuptools/init.py", line 140, in setup return distutils.core.setup(**attrs) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/Users/swapan/vdl/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 202, in run self.run_command('build') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run self.run_command(cmd_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "setup.py", line 86, in run subprocess.check_call(cmd, env=env) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['bash', 'build.sh']' returned non-zero exit status 1

SwapanpreetKaur avatar Sep 15 '18 11:09 SwapanpreetKaur

@SwapanpreetKaur it seems that you need to install copy-webpack-plugin successfully.

TuXiaokang avatar Sep 17 '18 09:09 TuXiaokang

@TuXiaokang Resolved npm crashed during installation.

SwapanpreetKaur avatar Sep 17 '18 10:09 SwapanpreetKaur

close outdated issue.

PeterPanZH avatar Jun 28 '20 06:06 PeterPanZH