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

the docker version seem not working. Error: "ImportError: cannot import name 'PY2' from 'ruamel.yaml.compat'" #111

Open
zebux opened this issue Nov 8, 2024 · 1 comment

Comments

@zebux
Copy link

zebux commented Nov 8, 2024

Describe the bug
After the command :
$ docker build -t sooty .
$ docker run --rm -it sooty
I have the error message :
Traceback (most recent call last):
File "/app/Sooty.py", line 20, in
import strictyaml
File "/usr/local/lib/python3.7/site-packages/strictyaml/init.py", line 2, in
from strictyaml.parser import load
File "/usr/local/lib/python3.7/site-packages/strictyaml/parser.py", line 21, in
from ruamel.yaml.compat import PY2
ImportError: cannot import name 'PY2' from 'ruamel.yaml.compat' (/usr/local/lib/python3.7/site-packages/ruamel/yaml/compat.py)

Reproduction Steps
Steps to reproduce the behavior:

  1. git clone https://github.com/TheresAFewConors/Sooty.git
  2. docker build -t sooty . && docker run --rm -it sooty

Expected behavior
A clear and concise description of what was expected to happen.

Screenshots
image

Desktop Operating System:

  • OS:
    $ cat /etc/lsb-release
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.04
    DISTRIB_CODENAME=noble
    DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
  • Docker version
    $ docker -v
    Docker version 27.3.1, build ce12230

Additional context
I think the issue may be solve manualy (I am not a python / docker expert) if you downgrade the ruamel.yaml
$ docker run --rm -it sooty /bin/bash
root@c1c59e030321:/app#
root@c1c59e030321:/app# pip install 'ruamel.yaml<=0.15.94'
Collecting ruamel.yaml<=0.15.94
Downloading ruamel.yaml-0.15.94-cp37-cp37m-manylinux1_x86_64.whl (647 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 647.9/647.9 kB 34.5 MB/s eta 0:00:00
Installing collected packages: ruamel.yaml
Attempting uninstall: ruamel.yaml
Found existing installation: ruamel.yaml 0.18.6
[...]
root@c1c59e030321:/app# python Sooty.py
Cant install Win32com package
Config.yaml not found. Check the example config file and rename to 'config.yaml'.

@@@@@@ @@@@@@ @@@@@@ @@@@@@@ @@@ @@@
@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@ @@@ @@@
!@@ @@! @@@ @@! @@@ @@! @@! !@@
!@! !@! @!@ !@! @!@ !@! !@! @!!
!!@@!! @!@ !@! @!@ !@! @!! !@!@!
!!@!!! !@! !!! !@! !!! !!! @!!!
!:! !!: !!! !!: !!! !!: !!:
!:! :!: !:! :!: !:! :!: :!:
:::: :: ::::: :: ::::: :: :: ::
:: : : : : : : : : : :

                       by @TheresAFewConors

The SOC Analyst's all-in-one tool to automate and speed up workflow

Press Enter to continue..

I hope this may help

@zebux
Copy link
Author

zebux commented Nov 8, 2024

I try to change my requirement.txt file and add the line :
ruamel.yaml==0.17.32

And it work as expected. The version 0.17.32 seem to be the last working package. A superior version of the package displays the error.

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

1 participant