after pip successful installed: ModuleNotFoundError

后端 未结 5 1738
孤街浪徒
孤街浪徒 2021-01-07 23:36

I am trying to install the SimPy module so that I can use it in IDLE. However, everytime I try to import in IDLE, I got an error. I already tried reinstalling Python and Pip

5条回答
  •  执笔经年
    2021-01-08 00:23

    When this happened to me (on macOS), the problem turned out to be that the python installation I specified at the top of my script.py was not the same python installation that conda/pip were using on the command line.

    To get the command line and my script to match up, I changed the header in my script.py to just use:

    #!python
    

    Then when I ran ./script.py on the command line, everything finally worked.

提交回复
热议问题