Import Simpy in Python 3 - python-3.x

I am unable to import simpy in Python 3. It gives me this error
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-6-076c1059698e> in <module>
----> 1 import simpy
ModuleNotFoundError: No module named 'simpy'
Please tell me a way to do so?

Make sure the package is installed and available in your environment, as that is a common error when the package is not present.
Run:
pip install simpy
or if you have separate Python versions on your system:
pip3 install simpy
Or, if installing from the source code:
python setup.py install
or,
python3 setup.py install

Related

ModuleNotFoundError: No module named 'speech_recognition' - Linux

I am trying to install speech_recognition on Manjaro GNU/Linux x86_64 for Python 3.8 by using the following commands:
conda install -c conda-forge speechrecognition
And
pip3 install --upgrade speechrecognition
"conda list" command shows the following packages to be installed (amongst others):
portaudio, pyaudio, python_abi, readline, speechrecognition
However, when I try to import it:
import speech_recognition as st
It gives me the error:
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call
last) in
----> 1 import speech_recognition as st
ModuleNotFoundError: No module named 'speech_recognition'
How to fix this?
Thanks
SOLVED with:
conda install -c conda-forge jupyterlab

import Statsmodels issue

I have the latest Anaconda distribution and running Jupyter notebooks 6.0.2 with Python 3.7.
I am trying to import statsmodels and I am getting the following error.
I have done the
pip install statmodels
import statsmodels.api as sm
or
import statmodels
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-2fcb280597c8> in <module>
----> 1 import statmodels.api
ModuleNotFoundError: No module named 'statmodels'
Please help
Doing the following worked for me.
pip install git+https://github.com/statsmodels/statsmodels

pdfkit is working on python2 but it's not working in python3

import pdfkit
Error: Traceback (most recent call last):
File "<stdin>", line 1, in <module> ImportError: No module named 'pdfkit'
when i use pdfkit in python2 then it works fine, but if i use in python3 it gives the above error
Packages for Python 2 and Python 3 are completely separate. You have to install any package for both Python versions separately. Try:
sudo python3 -m pip install pdfkit

python3 "ModuleNotFoundError: No module named 'OpenGL'"

I am running python3. I've installed OpenGL (pip install OpenGL PyOpenGL_accelerate). When I run my program (python3 opengltest1.py) I get this error:
Traceback (most recent call last):
File "opengltest1.py", line 4, in <module>
from OpenGL.GL import *
The solution was to install OpenGL with pip3 instead of pip, i.e.
pip3 install pyopengl
#eyllanesc Thanks for the help. In following up on your suggestion, I found the solution.
This worked for me! You must download every package with pip3. All things are separated because the syntax is different from Python 2 to Python 3.

numpy intalled with pip but not found (in virtualenv)

In an AWS EC2 instance, with Amazon Linux AMI 2016.09 distribution, I have installed numpy, inside my virtualenv where python 3.4 is the default version, with:
pip install numpy
It installs package numpy-1.12.1-cp34-cp34m-manylinux1_x86_64.whl without errors.
After that, in python I try to import it:
>>> import numpy
And I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
Moreover, if I run pip freeze, numpy does not appear in the list.
Why is numpy not being found? and How to fix it?
Did you do this:
#:source .venv/bin/activate
.....
#:python
....
>>>pip3 install numpy
....
This works!

Resources