在服务器上没有根访问权限的情况下,我如何安装numpy?

2024-09-30 16:24:59 发布

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

我想在没有根访问权限的服务器上安装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)

下一步我该怎么办?请告诉我一些想法


Tags: installpipinpynumpyhomebinmain
2条回答

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

this bug?在

Any non-ASCII character in the log causes PIP to crash with UnicodeDecodeError.

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

相关问题 更多 >