【问题标题】:How can I install numpy exactly without root access on server?如何在服务器上没有 root 访问权限的情况下完全安装 numpy?
【发布时间】:2014-12-31 00:45:35
【问题描述】:

我想在没有 root 访问权限的服务器上安装 numpy。我已经安装了 pip,但是当我尝试 pip install numpy 时出现错误。

Command /home/wanglan0605/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_wanglan0605/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gb9EVf-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_wanglan0605/numpy

Traceback (most recent call last):
  File "/home/wanglan0605/local/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/wanglan0605/local/lib/python2.7/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/home/wanglan0605/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 70: ordinal not in range(128)

接下来我该怎么做?请给我一些想法

【问题讨论】:

  • 我可以看到问题,我认为这不是因为 root 访问。您的输入参数有错误。
  • 你能告诉我哪些输入参数我做错了吗?我完全不明白
  • 这是你运行pip install numpy 的时候吗?你在使用虚拟环境吗?你在安装 numpy 的时候有没有按下任何东西?因为当我按下Control-C 时,我重现了这个错误。
  • 不,我什么都没做。我已经尝试了很多次 pip install numpy 但它不起作用
  • 您始终可以从 continuum 使用 Anaconda。这是免费的。 store.continuum.io/cshop/anaconda

标签: python ubuntu numpy pip


【解决方案1】:

this bug吗?

日志中的任何非 ASCII 字符都会导致 PIP 崩溃并出现 UnicodeDecodeError。

有一个patch suggested by remram44 on github,当我之前遇到类似错误时,这对我有用。

【讨论】:

  • 它还说 /usr/bin/ld: cannot find -lptf77blas 但那是什么
  • 它在哪里说的?我不确定我是否知道如何解决您的问题,但我也建议改用Anaconda(如上面的@mrcl),它应该能够在没有root 访问权限的情况下安装。
【解决方案2】:

我尝试了很多安装python库的方法。在没有 root 访问权限的情况下安装 python 库的最有效方法是Anaconda。只需使用wget 命令和bash Anaconda-2.1.0-Linux-x86.sh,然后按两次或三次是。完成后,所有常用的包都可以准确安装。 这确实比分别安装这些软件包更方便。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-06
    • 1970-01-01
    • 2016-11-18
    • 2011-11-19
    相关资源
    最近更新 更多