简体   繁体   中英

How can I install Zipline-trader without errors

I've tried installing zipline-trader according to instructions given on zipline-trader installation page: https://zipline-trader.readthedocs.io/en/latest/install.html

All goes fine until actually running the installation command. Neither of these work:

pip install -e. or pip install zipline-trader

Installation starts, but problems begin when starting to build wheel for zipline-trader.

I'm not a huge computer wizard, so if someone could help me out here and tell me where the problem is. it would be much appreciated.

The error messages are below (very long list):

  Building wheels for collected packages: bcolz, bottleneck, lru-dict
  Building wheel for bcolz (setup.py) ... error
  ERROR: Command errored out with exit status 1:
  command: 'C:\Users\matti\Zipline\venv-zipline\Scripts\python.exe' -u -c 'import sys, setuptools, 
  tokenize; sys.argv[0] = '"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install- 
  u0djao1v\\bcolz_ff25721e67224cf19d0fea2b456a1054\\setup.py'"'"'; 
  __file__='"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install- 
  u0djao1v\\bcolz_ff25721e67224cf19d0fea2b456a1054\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', 
  open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, 
  __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\matti\AppData\Local\Temp\pip-wheel-yk9_l_0r'
  cwd: C:\Users\matti\AppData\Local\Temp\pip-install- 
  u0djao1v\bcolz_ff25721e67224cf19d0fea2b456a1054\
  Complete output (42 lines):
  SSE2 detected
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\bcolz
  copying bcolz\arrayprint.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\attrs.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\chunked_eval.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\ctable.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\defaults.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\py2help.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\py2help_tests.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\toplevel.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\utils.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\version.py -> build\lib.win-amd64-3.6\bcolz
  copying bcolz\__init__.py -> build\lib.win-amd64-3.6\bcolz
  creating build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\all.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\common.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\test_attrs.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\test_carray.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\test_carray_objects.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\test_ctable.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\test_ndcarray.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\test_queries.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\tests\__init__.py -> build\lib.win-amd64-3.6\bcolz\tests
  copying bcolz\carray_ext.pxd -> build\lib.win-amd64-3.6\bcolz
  running build_ext
  skipping 'bcolz\carray_ext.c' Cython extension (up-to-date)
  building 'bcolz.carray_ext' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": 
  https://visualstudio.microsoft.com/visual-cpp-build-tools/
  SSE2 detected
  running bdist_wheel
  running build
  running build_py
  copying bcolz\version.py -> build\lib.win-amd64-3.6\bcolz
  running build_ext
  skipping 'bcolz\carray_ext.c' Cython extension (up-to-date)
  building 'bcolz.carray_ext' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": 
  https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for bcolz
  Running setup.py clean for bcolz
  Building wheel for bottleneck (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
  command: 'C:\Users\matti\Zipline\venv-zipline\Scripts\python.exe' 'C:\Users\matti\Zipline\venv- 
  zipline\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 
  'C:\Users\matti\AppData\Local\Temp\tmpi6jwni9b'
  cwd: C:\Users\matti\AppData\Local\Temp\pip-install- 
  u0djao1v\bottleneck_4c2f93e8934942d2b56b70de3502ceed
  Complete output (51 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\_pytesttester.py -> build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\_version.py -> build\lib.win-amd64-3.6\bottleneck
  copying bottleneck\__init__.py -> build\lib.win-amd64-3.6\bottleneck
  creating build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\autotimeit.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\bench.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\bench_detailed.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  copying bottleneck\benchmark\__init__.py -> build\lib.win-amd64-3.6\bottleneck\benchmark
  creating build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\move.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\nonreduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\nonreduce_axis.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\reduce.py -> build\lib.win-amd64-3.6\bottleneck\slow
  copying bottleneck\slow\__init__.py -> build\lib.win-amd64-3.6\bottleneck\slow
  creating build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\bn_config.py -> build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\bn_template.py -> build\lib.win-amd64-3.6\bottleneck\src
  copying bottleneck\src\__init__.py -> build\lib.win-amd64-3.6\bottleneck\src
  creating build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\input_modification_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\list_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\memory_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\move_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\nonreduce_axis_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\nonreduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\reduce_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\scalar_input_test.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\util.py -> build\lib.win-amd64-3.6\bottleneck\tests
  copying bottleneck\tests\__init__.py -> build\lib.win-amd64-3.6\bottleneck\tests
  UPDATING build\lib.win-amd64-3.6\bottleneck/_version.py
  set build\lib.win-amd64-3.6\bottleneck/_version.py to '1.3.2'
  running build_ext
  running config
  compiling '_configtest.c':



  int __attribute__((optimize("O3"))) have_attribute_optimize_opt_3(void*);

  int main(void)
  {
      return 0;
  }

  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": 
  https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for bottleneck
  Building wheel for lru-dict (setup.py) ... error
  ERROR: Command errored out with exit status 1:
  command: 'C:\Users\matti\Zipline\venv-zipline\Scripts\python.exe' -u -c 'import sys, setuptools, 
  tokenize; sys.argv[0] = '"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install-u0djao1v\\lru- 
  dict_78af74fc04d748028bedabc5a1d6a84d\\setup.py'"'"'; 
  __file__='"'"'C:\\Users\\matti\\AppData\\Local\\Temp\\pip-install-u0djao1v\\lru- 
  dict_78af74fc04d748028bedabc5a1d6a84d\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open) 
  (__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, 
  __file__, 
  '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\matti\AppData\Local\Temp\pip-wheel-qiws589m'
  cwd: C:\Users\matti\AppData\Local\Temp\pip-install-u0djao1v\lru- 
  dict_78af74fc04d748028bedabc5a1d6a84d\
  Complete output (5 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'lru' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": 
  `enter code here`https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for lru-dict
  Running setup.py clean for lru-dict
  Failed to build bcolz bottleneck lru-dict
  ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly

From my experience of installing python packages, I think the problem is most likely dependencies and packages already installed in the python environment you are trying to install zipline trader. I suggest creating a new python environment with python version 3.6 and cloning the git and trying to install with that using these two commands:

git clone https://github.com/shlomikushchi/zipline-trader.git

then inside the directory that you downloaded that git:

pip install -e .

I did this in an anaconda environment and it worked for me.
You need this package for cloning git in anaconda:

conda install -c anaconda git

You can check out instructions here too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM