我正在使用XAMPP在我的机器上开发一个应用程序,并希望托管该应用程序。我按照apachefriends上的说明进行操作,并使用Bitnami和LAMP堆栈设置服务器。我有一些python脚本,我需要在服务器上运行cron作业,每隔一段时间更新一次应用程序。我正在四处阅读并发现LAMP实际上并不支持Python。
我尝试使用pip来安装我需要的一些软件包(比如pandas,urllib等),但是由于安装中出现了一些语法错误,我无法安装它们。我假设这些错误来自Python不兼容LAMP。我的问题是,如何获得我需要的pip包并运行python脚本?我需要切换提供商吗?
服务器有Python(3.4.2)但我无法运行任何脚本,因为它们需要pip包。我可以将pip包从本地计算机安全地传输到服务器吗?
命令pip install pandas
之后的长错误消息的开头:
Downloading/unpacking pandas
Downloading pandas-0.19.1.tar.gz (8.4MB): 8.4MB downloaded
Running setup.py (path:/tmp/pip-build-phnk68m3/pandas/setup.py) egg_info for package pandas
/bin/sh: 1: svnversion: not found
/bin/sh: 1: svnversion: not found
non-existing path in 'numpy/distutils': 'site.cfg'
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable ifort
Could not locate executable ifc
Could not locate executable lf95
Could not locate executable pgfortran
Could not locate executable f90
Could not locate executable f77
Could not locate executable fort
Could not locate executable efort
Could not locate executable efc
Could not locate executable g77
Could not locate executable g95
Could not locate executable pathf95
don't know how to compile Fortran code on platform 'posix'
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
int exp (void);
^
_configtest.o: In function `main':
/tmp/easy_install-m3nli_19/numpy-1.12.0rc1/_configtest.c:6: undefined reference to `exp'
collect2: error: ld returned 1 exit status
_configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
int exp (void);
^
_configtest.c:1:24: fatal error: sys/endian.h: No such file or directory
#include <sys/endian.h>
^
compilation terminated.
_configtest.c: In function ‘main’:
_configtest.c:5:16: warning: variable ‘test_array’ set but not used [-Wunused-but-set-variable]
static int test_array [1 - 2 * !(((long) (sizeof (npy_check_sizeof_type))) >= 0)];
^
编辑:所以我认为LAMP堆栈没有很多运行numpy的核心要求(fortran,c,其他东西)。所以我在想是否有办法将我的本地目录链接到服务器并让服务器自动从我的目录中获取更改?
答案 0 :(得分:0)
我在ubuntu遇到了类似的问题。
如果非root用户,numpy
似乎很难自行安装。
我运行了以下两个命令并让它运行:
sudo -H pip install numpy
sudo -H pip install pandas