Git Product home page Git Product logo

Comments (12)

shuaiwcm avatar shuaiwcm commented on August 15, 2024

又运行了一次,上面少描述了个情况,在运行sudo docker run liuxipo/itvall 时,会有个提示
Exception managing chrome: request or response body error: operation timed out

from tv.

ssili126 avatar ssili126 commented on August 15, 2024

这个是dockerfile文件,可以自己生成运行:

使用基础镜像

FROM python:3.12

安装 Chrome 和 ChromeDriver

RUN apt-get update && apt-get install -y chromium chromium-driver

设置环境变量,指定 ChromeDriver 的路径

ENV CHROME_DRIVER_PATH /usr/lib/chromium/chromedriver

创建工作目录

WORKDIR /app

复制 Python 文件和所需的文件到容器中

COPY itvall.py .

安装 Python 依赖包

RUN pip install selenium requests eventlet futures

执行 Python 文件

CMD python itvall.py

from tv.

shuaiwcm avatar shuaiwcm commented on August 15, 2024

COPY itvall.py .
此步骤的文件从哪里获取

from tv.

ssili126 avatar ssili126 commented on August 15, 2024

可以改名字,库里的文件就可以

from tv.

shuaiwcm avatar shuaiwcm commented on August 15, 2024

按照代码构建镜像过程中,在最后一步出错,提示信息为:
ERROR: failed to solve: process "/bin/sh -c pip install selenium requests eventlet futures" did not complete successfully: exit code: 2

from tv.

ssili126 avatar ssili126 commented on August 15, 2024

去掉selenium试试

from tv.

shuaiwcm avatar shuaiwcm commented on August 15, 2024

ERROR: failed to solve: process "/bin/sh -c pip install requests eventlet futures" did not complete successfully: exit code: 2

from tv.

ssili126 avatar ssili126 commented on August 15, 2024

得看看具体安装什么出错了,有可能是网络本身的问题,下载源不能访问

from tv.

shuaiwcm avatar shuaiwcm commented on August 15, 2024

59.14 ERROR: Exception:
59.14 Traceback (most recent call last):
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
59.14 yield
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 561, in read
59.14 data = self._fp_read(amt) if not fp_closed else b""
59.14 ^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 527, in _fp_read
59.14 return self._fp.read(amt) if amt is not None else self._fp.read()
59.14 ^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 98, in read
59.14 data: bytes = self.__fp.read(amt)
59.14 ^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/http/client.py", line 479, in read
59.14 s = self.fp.read(amt)
59.14 ^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/socket.py", line 707, in readinto
59.14 return self._sock.recv_into(b)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/ssl.py", line 1252, in recv_into
59.14 return self.read(nbytes, buffer)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/ssl.py", line 1104, in read
59.14 return self._sslobj.read(len, buffer)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 TimeoutError: The read operation timed out
59.14
59.14 During handling of the above exception, another exception occurred:
59.14
59.14 Traceback (most recent call last):
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
59.14 status = run_func(*args)
59.14 ^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
59.14 return func(self, options, args)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 377, in run
59.14 requirement_set = resolver.resolve(
59.14 ^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
59.14 result = self._result = resolver.resolve(
59.14 ^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
59.14 state = resolution.resolve(requirements, max_rounds=max_rounds)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
59.14 self._add_to_criteria(self.state.criteria, r, parent=None)
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
59.14 if not criterion.candidates:
59.14 ^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in bool
59.14 return bool(self._sequence)
59.14 ^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in bool
59.14 return any(self)
59.14 ^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in
59.14 return (c for c in iterator if id(c) not in self._incompatible_ids)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
59.14 candidate = func()
59.14 ^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 182, in _make_candidate_from_link
59.14 base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 228, in _make_base_candidate_from_link
59.14 self._link_candidate_cache[link] = LinkCandidate(
59.14 ^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 290, in init
59.14 super().init(
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in init
59.14 self.dist = self._prepare()
59.14 ^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 222, in _prepare
59.14 dist = self._prepare_distribution()
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 301, in _prepare_distribution
59.14 return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 525, in prepare_linked_requirement
59.14 return self._prepare_linked_requirement(req, parallel_builds)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 596, in _prepare_linked_requirement
59.14 local_file = unpack_url(
59.14 ^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 168, in unpack_url
59.14 file = get_http_url(
59.14 ^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 109, in get_http_url
59.14 from_path, content_type = download(link, temp_dir.path)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/network/download.py", line 147, in call
59.14 for chunk in chunks:
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_internal/network/utils.py", line 63, in response_chunks
59.14 for chunk in response.raw.stream(
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 622, in stream
59.14 data = self.read(amt=amt, decode_content=decode_content)
59.14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 560, in read
59.14 with self._error_catcher():
59.14 File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
59.14 self.gen.throw(value)
59.14 File "/usr/local/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py", line 443, in _error_catcher
59.14 raise ReadTimeoutError(self._pool, None, "Read timed out.")
59.14 pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

Dockerfile:6

4 | WORKDIR /app
5 | COPY itvall.py .
6 | >>> RUN pip install requests eventlet futures
7 | CMD python itvall.py
8 |

ERROR: failed to solve: process "/bin/sh -c pip install requests eventlet futures" did not complete successfully: exit code: 2

from tv.

ssili126 avatar ssili126 commented on August 15, 2024

是不是需要科学上网,很多访问超时

from tv.

shuaiwcm avatar shuaiwcm commented on August 15, 2024

科学上网后,镜像构建成功,但在运行时提示
3060 RLock(s) were not greened, to fix this error make sure you run eventlet.monkey_patch() before importing any other modules.
不知道是不是这个原因,运行出来的结果只有6个,我用的是[itv_all(1080).py]这个文件改名后制作的镜像。

from tv.

ssili126 avatar ssili126 commented on August 15, 2024

eventlet安装的问题,重新安装试试,

from tv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.