Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Apache2、Anaconda和Django时Pandas和Numpy导入错误_Apache2_Mod Wsgi - Fatal编程技术网

使用Apache2、Anaconda和Django时Pandas和Numpy导入错误

使用Apache2、Anaconda和Django时Pandas和Numpy导入错误,apache2,mod-wsgi,Apache2,Mod Wsgi,我收到以下错误-缺少必需的依赖项['numpy'] 独立和通过Django,没有Apache2集成-代码工作很有魅力,但是当与Apache2一起使用时,情况开始下降。它拒绝进口熊猫或小熊,一个接一个地犯错误 我使用的是Apache2、libapache2-mod-wsgi-py3、Python 3.5和Anaconda 2.3.0 Request Method: GET Request URL: http://127.0.0.1/api/users/0/ Django Version: 1

我收到以下错误-缺少必需的依赖项['numpy'] 独立和通过Django,没有Apache2集成-代码工作很有魅力,但是当与Apache2一起使用时,情况开始下降。它拒绝进口熊猫或小熊,一个接一个地犯错误

我使用的是Apache2、libapache2-mod-wsgi-py3、Python 3.5和Anaconda 2.3.0

Request Method: GET
Request URL:    http://127.0.0.1/api/users/0/
Django Version: 1.10.5
Exception Type: ImportError
Exception Value:    
Missing required dependencies ['numpy']
Exception Location: /home/fractaluser/anaconda3/lib/python3.4/site-packages/pandas/__init__.py in <module>, line 18
Python Executable:  /usr/bin/python3
Python Version: 3.5.2
Python Path:    
['/home/fractaluser/anaconda3/lib/python3.4/site-packages',
 '/home/fractaluser/anaconda3/lib/python3.4/site-packages/Sphinx-1.3.1-py3.4.egg',
 '/home/fractaluser/anaconda3/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg',
 '/usr/lib/python35.zip',
 '/usr/lib/python3.5',
 '/usr/lib/python3.5/plat-x86_64-linux-gnu',
 '/usr/lib/python3.5/lib-dynload',
 '/usr/local/lib/python3.5/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/var/www/html/cgmvp']
Server time:    Fri, 9 Jun 2017 11:12:37 +0000
请求方法:获取
请求URL:http://127.0.0.1/api/users/0/
Django版本:1.10.5
异常类型:ImportError
异常值:
缺少必需的依赖项['numpy']
异常位置:/home/fractaluser/anaconda3/lib/python3.4/site packages/pandas/__init__;.py in,第18行
Python可执行文件:/usr/bin/python3
Python版本:3.5.2
Python路径:
['/home/fractaluser/anaconda3/lib/python3.4/site packages',
“/home/fractaluser/anaconda3/lib/python3.4/site packages/Sphinx-1.3.1-py3.4.egg”,
“/home/fractaluser/anaconda3/lib/python3.4/site packages/setuptools-27.2.0-py3.4.egg”,
“/usr/lib/python35.zip”,
“/usr/lib/python3.5”,
“/usr/lib/python3.5/plat-x86_64-linux-gnu”,
“/usr/lib/python3.5/lib dynload”,
“/usr/local/lib/python3.5/dist包”,
“/usr/lib/python3/dist包”,
'/var/www/html/cgmvp']
服务器时间:2017年6月9日星期五11:12:37+0000

不能强制使用系统Python版本构建的mod_wsgi使用为不同Python版本或不同Python安装构建的Python虚拟环境。这就是你正在做的事情。您需要卸载mod_wsgi并从源代码中安装,然后根据Anaconda Python发行版进行编译。最好使用
pip
install方法,并按照步骤将其集成到现有的Apache安装中。见:

另请参阅以下文档,了解如何使用mod_wsgi设置Python虚拟环境,因为您似乎也没有按照推荐的方式进行设置


不过,第一项任务是重新安装mod_wsgi。

您不能强制使用系统Python版本构建的mod_wsgi使用为不同Python版本或不同Python安装构建的Python虚拟环境。这就是你正在做的事情。您需要卸载mod_wsgi并从源代码中安装,然后根据Anaconda Python发行版进行编译。最好使用
pip
install方法,并按照步骤将其集成到现有的Apache安装中。见:

另请参阅以下文档,了解如何使用mod_wsgi设置Python虚拟环境,因为您似乎也没有按照推荐的方式进行设置


但是第一个任务是重新安装mod_wsgi。

我在mod_wsgi python 3.6 environmet 64中使用apache2时遇到了同样的问题,使用的版本是1.13,只更改了先前版本,并且工作正常

pip3 install numpy==1.12                     

我在mod_wsgi python 3.6 environmet 64中使用apache2时遇到了同样的问题,使用的版本numpy是1.13,只更改了以前的版本,并且成功了

pip3 install numpy==1.12