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

2024-09-28 17:07:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过写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

我尝试过其他问题的解决方案,但都不管用。我最近还将macOS升级到Catalina 10.15.5。 先谢谢你


Tags: installpippybuildvarlibprivatex86
1条回答
网友
1楼 · 发布于 2024-09-28 17:07:31

以下是导致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

相关问题 更多 >