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
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.
Since you are using python 3.6.1, you may need to specify the type of python you want to install simpy for. Try running pip3 install simpy
to install the simpy module to your python3 library.
I had same problem (on Windows) and the root cause in my case was ANTIVIRUS software! It has "Auto-Containment" feature, that wraps running process with some kind of a virtual machine.
Symptoms are the same: pip install <module>
works fine in one cmd line window and import <module>
fails when executed from another process.
Wherever you're running your code, try this
import sys
sys.path
sys.executable
It might be possible you're running python in different environment and the module is installed in different environment.
What worked for me is that adding the module location to the sys.path
import sys
sys.path.insert(0, r"/path/to/your/module")