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

请问我可以pc单机运行吗? #5

Closed
zasl opened this issue Oct 9, 2017 · 9 comments
Closed

请问我可以pc单机运行吗? #5

zasl opened this issue Oct 9, 2017 · 9 comments

Comments

@zasl
Copy link

zasl commented Oct 9, 2017

系统win10,已经装了python3.6
最好是能在我的路由器上部署,路由器是最新的lede,python好像有路由器的版本,希望能得到方法来部署,谢谢

@the0demiurge
Copy link
Owner

the0demiurge commented Oct 9, 2017

可以,只要python managed.py runserver即可。需要注意的是,

  1. 需要装requirements.txt里面的依赖库
  2. views.py#L54 这里我设置的访问次数除以150余5的时候才会更新,所以你更新网站后前五次访问不会有数据,而且你访问自己网站的访问量应该不会很大,应该设置小一点的次数
  3. 因为数据源中有很多国外网站,如果不走代理的话你在自己电脑上很可能找不到太多帐号。

@zasl
Copy link
Author

zasl commented Oct 9, 2017

如果可以我就试着弄一下,我是路由器里面装了ssr,有透明代理使用gfwlist,访问外网应该不成问题。
在您这里下载的软件应该是什么,我看里面很多文件,我使用python的阶段在于pip3 install xxx?
按照你的教程,如果我访问我的路由器的路径应该是什么呢?
本人比较小白,麻烦了

@the0demiurge
Copy link
Owner

应当使用pip3 install -r requirements.txt

python的程序默认是不走代理的,如果想让它走代理,可以尝试让系统走全局代理

如果我访问我的路由器的路径应该是什么呢?

这句话我没有理解到你的意思。。

@zasl
Copy link
Author

zasl commented Oct 10, 2017

昨天尝试在lede里面安装python,因为编译的路由器固件忘记打开全部空间,昨天夜里又编译了一下,今天准备刷机安装一下。

如果不走代理是否可以在gfwlist里面添加域名来解决?因为我自己也在用BT下载电影,这样会直接导致我的账号被封。

如果我访问我的路由器的路径应该是什么呢?

这句话我没有理解到你的意思。。
看您的实例是个网页,我想会是和类似yaaw这个一样吧,就是访问我的路由器就是出来和你一样的页面。

@zasl
Copy link
Author

zasl commented Oct 10, 2017

麻烦请看一下,已经安装了python3,python-pip,setuptool
执行 pip3 install -r requirements.txt
返回信息如下,请问我该如何解决?
root@DOG:/tmp# pip3 install -r requirements.txt
Collecting Flask (from -r requirements.txt (line 1))
Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting flask-mongoengine (from -r requirements.txt (line 2))
Using cached flask-mongoengine-0.9.3.tar.gz
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/rednose/: [SSL: CERTIFICATE_VERIFY_FAILED] unknown error (_ssl.c:749) -- Some packages may not be found!
Couldn't find index page for 'rednose' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] unknown error (_ssl.c:749) -- Some packages may not be found!
No local packages or working download links found for rednose
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-yaguefgl/flask-mongoengine/setup.py", line 74, in
'Topic :: Software Development :: Libraries :: Python Modules'
File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 314, in init
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 360, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3.6/site-packages/pkg_resources/init.py", line 851, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3.6/site-packages/pkg_resources/init.py", line 1123, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3.6/site-packages/pkg_resources/init.py", line 1135, in obtain
return installer(requirement)
File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 426, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 658, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('rednose')

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-yaguefgl/flask-mongoengine/

@the0demiurge
Copy link
Owner

没有找到依赖,建议你试试Python3.5

@zasl
Copy link
Author

zasl commented Oct 10, 2017

我使用的是官方的源,看到官方源只有3.6,还不知道3.5如何安装。我在win下面的3.6也是报错。我去找下安装方法。

实在是找不到安装3.5的方法。。。

@scyslz
Copy link

scyslz commented Aug 20, 2019

为什么本地跑起来以,十分钟后,一个节点都没有

@the0demiurge
Copy link
Owner

因为被爬的网站大多数都被墙了

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

3 participants