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 and tried to modify the location of the apps. SimPy can be found in the directory of Python 2.7. I'm using python 3.6.1.
After I correctly installed simpy in the terminal:
pip install simpy
Requirement already satisfied: simpy in /Library/Python/2.7/site-packages
When I put into IDLE:
Import Simpy
I got the error:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
import simpy
ModuleNotFoundError: No module named 'simpy'
How can I solve this?
Maybe your python3 is try to find your script's module in the " /usr/local/lib/python3.x " directory . So if that module is not there then the ModuleNotFoundError: No module named 'dedupe' error is happening .
I'm not exactly sure, but it's possible that you can't use pip install Pyside2because Python only excepts pip install PySide2(Notice the difference in capitalization). Try uninstalling Pyside2 and running pip install PySide2. Share Improve this answer
Python module is not Installed You can get the issue when you are trying to import a module of a library which not installed in your virtual environment. So before importing a library’s module, you need to install it with the pip command. Let’s import an module (requests) into app.py file which is not installed into our virtual environment:
It did not work with the old AMI because pippoints tho python2's pipbut the setuptoolsinstalled is for python 3.6. You would probably have needed to install python-setuptools-36.2.7. It probably works on the other AMI because the correct setuptools is already installed.
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.
Wherever you're running your code, try this
import sys
sys.path
sys.executable
It might be possible that you're running python in one environment and the module is installed in another environment.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With