无法通过pip安装安装币安软件包

时间:2020-07-09 10:33:48

标签: python macos pip

我正在尝试通过编写pip install python-binance在Jupyter笔记本中使用pip安装binance软件包 并面对这个错误

  ERROR: Command errored out with exit status 1:
   command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/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 /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-wheel-ivmvv_y7
       cwd: /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/
  Complete output (17 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.7
  creating build/lib.macosx-10.9-x86_64-3.7/regex
  copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
  copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
  copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
  copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
  running build_ext
  building 'regex._regex' extension
  creating build/temp.macosx-10.9-x86_64-3.7
  creating build/temp.macosx-10.9-x86_64-3.7/regex_3
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for regex
  Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex, dateparser, python-binance
    Running setup.py install for regex ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-record-fasv8uk1/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/regex
         cwd: /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/regex
    copying regex_3/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/regex
    copying regex_3/regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
    copying regex_3/_regex_core.py -> build/lib.macosx-10.9-x86_64-3.7/regex
    copying regex_3/test_regex.py -> build/lib.macosx-10.9-x86_64-3.7/regex
    running build_ext
    building 'regex._regex' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/regex_3
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.9-x86_64-3.7/regex_3/_regex.o
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-install-s46aq8me/regex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kl/r9yjm40s5b160dlwk2pcfbbr0000gn/T/pip-record-fasv8uk1/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/regex Check the logs for full command output

我已经尝试了其他stackoverflow问题的解决方案,但对我没有任何帮助。我最近也将macOS升级到Catalina 10.15.5。 预先谢谢你

1 个答案:

答案 0 :(得分:0)

这是使您的pip安装程序崩溃的错误:

 xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

此错误是在升级macOS时引起的。控制台中的这一行应该可以解决问题。

xcode-select -–install

如果这不起作用,则需要重新设置:

sudo xcode-select --reset