Terminal issues error message that no Django module "models" exists, but it is in the directory - django-models

I'm a motivated beginner working my way through Python Crash Course. I created a project and an app using Django. I'm unable to get the python manage.py run server command to work. This is the header of the long error message:
"Watching for file changes with StatReloader
Exception in thread Django-main-thread".
The middle includes several lines of "".
At the end, it says "from models import Activity"
"ModuleNotFoundError: No module named 'models''
There IS a module named models in the directory. This is my second exercise using Django, and the program worked earlier. I've searched the net and read everything remotely similar, but have been unable to find a solution. How can I make the program recognize a module that is there?

I think the problem was that the version of pip in the virtual environment was the python 2.7 version instead of the 3.9 version I used to create the project. It had to be upgraded using:
python3 -m pip install --upgrade pip
I also used python3 for the manage.py runserver command instead of just python.

Related

lmfit packages conflicting in Windows 10 using Anaconda Python 3.7

I'm trying to use a curve fitting package (lmfit) I did use several times in former times with Python 2.7. Since I moved to Python 3.7, I'm facing some problems on running my script. The error message I get is "ModuleNotFoundError: No module named 'lmfit'".
If I try to reinstall/update the package (using whatever of the commands in https://anaconda.org/conda-forge/lmfit): it looks like there are conflicting packages in my pc. Here the screen of my prompt:
prompt after using 'conda install -c conda-forge/label/cf202003 lmfit'
Any hints on how to solve this conflict?
just install with pip install lmfit.

ModuleNotFoundError: No module named 'wagtail'. How to fix this?

I have tried to get wagtail up and running twice: once using the guide in https://engineertodeveloper.com/wagtail-developer-portfolio/ and this time using: https://docs.wagtail.io/en/v2.12.4/support.html. Both times the error comes after:
python manage.py migrate
pip freeze shows:
anyascii==0.2.0
asgiref==3.3.4
beautifulsoup4==4.8.2
certifi==2020.12.5
chardet==4.0.0
Django==3.1.8
django-filter==2.4.0
django-modelcluster==5.1
django-taggit==1.4.0
django-treebeard==4.5.1
djangorestframework==3.12.4
draftjs-exporter==2.1.7
et-xmlfile==1.0.1
html5lib==1.1
idna==2.10
l18n==2020.6.1
openpyxl==3.0.7
Pillow==8.2.0
pytz==2021.1
requests==2.25.1
six==1.15.0
soupsieve==2.2.1
sqlparse==0.4.1
tablib==3.0.0
urllib3==1.26.4
wagtail==2.12.4
webencodings==0.5.1
Willow==1.4
xlrd==2.0.1
XlsxWriter==1.3.9
xlwt==1.3.0
So I have installed wagtail (latest version)
As pointed out by Tibor at Slack, python sometimes becomes confused. Solution was to use
python -m pip
instead of just
pip

OpenEIS with VOLTTRON

When trying to use OpenEIS in VOLTTRON, I first need to install OpenEIS.
I managed to install Python 3.4, so I can run "python3 bootstrap.py" under ~/openeis-2.x
I managed to change the get-pip link in bootstrap to https://bootstrap.pypa.io/get-pip.py
However, when I ran the command, I got a series of error messages, the first two I am trying to overcome is "import pip ImportError: No module named 'pip' " and import ensurepip ImportError: No module named 'ensurepip'"
Isn't the purpose of downlaoding get-pip from the link, so I don't need to have pip and ensurepip when I run the code?
Thanks.
OpenEIS and VOLTTRON use two different versions of python. The get-pip script is specific to VOLTTRON as it is necessary for the 2.7 version of python in order to install pip. With OpenEIS pip is already installed so it shouldn't need to get-pip.
In order to get OpenEIS and VOLTTRON working you first need to get them installed separately. Once you have them running then you can use the OpenEISHistorian from VOLTTRON to send data to the OpenEIS instance.
I hope that helps and clears up some of the confusion that you are having.

Installation error numpy in Qpython

In Qpython which uses Python 2.7.2; I can't install the numpy module. The message I get is: command python setup.py egg_info failed with error code 2
I think it tries to install the Mac version***, which is obviously not compatible. At least, that's what it looked like when scrolling through the CLI output when issuing the pip install numpy command using the pip script.
I don't think the numpy/scipy modules are available for Qpython for Android. I think we're just going to have to wait. I've been googling this same question and I have not found an answer.
***Ok, the script says it's a version for a variety of OS', just not Android. I have no idea why pip install would download it if it wasn't compatible. It doesn't make sense, so I'm obviously missing something.

rethinkdb index-rebuild complains python driver is missing

Ran into this error when trying to run rethinkdb rebuild command:
Error when launching 'rethinkdb-index-rebuild': No such file or
directory The rethinkdb-index-rebuild command depends on the RethinkDB
Python driver, which must be installed. If the Python driver is
already installed, make sure that the PATH environment variable
includes the location of the backup scripts, and that the current user
has permission to access and run the scripts.
Yet I have the rethinkdb python module installed and path setup properly:
Requirement already satisfied (use --upgrade to upgrade): rethinkdb in
/Library/Python/2.7/site-packages Cleaning up...
Why doesn't this work?
If the rethinkdb-index-rebuild script is not in your PATH, you might be able to invoke the index-rebuild command as
python -mrethinkdb._index_rebuild
Turns out it was a feature implemented in a newer version of the python module. Solved it by:
sudo pip install --upgrade rethinkdb

Resources