Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible solution for cityflow installation error #175

Open
Sheagu opened this issue Nov 9, 2023 · 3 comments
Open

Possible solution for cityflow installation error #175

Sheagu opened this issue Nov 9, 2023 · 3 comments

Comments

@Sheagu
Copy link

Sheagu commented Nov 9, 2023

system: Ubuntu 20.04
conda: miniconda3
python: 3.8

I have used cityflow with docker on WSL for a period of time, and now I want to install it directly on my linux system. I followed the Build From Source in cityflow documentation and an error occurred when running pip install .

root@autodl-container-744e4495ab-36126ec8:~/autodl-tmp/download/CityFlow# pip install .
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Processing /root/autodl-tmp/download/CityFlow
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Building wheels for collected packages: CityFlow
  Building wheel for CityFlow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-xksam745
       cwd: /tmp/pip-req-build-kcz549ga/
  Complete output (61 lines):
  running bdist_wheel
  running build
  running build_ext
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
  
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  
  
  -- The C compiler identification is GNU 9.3.0
  -- The CXX compiler identification is GNU 9.3.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:51 (message):
    The submodule extern/pybind11/CMakeLists.txt was not downloaded!
    GIT_SUBMODULE was turned off or failed.  Please update submodules and try
    again.
  
  
  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 60, in <module>
      setup(
    File "/root/miniconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/root/miniconda3/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/root/miniconda3/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 32, in run
      self.build_extension(ext)
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 56, in build_extension
      subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
    File "/root/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-kcz549ga', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-kcz549ga/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/root/miniconda3/bin/python', '-DVERSION="0.1"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for CityFlow
  Running setup.py clean for CityFlow
Failed to build CityFlow
Installing collected packages: CityFlow
    Running setup.py install for CityFlow ... error
    ERROR: Command errored out with exit status 1:
     command: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d9tboj20/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/include/python3.8/CityFlow
         cwd: /tmp/pip-req-build-kcz549ga/
    Complete output (63 lines):
    running install
    running build
    running build_ext
    CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at CMakeLists.txt:51 (message):
      The submodule extern/pybind11/CMakeLists.txt was not downloaded!
      GIT_SUBMODULE was turned off or failed.  Please update submodules and try
      again.
    
    
    -- Configuring incomplete, errors occurred!
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 60, in <module>
        setup(
      File "/root/miniconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/root/miniconda3/lib/python3.8/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/root/miniconda3/lib/python3.8/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 32, in run
        self.build_extension(ext)
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 56, in build_extension
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
      File "/root/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-kcz549ga', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-kcz549ga/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/root/miniconda3/bin/python', '-DVERSION="0.1"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d9tboj20/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/include/python3.8/CityFlow Check the logs for full command output.

Operations that I tried and DID NOT help:

  1. Upgrade cmake
  2. Change the minimum cmake version in CMakeLists.txt from VERSION 3.0 to a higher version (reference: https://blog.csdn.net/sanqima/article/details/132522944)
  3. Run git submodule update --init manually then run pip install . (reference: closed issue # 153)

Then it came up to me that maybe there's something wrong with the CityFlow files downloaded by running git clone https://github.com/cityflow-project/CityFlow.git. So I copied the /home/cityflow folder in the docker container, which has been working well, to my linux system, entered this folder and ran pip install . again. It succeeded!

This is my solution for this kind of installation error:

  1. Pull the docker image of cityflow
  2. Build a container from this image
  3. Copy the /home/cityflow folder to the system you want to use
  4. Run pip install . in cityflow folder

However, I'm still not sure why this works. I've compared the files downloaded by git clone and copied from docker container, there's hardly any difference.

@BackMountainDevil
Copy link

miniconda3: try python 3.9.16

@xmu-hph
Copy link

xmu-hph commented Apr 25, 2024

system: Ubuntu 20.04 conda: miniconda3 python: 3.8

I have used cityflow with docker on WSL for a period of time, and now I want to install it directly on my linux system. I followed the Build From Source in cityflow documentation and an error occurred when running pip install .

root@autodl-container-744e4495ab-36126ec8:~/autodl-tmp/download/CityFlow# pip install .
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Processing /root/autodl-tmp/download/CityFlow
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Building wheels for collected packages: CityFlow
  Building wheel for CityFlow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-xksam745
       cwd: /tmp/pip-req-build-kcz549ga/
  Complete output (61 lines):
  running bdist_wheel
  running build
  running build_ext
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
  
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  
  
  -- The C compiler identification is GNU 9.3.0
  -- The CXX compiler identification is GNU 9.3.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:51 (message):
    The submodule extern/pybind11/CMakeLists.txt was not downloaded!
    GIT_SUBMODULE was turned off or failed.  Please update submodules and try
    again.
  
  
  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 60, in <module>
      setup(
    File "/root/miniconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/root/miniconda3/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/root/miniconda3/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 32, in run
      self.build_extension(ext)
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 56, in build_extension
      subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
    File "/root/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-kcz549ga', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-kcz549ga/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/root/miniconda3/bin/python', '-DVERSION="0.1"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for CityFlow
  Running setup.py clean for CityFlow
Failed to build CityFlow
Installing collected packages: CityFlow
    Running setup.py install for CityFlow ... error
    ERROR: Command errored out with exit status 1:
     command: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d9tboj20/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/include/python3.8/CityFlow
         cwd: /tmp/pip-req-build-kcz549ga/
    Complete output (63 lines):
    running install
    running build
    running build_ext
    CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at CMakeLists.txt:51 (message):
      The submodule extern/pybind11/CMakeLists.txt was not downloaded!
      GIT_SUBMODULE was turned off or failed.  Please update submodules and try
      again.
    
    
    -- Configuring incomplete, errors occurred!
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 60, in <module>
        setup(
      File "/root/miniconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/root/miniconda3/lib/python3.8/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/root/miniconda3/lib/python3.8/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 32, in run
        self.build_extension(ext)
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 56, in build_extension
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
      File "/root/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-kcz549ga', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-kcz549ga/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/root/miniconda3/bin/python', '-DVERSION="0.1"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d9tboj20/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/include/python3.8/CityFlow Check the logs for full command output.

Operations that I tried and DID NOT help:

  1. Upgrade cmake
  2. Change the minimum cmake version in CMakeLists.txt from VERSION 3.0 to a higher version (reference: https://blog.csdn.net/sanqima/article/details/132522944)
  3. Run git submodule update --init manually then run pip install . (reference: closed issue # 153)

Then it came up to me that maybe there's something wrong with the CityFlow files downloaded by running git clone https://github.com/cityflow-project/CityFlow.git. So I copied the /home/cityflow folder in the docker container, which has been working well, to my linux system, entered this folder and ran pip install . again. It succeeded!

This is my solution for this kind of installation error:

  1. Pull the docker image of cityflow
  2. Build a container from this image
  3. Copy the /home/cityflow folder to the system you want to use
  4. Run pip install . in cityflow folder

However, I'm still not sure why this works. I've compared the files downloaded by git clone and copied from docker container, there's hardly any difference.

Amazing,you are genius.this project relys on another some gitsubmodules,and in some network environment,we may can't download the submodules,you are really genius!THIS REALLY WORKS!!!!

@xmu-hph
Copy link

xmu-hph commented Apr 25, 2024

system: Ubuntu 20.04 conda: miniconda3 python: 3.8
I have used cityflow with docker on WSL for a period of time, and now I want to install it directly on my linux system. I followed the Build From Source in cityflow documentation and an error occurred when running pip install .

root@autodl-container-744e4495ab-36126ec8:~/autodl-tmp/download/CityFlow# pip install .
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
Processing /root/autodl-tmp/download/CityFlow
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Building wheels for collected packages: CityFlow
  Building wheel for CityFlow (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-xksam745
       cwd: /tmp/pip-req-build-kcz549ga/
  Complete output (61 lines):
  running bdist_wheel
  running build
  running build_ext
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.
  
    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.
  
  
  -- The C compiler identification is GNU 9.3.0
  -- The CXX compiler identification is GNU 9.3.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at CMakeLists.txt:51 (message):
    The submodule extern/pybind11/CMakeLists.txt was not downloaded!
    GIT_SUBMODULE was turned off or failed.  Please update submodules and try
    again.
  
  
  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 60, in <module>
      setup(
    File "/root/miniconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/root/miniconda3/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/root/miniconda3/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 32, in run
      self.build_extension(ext)
    File "/tmp/pip-req-build-kcz549ga/setup.py", line 56, in build_extension
      subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
    File "/root/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-kcz549ga', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-kcz549ga/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/root/miniconda3/bin/python', '-DVERSION="0.1"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for CityFlow
  Running setup.py clean for CityFlow
Failed to build CityFlow
Installing collected packages: CityFlow
    Running setup.py install for CityFlow ... error
    ERROR: Command errored out with exit status 1:
     command: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d9tboj20/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/include/python3.8/CityFlow
         cwd: /tmp/pip-req-build-kcz549ga/
    Complete output (63 lines):
    running install
    running build
    running build_ext
    CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.
    
      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.
    
    
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Error at CMakeLists.txt:51 (message):
      The submodule extern/pybind11/CMakeLists.txt was not downloaded!
      GIT_SUBMODULE was turned off or failed.  Please update submodules and try
      again.
    
    
    -- Configuring incomplete, errors occurred!
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 60, in <module>
        setup(
      File "/root/miniconda3/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/root/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/root/miniconda3/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/root/miniconda3/lib/python3.8/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/root/miniconda3/lib/python3.8/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/root/miniconda3/lib/python3.8/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 32, in run
        self.build_extension(ext)
      File "/tmp/pip-req-build-kcz549ga/setup.py", line 56, in build_extension
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
      File "/root/miniconda3/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-req-build-kcz549ga', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-kcz549ga/build/lib.linux-x86_64-3.8', '-DPYTHON_EXECUTABLE=/root/miniconda3/bin/python', '-DVERSION="0.1"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /root/miniconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-kcz549ga/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-d9tboj20/install-record.txt --single-version-externally-managed --compile --install-headers /root/miniconda3/include/python3.8/CityFlow Check the logs for full command output.

Operations that I tried and DID NOT help:

  1. Upgrade cmake
  2. Change the minimum cmake version in CMakeLists.txt from VERSION 3.0 to a higher version (reference: https://blog.csdn.net/sanqima/article/details/132522944)
  3. Run git submodule update --init manually then run pip install . (reference: closed issue # 153)

Then it came up to me that maybe there's something wrong with the CityFlow files downloaded by running git clone https://github.com/cityflow-project/CityFlow.git. So I copied the /home/cityflow folder in the docker container, which has been working well, to my linux system, entered this folder and ran pip install . again. It succeeded!
This is my solution for this kind of installation error:

  1. Pull the docker image of cityflow
  2. Build a container from this image
  3. Copy the /home/cityflow folder to the system you want to use
  4. Run pip install . in cityflow folder

However, I'm still not sure why this works. I've compared the files downloaded by git clone and copied from docker container, there's hardly any difference.

Amazing,you are genius.this project relys on another some gitsubmodules,and in some network environment,we may can't download the submodules,you are really genius!THIS REALLY WORKS!!!!

correction:there is an another problem,key points loss.so i decided to use docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants