首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌colab Glove_Python pip安装无法正常工作

谷歌colab Glove_Python pip安装无法正常工作
EN

Stack Overflow用户
提问于 2021-02-27 14:11:15
回答 1查看 1.9K关注 0票数 5

我正在使用

代码语言:javascript
复制
! pip install glove_python

我收到这个错误消息:

代码语言:javascript
复制
Collecting glove_python
  Downloading https://files.pythonhosted.org/packages/3e/79/7e7e548dd9dcb741935d031117f4bed133276c2a047aadad42f1552d1771/glove_python-0.1.0.tar.gz (263kB)
     |████████████████████████████████| 266kB 16.9MB/s 
Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from glove_python) (1.19.5)
Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-packages (from glove_python) (1.4.1)
Building wheels for collected packages: glove-python
  Building wheel for glove-python (setup.py) ... error
  **ERROR: Failed building wheel for glove-python**
  Running setup.py clean for glove-python
  **ERROR: Failed cleaning build dir for glove-python**
Failed to build glove-python
Installing collected packages: glove-python
    Running setup.py install for glove-python ... error
**ERROR: Command errored out with exit status 1**: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nypxp28t/glove-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nypxp28t/glove-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cnn32mbr/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

按照下面的建议,我尝试了

代码语言:javascript
复制
! python -m pip install glove_python --verbose

它使用不同的成员输出以下重复出现的错误:

代码语言:javascript
复制
has no member named ‘exc_{member}’; did you mean ‘curexc_value’?

并以:

代码语言:javascript
复制
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Running setup.py install for glove-python ... error
Cleaning up...
  Removing source in /tmp/pip-install-ru3hxbde/glove-python
Removed build tracker '/tmp/pip-req-tracker-ps3qzi71'
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ru3hxbde/glove-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ru3hxbde/glove-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ywzvlm5m/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python3.7/dist-packages/pip/_internal/commands/install.py", line 455, in run
    use_user_site=options.use_user_site,
  File "/usr/local/lib/python3.7/dist-packages/pip/_internal/req/__init__.py", line 62, in install_given_reqs
    **kwargs
  File "/usr/local/lib/python3.7/dist-packages/pip/_internal/req/req_install.py", line 888, in install
    cwd=self.unpacked_source_directory,
  File "/usr/local/lib/python3.7/dist-packages/pip/_internal/utils/subprocess.py", line 275, in runner
    spinner=spinner,
  File "/usr/local/lib/python3.7/dist-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ru3hxbde/glove-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ru3hxbde/glove-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ywzvlm5m/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

尝试pip install glove-python-binary是成功的,但是当我导入它时,我得到了以下错误:

代码语言:javascript
复制
    import glove-python-binary
                ^
SyntaxError: invalid syntax
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-02-27 18:13:00

看起来glove_python包很旧了,上一次在PIP上重新发布是在2016年。而且它只有源代码,所以应该由C/C++编译器编译,这通常是有问题的(需要手动安装正确的编译器和所有依赖项)。

看起来更新的版本是glove-python-binary它可以追溯到2020年。尝试通过! pip install glove-python-binary安装它。

根据pypi site glove-python-binary needs Python3.6、3.7或3.8版本的说法,较小或较大版本的Python可能无法工作。

当您在pip中遇到任何问题或错误时,尝试将--verbose添加到pip命令行,这将打印有关pip失败原因的许多详细信息。

此外,作为@GameDev said,有时您还必须尝试运行命令! python -m pip install PACKAGE而不是! pip install PACKAGE来安装任何Python pip包,因为第一个命令使用的正是您用来运行脚本的python,而第二个命令可能使用其他Python安装中的pip,而不是稍后用于运行实际脚本的Python安装中的Python。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66396100

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档