我使用一堆库在python中编写了一个python程序,其中一个是我在网上找到的非官方的TikTok api。在没有docker的情况下运行程序时,它可以完美运行,并且对邮递员的响应正确。但是,当我尝试通过docker使用同一程序时,遇到了问题。
我正在尝试使用docker compose在AWS服务器上启动我的程序。命令“ sudo docker-compose build”有效,但是当我键入“ sudo docker-compose up”时,得到以下响应:
LinearLayout linear = itemView.findViewById(R.id.r1);
在本地计算机上运行相同的代码时,我得到以下响应(相似但不相同):
ubuntu@ip-172-31-30-109:~/tiktokanalyzer$ sudo docker-compose up
Starting tiktokanalyzer_tiktokanalyzer_1 ... done
Attaching to tiktokanalyzer_tiktokanalyzer_1
tiktokanalyzer_1 | Traceback (most recent call last):
tiktokanalyzer_1 | File "/usr/src/app/app.py", line 11, in <module>
tiktokanalyzer_1 | tiktokapi = TikTokApi()
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/TikTokApi/tiktok.py", line 32, in __init__
tiktokanalyzer_1 | b = browser("newParam", newParams=True, **kwargs)
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/TikTokApi/browser.py", line 85, in __init__
tiktokanalyzer_1 | fut.result()
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 440, in result
tiktokanalyzer_1 | return self.__get_result()
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
tiktokanalyzer_1 | raise self._exception
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/TikTokApi/browser.py", line 103, in newParams
tiktokanalyzer_1 | self.browser = await pyppeteer.launch(self.options)
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 305, in launch
tiktokanalyzer_1 | return await Launcher(options, **kwargs).launch()
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 166, in launch
tiktokanalyzer_1 | self.browserWSEndpoint = get_ws_endpoint(self.url)
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 225, in get_ws_endpoint
tiktokanalyzer_1 | raise BrowserError('Browser closed unexpectedly:\n')
tiktokanalyzer_1 | pyppeteer.errors.BrowserError: Browser closed unexpectedly:
tiktokanalyzer_1 |
tiktokanalyzer_1 | Error in atexit._run_exitfuncs:
tiktokanalyzer_1 | Traceback (most recent call last):
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/site-packages/pyppeteer/launcher.py", line 151, in _close_process
tiktokanalyzer_1 | self._loop.run_until_complete(self.killChrome())
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 618, in run_until_complete
tiktokanalyzer_1 | self._check_running()
tiktokanalyzer_1 | File "/usr/local/lib/python3.9/asyncio/base_events.py", line 578, in _check_running
tiktokanalyzer_1 | raise RuntimeError('This event loop is already running')
tiktokanalyzer_1 | RuntimeError: This event loop is already running
tiktokanalyzer_1 | sys:1: RuntimeWarning: coroutine 'Launcher.killChrome' was never awaited
tiktokanalyzer_1 | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
tiktokanalyzer_tiktokanalyzer_1 exited with code 1
感谢您的帮助:)