Unfortunately, no.
django@ASGARD:/media/DATA/coeurnoir/Bureau$ python stacks.py --stack
File "stacks.py", line 99
print(f'{folder_name} not found.')
^
SyntaxError: invalid syntax
Ok so I changed
print(f'{folder_name} not found.')
to
print("{folder_name} not found.")
now I’ve got this error
django@ASGARD:/media/DATA/coeurnoir/Bureau$ python stacks.py --stack
Traceback (most recent call last):
File "stacks.py", line 3, in <module>
import pathlib
ImportError: No module named pathlib
I take that as a progress
And changing that line 3 to
from pathlib import Path
like in the other script https://www.geeksforgeeks.org/junk-file-organizer-python/
still gives me
django@ASGARD:/media/DATA/coeurnoir/Bureau$ python stacks.py --stack
Traceback (most recent call last):
File "stacks.py", line 3, in <module>
from pathlib import Path
ImportError: No module named pathlib
Does it suggest my system is missing some package regarding python ?
django@ASGARD:~$ dpkg -l | grep python
ii libpython2-stdlib:amd64 2.7.17-2ubuntu4 amd64 interactive high-level object-oriented language (Python2)
ii libpython2.7:amd64 2.7.18-1~20.04 amd64 Shared Python runtime library (version 2.7)
ii libpython2.7-minimal:amd64 2.7.18-1~20.04 amd64 Minimal subset of the Python language (version 2.7)
ii libpython2.7-stdlib:amd64 2.7.18-1~20.04 amd64 Interactive high-level object-oriented language (standard library, version 2.7)
ii libpython3-stdlib:amd64 3.8.2-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version)
ii libpython3.8:amd64 3.8.5-1~20.04 amd64 Shared Python runtime library (version 3.8)
ii libpython3.8-minimal:amd64 3.8.5-1~20.04 amd64 Minimal subset of the Python language (version 3.8)
ii libpython3.8-stdlib:amd64 3.8.5-1~20.04 amd64 Interactive high-level object-oriented language (standard library, version 3.8)
ii libreoffice-script-provider-python 1:6.4.7-0ubuntu0.20.04.1~lo1 all Python script support provider for LibreOffice scripting framework
ii nemo-python 4.4.0-3 amd64 Python bindings for nemo components
ii python-apt-common 2.0.0ubuntu0.20.04.1 all Python interface to libapt-pkg (locales)
ii python-dbus 1.2.16-1build1 amd64 simple interprocess messaging system (Python interface)
ii python-gi 3.36.0-1 amd64 Python 2.x bindings for gobject-introspection libraries
ii python-is-python2 2.7.17-4 all symlinks /usr/bin/python to the DEPRECATED python2
ii python-tk 2.7.18-1 amd64 Tkinter - Writing Tk applications with Python2
ii python2 2.7.17-2ubuntu4 amd64 interactive high-level object-oriented language (Python2 version)
ii python2-minimal 2.7.17-2ubuntu4 amd64 minimal subset of the Python2 language
ii python2.7 2.7.18-1~20.04 amd64 Interactive high-level object-oriented language (version 2.7)
ii python2.7-minimal 2.7.18-1~20.04 amd64 Minimal subset of the Python language (version 2.7)
ii python3 3.8.2-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version)
ii python3-apport 2.20.11-0ubuntu27.12 all Python 3 library for Apport crash report handling
ii python3-apt 2.0.0ubuntu0.20.04.1 amd64 Python 3 interface to libapt-pkg
ii python3-aptdaemon 1.1.1+bzr982-0ubuntu32.2 all Python 3 module for the server and client of aptdaemon
ii python3-aptdaemon.gtk3widgets 1.1.1+bzr982-0ubuntu32.2 all Python 3 GTK+ 3 widgets to run an aptdaemon client
ii python3-blinker 1.4+dfsg1-0.3ubuntu1 all fast, simple object-to-object and broadcast signaling library
ii python3-brlapi:amd64 6.0+dfsg-4ubuntu6 amd64 Braille display access via BRLTTY - Python3 bindings
ii python3-bs4 4.8.2-1 all error-tolerant HTML parser for Python 3
ii python3-cairo:amd64 1.16.2-2ubuntu2 amd64 Python3 bindings for the Cairo vector graphics library
ii python3-certifi 2019.11.28-1 all root certificates for validating SSL certs and verifying TLS hosts (python3)
ii python3-cffi-backend 1.14.0-1build1 amd64 Foreign Function Interface for Python 3 calling C code - runtime
ii python3-chardet 3.0.4-4build1 all universal character encoding detector for Python3
ii python3-click 7.0-3 all Wrapper around optparse for command line utilities - Python 3.x
ii python3-colorama 0.4.3-1build1 all Cross-platform colored terminal text in Python - Python 3.x
ii python3-commandnotfound 20.04.4 all Python 3 bindings for command-not-found.
ii python3-cryptography 2.8-3ubuntu0.1 amd64 Python library exposing cryptographic recipes and primitives (Python 3)
ii python3-cups 1.9.73-3build1 amd64 Python3 bindings for CUPS
ii python3-cupshelpers 1.5.12-0ubuntu1 all Python utility modules around the CUPS printing system
ii python3-dateutil 2.7.3-3ubuntu1 all powerful extensions to the standard Python 3 datetime module
ii python3-dbus 1.2.16-1build1 amd64 simple interprocess messaging system (Python 3 interface)
ii python3-debconf 1.5.73 all interact with debconf from Python 3
ii python3-debian 0.1.36ubuntu1 all Python 3 modules to work with Debian-related data formats
ii python3-defer 1.0.6-2.1 all Small framework for asynchronous programming (Python 3)
ii python3-distro 1.4.0-1 all Linux OS platform information API
ii python3-distro-info 0.23ubuntu1 all information about distributions' releases (Python 3 module)
ii python3-distupgrade 1:20.04.28 all manage release upgrades
ii python3-entrypoints 0.3-2ubuntu1 all Discover and load entry points from installed packages (Python 3)
ii python3-gdbm:amd64 3.8.5-1~20.04.1 amd64 GNU dbm database support for Python 3.x
ii python3-gi 3.36.0-1 amd64 Python 3 bindings for gobject-introspection libraries
ii python3-gi-cairo 3.36.0-1 amd64 Python 3 Cairo bindings for the GObject library
ii python3-gst-1.0 1.16.2-2 amd64 GStreamer GObject Introspection overrides for Python (Python 3)
ii python3-html5lib 1.0.1-2 all HTML parser/tokenizer based on the WHATWG HTML5 specification
ii python3-httplib2 0.14.0-1ubuntu1 all comprehensive HTTP client library written for Python3
ii python3-ibus-1.0 1.5.22-2ubuntu2.1 all Intelligent Input Bus - introspection overrides for Python (Python 3)
ii python3-idna 2.8-1 all Python IDNA2008 (RFC 5891) handling (Python 3)
ii python3-jwt 1.7.1-2ubuntu2 all Python 3 implementation of JSON Web Token
ii python3-keyring 18.0.1-2ubuntu1 all store and access your passwords safely - Python 3 version of the package
ii python3-launchpadlib 1.10.13-1 all Launchpad web services client library (Python 3)
ii python3-lazr.restfulclient 0.14.2-2build1 all client for lazr.restful-based web services (Python 3)
ii python3-lazr.uri 1.0.3-4build1 all library for parsing, manipulating, and generating URIs
ii python3-libdiscid 1.0-5ubuntu2 amd64 libdiscid binding for Python 3
ii python3-louis 3.12.0-3 all Python bindings for liblouis
ii python3-lxml:amd64 4.5.0-1 amd64 pythonic binding for the libxml2 and libxslt libraries
ii python3-macaroonbakery 1.3.1-1 all Higher-level macaroon operations for Python 3
ii python3-mako 1.1.0+ds1-1ubuntu2 all fast and lightweight templating for the Python 3 platform
ii python3-markupsafe 1.1.0-1build2 amd64 HTML/XHTML/XML string library for Python 3
ii python3-minimal 3.8.2-0ubuntu2 amd64 minimal subset of the Python language (default python3 version)
ii python3-mutagen 1.44.0-1 all audio metadata editing library (Python 3)
ii python3-nacl 1.3.0-5 amd64 Python bindings to libsodium (Python 3)
ii python3-netifaces 0.10.4-1ubuntu4 amd64 portable network interface information - Python 3.x
ii python3-notify2 0.3-4 all desktop notifications API for Python 3
ii python3-oauthlib 3.1.0-1ubuntu2 all generic, spec-compliant implementation of OAuth for Python3
ii python3-olefile 0.46-2 all Python module to read/write MS OLE2 files
ii python3-pexpect 4.6.0-1build1 all Python 3 module for automating interactive applications
ii python3-pil:amd64 7.0.0-4ubuntu0.1 amd64 Python Imaging Library (Python3)
ii python3-pkg-resources 45.2.0-1 all Package Discovery and Resource Access using pkg_resources
ii python3-problem-report 2.20.11-0ubuntu27.12 all Python 3 library to handle problem reports
ii python3-protobuf 3.6.1.3-2ubuntu5 amd64 Python 3 bindings for protocol buffers
ii python3-psutil 5.5.1-1ubuntu4 amd64 module providing convenience functions for managing processes (Python3)
ii python3-ptyprocess 0.6.0-1ubuntu1 all Run a subprocess in a pseudo terminal from Python 3
ii python3-pyatspi 2.36.0-1 all Assistive Technology Service Provider Interface - Python3 bindings
ii python3-pymacaroons 0.13.0-3 all Macaroon library for Python 3
ii python3-pyqt5 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5
ii python3-pyqt5.qtmultimedia 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5's Multimedia module
ii python3-pyudev 0.21.0-3ubuntu1 all Python3 bindings for libudev
ii python3-pyxattr 0.6.1-2 amd64 module for manipulating filesystem extended attributes (Python3)
ii python3-renderpm:amd64 3.5.34-1ubuntu1 amd64 python low level render interface
ii python3-reportlab 3.5.34-1ubuntu1 all ReportLab library to create PDF documents using Python3
ii python3-reportlab-accel:amd64 3.5.34-1ubuntu1 amd64 C coded extension accelerator for the ReportLab Toolkit
ii python3-requests 2.22.0-2ubuntu1 all elegant and simple HTTP library for Python3, built for human beings
ii python3-requests-unixsocket 0.2.0-2 all Use requests to talk HTTP via a UNIX domain socket - Python 3.x
ii python3-rfc3339 1.1-2 all parser and generator of RFC 3339-compliant timestamps (Python 3)
ii python3-secretstorage 2.3.1-2ubuntu1 all Python module for storing secrets - Python 3.x version
ii python3-setproctitle:amd64 1.1.10-1ubuntu1 amd64 Setproctitle implementation for Python 3
ii python3-simplejson 3.16.0-2ubuntu2 amd64 simple, fast, extensible JSON encoder/decoder for Python 3.x
ii python3-sip 4.19.21+dfsg-1build1 amd64 Python 3/C++ bindings generator runtime library
ii python3-six 1.14.0-2 all Python 2 and 3 compatibility library (Python 3 interface)
ii python3-software-properties 0.98.9.2 all manage the repositories that you install software from
ii python3-soupsieve 1.9.5+dfsg-1 all modern CSS selector implementation for BeautifulSoup (Python 3)
ii python3-speechd 0.9.1-4 all Python interface to Speech Dispatcher
ii python3-systemd 234-3build2 amd64 Python 3 bindings for systemd
ii python3-talloc:amd64 2.3.0-3ubuntu1 amd64 hierarchical pool based memory allocator - Python3 bindings
ii python3-tz 2019.3-1 all Python3 version of the Olson timezone database
ii python3-uno 1:6.4.7-0ubuntu0.20.04.1~lo1 amd64 Python-UNO bridge
ii python3-update-manager 1:20.04.10.1 all python 3.x module for update-manager
ii python3-urllib3 1.25.8-2ubuntu0.1 all HTTP library with thread-safe connection pooling for Python3
ii python3-wadllib 1.3.3-3build1 all Python 3 library for navigating WADL files
ii python3-webencodings 0.5.1-1ubuntu1 all Python implementation of the WHATWG Encoding standard
ii python3-xapian 1.4.14-1ubuntu2 amd64 Xapian search engine interface for Python3
ii python3-xapp 1.8.1-2 all Python 3 XApp library
ii python3-xdg 0.26-1ubuntu1 all Python 3 library to access freedesktop.org standards
ii python3-xkit 0.5.0ubuntu4 all library for the manipulation of xorg.conf files (Python 3)
ii python3-yaml 5.3.1-1 amd64 YAML parser and emitter for Python3
ii python3.8 3.8.5-1~20.04 amd64 Interactive high-level object-oriented language (version 3.8)
ii python3.8-minimal 3.8.5-1~20.04 amd64 Minimal subset of the Python language (version 3.8)
django@ASGARD:~$
Searching… as suggested here https://stackoverflow.com/q/60788709
django@ASGARD:~$ python --version
Python 2.7.18
django@ASGARD:~$
My actual 20.04 is an upgrade from 19.10 is all I can add.
Now am trying
django@ASGARD:/media/DATA/coeurnoir/Bureau$ python3 stacks.py --stack
Traceback (most recent call last):
File "stacks.py", line 110, in <module>
stack()
File "stacks.py", line 86, in stack
if get_file_type(file, file_type_by_extension):
File "stacks.py", line 73, in get_file_type
if pathlib.Path(file).suffix.lower() in extension:
NameError: name 'pathlib' is not defined
django@ASGARD:/media/DATA/coeurnoir/Bureau$
All folders have been created on my desktop but no files were moved into them.
NameError: name 'pathlib' is not defined
so something’s missing about pathlib in my UBudgie ?