ModuleNotFoundError: No Module Named 'apsheduler' - flask

ERROR:-- "Exception has occurred: ModuleNotFoundError
No module named 'apscheduler'
File "F:\Finel Year Project\project_bone\backend.py", line 9, in
from apscheduler.schedulers.background import BackgroundScheduler"
I have installed the current version of apscheduler(3.6.3) and python(3.8) and also installed all the packages using command 'pip install APScheduler', but still it was showing the same above error.

Might be its issue of environment or python path, try executing
pip3 install apscheduler

Related

ModuleNotFoundError: No module named 'import-export' , but I have installed import-export

I'm using Django2.2.6, xadmin2.
I want to use import-export, however, the error goes:
ModuleNotFoundError: No module named 'import-export'
but I have run this code successfully
pip install django-import-export==2.7.0
Is there any way for me to fix it?

No module named torch.distributed

ImportError: No module named torch.distributed
File "train.py", line 4, in <module>
import torch.distributed as dist
ImportError: No module named torch.distributed
I installed CUDA AND cuDNN then created env and installed pip3 install torch torchvision but getting error.
This works for me:
Create a conda virtual environment:
conda create -n env_pytorch python=3.6
Active this environment create above:
source activate env_pytorch
Install PyTorch with pip or pip3:
pip install torchvision --user

pip: ImportError: No module named retrying

I'm trying to create a new environment and install various 3rd party packages on an Ubuntu machine. After having to install condo (for a matplotlib installation) and gdal, the pip function no longer works. Instead I receive:
Traceback (most recent call last):
File "/media/imagery/ENVIRONMENTS/Project_1/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 14, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python2.7/dist-packages/pip/utils/__init__.py", line 30, in <module>
from pip._vendor.retrying import retry
ImportError: No module named retrying
I've called pip both in and outside my environment, and still observe the same issue. Also I've tried a pip install --upgrade pip and still retrieve the same Traceback. Any ideas how to resolve this?
As a cheap workaround, export PYTHONPATH=" " seemed to work for now in order to install other packages, but as soon as I need the gdal package, I have to then set PYTHONPATH again.
I had a similar exception and could manage to repair it.
In my case I upgraded Ubuntu 16.04 to Ubuntu 18.04.
I had to re-create the virtualenv. Depending on your choice:
virtualenv .
Or
virtualenv --system-site-packages .

'ModuleNotFoundError: No module named 'MySQLdb' In Django

creating my first module in django,
I am using mac Tried steps:
1.installed python 3.6.+ version,
2.cloned git project
3.setup local env,
to create a module,
trying with command
env=dev python3 manage.py startapp supriya_module_inflow;
getting error in console :
Environment Selected :dev
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 24, in <module>
import MySQLdb as Database
ModuleNotFoundError: No module named 'MySQLdb'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 35, in <module>
execute_from_command_line(sys.argv)......
...
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'
MySQLdb does not support Python 3. You'll want to pick one of the other MySQL drivers.
At the time of writing, the latest release of MySQLdb (1.2.5) doesn’t support Python 3. In order to use MySQLdb under Python 3, you’ll have to install mysqlclient instead.
Here is How to install mysqlclient in Python using pip so as to be able to import MySQLdb in Django 3.1 when running Python 3.8.5..
The error message indicates that there is no module named MySQLdb. It means, Python needs a module to interface with MySQL database and that modules does not seems to be present in the system. All you need to do is, just install MySQL-Python module and the script should work without any problem.
Using Python Pip
pip install MySQL-python
Collecting MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
Successfully installed MySQL-python-1.2.5
On Ubuntu based systems
# apt-get install python-mysqldb
On RHEL/CentOS based systems:
# yum install MySQL-python
Using easy_install
# easy_install mysql-python
If you are on a virtual environment then
pip install MySQL-python
You can also check this related issue.
** Building wheel for MySQL-python (setup.py) ... error
ERROR: Command errored out with exit status 1:**
can't able to install MySQL-python and getting the above error .

No module named django.core.management,error while installing django in vm

When I try to run my server using:
./manage.py runserver 0.0.0.0:8000
I get the following error:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
After browsing for a solution, I learned that Django was not installed so I tried installing it on a VM.
I tried the following:
pip install django
yum install django
yum install python-django
I also tried running these commands with sudo -s and sudo -E.
I am getting the following when I use pip cmd:
Downloading/unpacking django
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement django
No distributions at all found for django
Storing complete log in /root/.pip/pip.log
Using Yum I get:
No package python-django available.
Error: Nothing to do
Install a new version of Python. Pip has to be installed for the new
version. CentOS 6.6 has default Python 2.6 and the default pip
doesn't work properly.
Install Django with new pip.
Do not install the new version of Python globally as CentOS relies on
Python 2.6 for yum.