When using autogen docker, is it always necessary to reinstall modules? #877
Unanswered
skeletonwarrior
asked this question in
Q&A
Replies: 2 comments
-
@sonichi @afourney can help answer per experience with docker. Also candidate to add to FAQ |
Beta Was this translation helpful? Give feedback.
0 replies
-
The "use_docker" arg in an agent's code_execution_config will be set to the name of the image containing the change after execution, when the conversation finishes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using autogen docker, is it always necessary to reinstall modules?
I have already used the request module, but
It seems that the process of installing the requests module is repeated every time the script is run. Is there a way to reuse a module once installed? I'm curious if there's something I need to configure in Docker.
===================
My Script
Console Result
You can save this code in a file named
crypto_value.py
and run it with Python.exitcode: 1 (execution failed)
Code output:
Traceback (most recent call last):
File "crypto_value.py", line 3, in
import requests
ModuleNotFoundError: No module named 'requests'
assistant (to user_proxy):
It seems like the 'requests' module is not installed in your Python environment. You can install it using pip, which is a package manager for Python. Here is the command to install 'requests':
After running this command, you should be able to execute the Python script without any issues.
exitcode: 0 (execution succeeded)
Code output:
Collecting requests
Obtaining dependency information for requests from https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl.metadata
Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting charset-normalizer<4,>=2 (from requests)
Obtaining dependency information for charset-normalizer<4,>=2 from https://files.pythonhosted.org/packages/99/b0/9c365f6d79a9f0f3c379ddb40a256a67aa69c59609608fe7feb6235896e1/charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
Downloading charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests)
Obtaining dependency information for idna<4,>=2.5 from https://files.pythonhosted.org/packages/c2/e7/a82b05cf63a603df6e68d59ae6a68bf5064484a0718ea5033660af4b54a9/idna-3.6-py3-none-any.whl.metadata
Downloading idna-3.6-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests)
Obtaining dependency information for urllib3<3,>=1.21.1 from https://files.pythonhosted.org/packages/96/94/c31f58c7a7f470d5665935262ebd7455c7e4c7782eb525658d3dbf4b9403/urllib3-2.1.0-py3-none-any.whl.metadata
Downloading urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests)
Obtaining dependency information for certifi>=2017.4.17 from https://files.pythonhosted.org/packages/64/62/428ef076be88fa93716b576e4a01f919d25968913e817077a386fcbe4f42/certifi-2023.11.17-py3-none-any.whl.metadata
Downloading certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB)
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 8.4 MB/s eta 0:00:00
Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.5/162.5 kB 13.4 MB/s eta 0:00:00
Downloading charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (137 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.3/137.3 kB 15.4 MB/s eta 0:00:00
Downloading idna-3.6-py3-none-any.whl (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 7.0 MB/s eta 0:00:00
Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.6/104.6 kB 19.8 MB/s eta 0:00:00
Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests
Successfully installed certifi-2023.11.17 charset-normalizer-3.3.2 idna-3.6 requests-2.31.0 urllib3-2.1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip
assistant (to user_proxy):
Great, the 'requests' module has been successfully installed. Now, you can run the Python script again to get the total value of 2 Bitcoins and 3 Ethereums. Here is the script again for your convenience:
You can save this code in a file named
crypto_value.py
and run it with Python.exitcode: 0 (execution succeeded)
Code output:
The total value of 2 Bitcoins and 3 Ethereums is 122463000.0 KRW.
assistant (to user_proxy):
Great! The script has successfully fetched the prices of Bitcoin and Ethereum from the Upbit API and calculated the total value.
The total value of 2 Bitcoins and 3 Ethereums is 122,463,000 KRW.
Please verify this value with the current prices on the Upbit website or app, as cryptocurrency prices can fluctuate rapidly.
TERMINATE
Process finished with exit code 0
Beta Was this translation helpful? Give feedback.
All reactions