Python Forum
import commands modules not working in python 3.6.0
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import commands modules not working in python 3.6.0
#1
I have updated the python version to 3.6.0. I am trying to "import commands" modules so I could save the shell commands for some purpose, but I am getting error like below. Any alternative to commands module.


>>> import commands
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'commands'
Reply
#2
From Python2.7 docs:
Quote:Deprecated since version 2.6: The commands module has been removed in Python 3. Use the subprocess module instead.
Reply
#3
Thank you very much, I got my program running again..
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Different Ways to Import Modules RockBlok 2 538 Dec-11-2023, 04:29 PM
Last Post: deanhystad
  How to see the date of installation of python modules. newbieAuggie2019 4 1,629 Mar-31-2023, 12:40 PM
Last Post: newbieAuggie2019
  Import Modules TheBunyip 4 1,252 Mar-10-2023, 04:47 PM
Last Post: buran
  a bunch of modules to import Skaperen 2 900 Nov-07-2022, 07:33 PM
Last Post: Gribouillis
  Pathlib import not working chriswrcg 9 3,734 May-29-2022, 07:37 PM
Last Post: snippsat
  Python modules for accessing the configuration of relevant paths Imago 1 1,384 May-07-2022, 07:28 PM
Last Post: Larz60+
  Visual Studio Code Intellisense for Imported Modules Not Working hockinsk 1 2,730 Apr-23-2022, 04:41 PM
Last Post: deanhystad
  Sending string commands from Python to a bluetooth device Rovelin 13 9,499 Aug-31-2021, 06:40 PM
Last Post: deanhystad
  Python library for win32 console commands eldiener 3 3,481 Aug-24-2021, 10:28 PM
Last Post: bowlofred
  Possible to execute a python script before log off/shutdown with input commands? Kaltex 1 2,280 May-18-2021, 06:31 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020