Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apache报错 #7

Open
ipeaking opened this issue Jun 7, 2023 · 10 comments
Open

apache报错 #7

ipeaking opened this issue Jun 7, 2023 · 10 comments

Comments

@ipeaking
Copy link

ipeaking commented Jun 7, 2023

您好,我按照操作方法来做,到最后一步apache报错,错误日志为:
4463 2023] [wsgi:error] [pid 311707:tid 139956991420160] [client 10.11.140.104:64206] ModuleNotFoundError: No module named 'django'
[Wed Jun 07 09:37:22.628

我看了下,apache下面的配置文件貌似是对的,现在好像就是说这个虚拟环境不能用,请问应该如何解决,谢谢。

@wolverinn
Copy link
Owner

wolverinn commented Jun 7, 2023 via email

@ipeaking
Copy link
Author

ipeaking commented Jun 7, 2023

看一下你的apache配置文件呢。/etc/apache2/sites-available/sd_multi.conf;以及你活跃一下你的virtual env,然后运行python3,import django试看不能成功 Message ID: *@ .>

image

试了下,是可以的

@ipeaking
Copy link
Author

ipeaking commented Jun 7, 2023

配置文件如下:
image

@ipeaking
Copy link
Author

ipeaking commented Jun 8, 2023

@wolverinn 可以帮忙看看这个问题吗?找了好久都没有找到为什么会这样的错误

@wolverinn
Copy link
Owner

wolverinn commented Jun 8, 2023 via email

@ipeaking
Copy link
Author

ipeaking commented Jun 8, 2023

你用的是哪个云平台?如果是GPU云服务器而不是GPU服务器的话,可以直接不使用venv,将pip依靠直接安装测试,然后把conf里最后一步注解掉,重新启动apache

那我试试,我是自己的GPU服务器,不是云服务器,你的意思是我直接pip install -r requirements.txt是吧?

@wolverinn
Copy link
Owner

wolverinn commented Jun 8, 2023 via email

@ipeaking
Copy link
Author

ipeaking commented Jun 8, 2023

好的,我试一下

@ipeaking
Copy link
Author

ipeaking commented Jun 8, 2023

我直接去run它,貌似在请求的时候会报404,
image
image

另外,我这是在虚拟机中,我发现运行会运行在127.0.0.1上,请问如何运行在0.0.0.0上,这样我才能从外部访问

@wolverinn
Copy link
Owner

wolverinn commented Jun 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants