0

我有一些 pyhton 脚本,它们在我的本地计算机上运行良好,但正如您所猜测的那样,在服务器上不是很好!

我想使用“pythonbrew”,因为在服务器上我只安装了 Python 2.7.6,但我需要运行 hdf5-package ... 好的

我安装了pythonbrew(根据https://pypi.python.org/pypi/pythonbrew/)并切换到版本 2.7.10 (就像我在本地计算机上使用的那样)。

现在我得到了一些“numpy-issues”。所以我用 pip 成功安装了numpy(根据How do you install numpy when you are not a superuser?https://gist.github.com/audy/4012573),但是,当我运行程序时:

pythonbrew py startup.py

我收到错误消息说找不到numpy ...

我真的不知道我在这里错过了什么?我很感激任何帮助!

4

1 回答 1

0

I found out myself how to run a python script with pythonbrew properly!

According installation guide for pythonbrew (see: https://pypi.python.org/pypi/pythonbrew/), the following line should be used to run a script:

pythonbrew py myprogramm.py

However, I can run my script by using python instead of pythonbrew py:

python myprogramm.py

I cannot give an explanation for that, sorry. But maybe other people can. It is just working very well like this and I can use python and all packages normally!

Further instructions of how to use pythonbrew, installing or switching between different version etc., see the link to the installation guide I posted above!

More details about pythonbrew and usage (from my perspective of view):

The installation guide I mentioned explains step by step how to install pythonbrew in your home directory (e.g. on a server) and helps to set up python on a system where you are not superuser (e.g. a server where you are allowed to run scripts but not to execute any further installations!).

I had the problem that I needed a more up to date python-version and the server where the data is located is equipped with an older version. The other half of the story is that I also needed some packages (e.g. h5py or cosmolopy) which are also not installed at the server.

For me the easiest and perfectly working solution to that problems was to use pythonbrew and install it at my home directory on the server!

于 2016-02-23T16:38:38.080 回答