Python Forum
" No module named 'msvcrt' " for mac
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
" No module named 'msvcrt' " for mac
#1
So this is the problem I run into when I run my script, which is a .py file that I opened using IDLE, then I run the module (F5).

"
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.

============== RESTART: /Users/harman/Desktop/Tumblr Script.py ==============
Traceback (most recent call last):
  File "/Users/harman/Desktop/Tumblr Script.py", line 9, in <module>
    import msvcrt as m
ImportError: No module named 'msvcrt'
>>> 

"

I know that msvcrt is a microsoft file that I cannot use since I am running this on a mac, but I was wondering what I can do or change in the actual script that will allow me to run it on my macbook. Here are the first 20 or so lines of the script itself. I bolded the part which I think is causing the problem. All help is greatly appreciated since this is my first time running a script and really don't know anything about them in the first place. Thanks again!  :D

"

import os
import time
import sys
from datetime import datetime
import fileinput

def cls():
    os.system(['clear','cls'][os.name == 'nt'])
import msvcrt as m
def pause():
    m.getch()

cls()

try:
    import requests
except ImportError:
    os.system('%USERPROFILE%\AppData\Local\Programs\Python\Python35-32\Scripts\pip3.5.exe install requests')
    import requests

"

I also don't have the pip's on my computer and was wondering where I can get those. I tried installing them before but they told me I had an 'outdated location' and then sent me on a wild goose chase on this site: https://bootstrap.pypa.io/get-pip.py 

And when I do get them, what do I type in for the ".exe" part of the file above? Thanks!
Reply


Messages In This Thread
" No module named 'msvcrt' " for mac - by harmanjotuppal - Oct-11-2016, 10:35 PM
RE: " No module named 'msvcrt' " for mac - by wavic - Oct-11-2016, 11:06 PM
RE: " No module named 'msvcrt' " for mac - by wavic - Oct-11-2016, 11:18 PM
RE: " No module named 'msvcrt' " for mac - by wavic - Oct-11-2016, 11:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 899 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,833 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,607 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,470 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,533 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,351 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,052 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 9,155 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,024 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,875 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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